Skip to content

Commit 6cae00c

Browse files
authored
Merge pull request #19514 from apache/fix/graph-dispose
fix(graph): fix force layout iteration timer doesn't stop after disposing the chart
2 parents 94dd855 + 690ebe6 commit 6cae00c

File tree

4 files changed

+65
-4
lines changed

4 files changed

+65
-4
lines changed

src/chart/graph/GraphView.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ class GraphView extends ChartView {
208208
}
209209

210210
dispose() {
211+
this.remove();
212+
211213
this._controller && this._controller.dispose();
212214
this._controllerHost = null;
213215
}
@@ -300,7 +302,11 @@ class GraphView extends ChartView {
300302
this._lineDraw.updateLayout();
301303
}
302304

303-
remove(ecModel: GlobalModel, api: ExtensionAPI) {
305+
remove() {
306+
clearTimeout(this._layoutTimeout);
307+
this._layouting = false;
308+
this._layoutTimeout = null;
309+
304310
this._symbolDraw && this._symbolDraw.remove();
305311
this._lineDraw && this._lineDraw.remove();
306312
}

test/graph-case.html

Lines changed: 56 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/runTest/actions/__meta__.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/runTest/actions/graph-case.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)