diff --git a/src/chart/graph/GraphView.ts b/src/chart/graph/GraphView.ts index d5f51eba4c..f4559521fb 100644 --- a/src/chart/graph/GraphView.ts +++ b/src/chart/graph/GraphView.ts @@ -208,6 +208,8 @@ class GraphView extends ChartView { } dispose() { + this.remove(); + this._controller && this._controller.dispose(); this._controllerHost = null; } @@ -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(); } diff --git a/test/graph-case.html b/test/graph-case.html index 7f199f5a4a..4523593c7b 100644 --- a/test/graph-case.html +++ b/test/graph-case.html @@ -39,7 +39,7 @@
- +
@@ -154,6 +154,61 @@ }); + diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index fb743cb9c7..8592bb1bee 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -101,7 +101,7 @@ "geoScatter": 1, "getOption": 1, "graph": 2, - "graph-case": 1, + "graph-case": 2, "graph-grid": 1, "graph-simple": 2, "graphic-animation": 1, diff --git a/test/runTest/actions/graph-case.json b/test/runTest/actions/graph-case.json index ace16dc419..a4f3458490 100644 --- a/test/runTest/actions/graph-case.json +++ b/test/runTest/actions/graph-case.json @@ -1 +1 @@ -[{"name":"Action 1","ops":[{"type":"mousemove","time":475,"x":416,"y":188},{"type":"mousemove","time":675,"x":406,"y":208},{"type":"mousedown","time":848,"x":406,"y":210},{"type":"mousemove","time":881,"x":406,"y":210},{"type":"mouseup","time":979,"x":406,"y":210},{"time":980,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":1837,"x":406,"y":210},{"type":"mouseup","time":1988,"x":406,"y":210},{"time":1989,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2341,"x":406,"y":211},{"type":"mousemove","time":2541,"x":415,"y":180}],"scrollY":334,"scrollX":0,"timestamp":1684056156749}] \ No newline at end of file +[{"name":"Action 1","ops":[{"type":"mousemove","time":475,"x":416,"y":188},{"type":"mousemove","time":675,"x":406,"y":208},{"type":"mousedown","time":848,"x":406,"y":210},{"type":"mousemove","time":881,"x":406,"y":210},{"type":"mouseup","time":979,"x":406,"y":210},{"time":980,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":1837,"x":406,"y":210},{"type":"mouseup","time":1988,"x":406,"y":210},{"time":1989,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2341,"x":406,"y":211},{"type":"mousemove","time":2541,"x":415,"y":180}],"scrollY":334,"scrollX":0,"timestamp":1684056156749},{"name":"Action 2","ops":[{"type":"mousedown","time":677,"x":43,"y":180},{"type":"mousemove","time":683,"x":43,"y":180},{"type":"mouseup","time":853,"x":43,"y":180},{"time":854,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":886,"x":43,"y":180}],"scrollY":833,"scrollX":0,"timestamp":1705353513922}] \ No newline at end of file