You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/11/09 10:10:35 UTC

[incubator-echarts] 01/01: fix(tree): fix tree edge animation.

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch fix-tree-animation
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit 5139ee86373226449a88a781435e8478dee41b7e
Author: pissang <bm...@gmail.com>
AuthorDate: Mon Nov 9 18:06:38 2020 +0800

    fix(tree): fix tree edge animation.
---
 src/chart/tree/TreeView.ts | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/chart/tree/TreeView.ts b/src/chart/tree/TreeView.ts
index d8ecec8..1a22bcd 100644
--- a/src/chart/tree/TreeView.ts
+++ b/src/chart/tree/TreeView.ts
@@ -45,6 +45,9 @@ type TreeSymbol = SymbolClz & {
     __radialOldRawY: number
     __radialRawX: number
     __radialRawY: number
+
+    __oldX: number
+    __oldY: number
 };
 
 class TreeEdgeShape {
@@ -385,8 +388,8 @@ function updateNode(
     const sourceLayout = source.getLayout() as TreeNodeLayout;
     const sourceOldLayout = sourceSymbolEl
         ? {
-            x: sourceSymbolEl.x,
-            y: sourceSymbolEl.y,
+            x: sourceSymbolEl.__oldX,
+            y: sourceSymbolEl.__oldY,
             rawX: sourceSymbolEl.__radialOldRawX,
             rawY: sourceSymbolEl.__radialOldRawY
         }
@@ -415,6 +418,10 @@ function updateNode(
 
     group.add(symbolEl);
     data.setItemGraphicEl(dataIndex, symbolEl);
+
+    symbolEl.__oldX = symbolEl.x;
+    symbolEl.__oldY = symbolEl.y;
+
     graphic.updateProps(symbolEl, {
         x: targetLayout.x,
         y: targetLayout.y


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org