antvis/G6

"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

  1. Open the example
  2. Click the canvas to trigger the event that runs graph.changeData()
  3. 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


if you need to trigger an event after graph.changeData(), try graph.on('afterchangedata', ...)

posted by ravengao over 1 year ago

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] 10 months ago

Fund this Issue

$0.00
Funded

Pull requests