Skip to content

Commit

Permalink
fix(graph): fix force layout iteration timer doesn't stop after dispo…
Browse files Browse the repository at this point in the history
…sing the chart
  • Loading branch information
plainheart committed Jan 15, 2024
1 parent 94dd855 commit 690ebe6
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/chart/graph/GraphView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ class GraphView extends ChartView {
}

dispose() {
this.remove();

this._controller && this._controller.dispose();
this._controllerHost = null;
}
Expand Down Expand Up @@ -300,7 +302,11 @@ class GraphView extends ChartView {
this._lineDraw.updateLayout();
}

remove(ecModel: GlobalModel, api: ExtensionAPI) {
remove() {
clearTimeout(this._layoutTimeout);
this._layouting = false;
this._layoutTimeout = null;

this._symbolDraw && this._symbolDraw.remove();
this._lineDraw && this._lineDraw.remove();
}
Expand Down
57 changes: 56 additions & 1 deletion test/graph-case.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/runTest/actions/__meta__.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/runTest/actions/graph-case.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 690ebe6

Please sign in to comment.