Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Graph force layout runs after dispose #19507

Closed
miserman opened this issue Jan 14, 2024 · 0 comments · Fixed by #19514
Closed

[Bug] Graph force layout runs after dispose #19507

miserman opened this issue Jan 14, 2024 · 0 comments · Fixed by #19514
Labels
bug en This issue is in English topic: graph

Comments

@miserman
Copy link

Version

5.4.3

Link to Minimal Reproduction

https://jsfiddle.net/6rx1hmou/43/

Steps to Reproduce

In the example, the text shows whether the graph is laying out. Uncomment chart.dispose() to see that it continues to layout with no chart.

To reproduce from scratch:

  1. Make a chart with graph type series and force layout, with enough data to take a little while to layout.
  2. Dispose chart.
  3. Look at CPU usage or log processes.

Current Behavior

Force layout steps continue to fire after chart has been disposed.

Expected Behavior

It would be nice if steps were stopped if the chart no longer exists, and maybe if there was a function to force steps to stop.
For now, before disposing, I'm manually clearing the timeout and setting _layouting to false.

Environment

- OS: Window 11
- Browser: Chrome 122.0.6238.2
- Framework: React@18.2.0

Any additional comments?

This came up in the context of a graph made dynamically from user input that could get quite large. After making a large graph, everything would slow down even after switching to a smaller one, because the first one was still being processed in the background.

@miserman miserman added the bug label Jan 14, 2024
@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Jan 14, 2024
@plainheart plainheart added topic: graph and removed pending We are not sure about whether this is a bug/new feature. labels Jan 15, 2024
@plainheart plainheart added this to the 5.5.0 milestone Jan 15, 2024
@plainheart plainheart removed this from the 5.5.0 milestone Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English topic: graph
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants