antvis/G6


The issue has been closed
"afterrender" event not executed after graph.changeData() #4758
curious-broccoli posted onGitHub
Describe the bug
The graph's "afterrender" event does not get triggered after changing data using graph.changeData(). The documentation says
graph.changeData(data, stack)
Change the data source, and render the graph according to the new data.
so I think the event should be executed after changing the data (and it automatically rendering after that). I tested it with 4.8.20 locally.
Your Example Website or App
https://codesandbox.io/s/jovial-artem-vvvllq?file=/index.js
Steps to Reproduce the Bug or Issue
- Open the example
- Click the canvas to trigger the event that runs graph.changeData()
- the console.log() call in the "afterrender" event is not executed
Expected behavior
Clicking the canvas to trigger the changeData() should result in the "afterrender" event being called, and then it should print the message.
Screenshots or Videos
No response
Platform
- OS: ArchLinux
- Browser: Firefox
- Version: 115.0.2
Additional context
No response