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 2022/06/07 05:39:29 UTC

[echarts] branch master updated: fix(tree): fix tree unexpected expand (#16548)

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

shenyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts.git


The following commit(s) were added to refs/heads/master by this push:
     new 3ece5c065 fix(tree): fix tree unexpected expand (#16548)
3ece5c065 is described below

commit 3ece5c0658941a406ffe50e04bb8af991391a52d
Author: linghaoSu <56...@users.noreply.github.com>
AuthorDate: Tue Jun 7 13:39:21 2022 +0800

    fix(tree): fix tree unexpected expand (#16548)
    
    * fix(tree): fix tree unexpected expand
    
    * [fix] remove redunant format code
    
    * style: tweak code to be more clear
    
    Co-authored-by: pissang <bm...@gmail.com>
---
 src/chart/tree/TreeView.ts              | 5 ++++-
 test/runTest/actions/__meta__.json      | 1 +
 test/runTest/actions/tree-polyline.json | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/chart/tree/TreeView.ts b/src/chart/tree/TreeView.ts
index 2fab46a34..bd6a4ecc6 100644
--- a/src/chart/tree/TreeView.ts
+++ b/src/chart/tree/TreeView.ts
@@ -535,6 +535,8 @@ function drawEdge(
     const edgeForkPosition = seriesModel.get('edgeForkPosition');
     const lineStyle = itemModel.getModel('lineStyle').getLineStyle();
     let edge = symbolEl.__edge;
+    // curve edge from node -> parent
+    // polyline edge from node -> children
     if (edgeShape === 'curve') {
         if (node.parentNode && node.parentNode !== virtualRoot) {
             if (!edge) {
@@ -583,7 +585,8 @@ function drawEdge(
         }
     }
 
-    if (edge) {
+    // show all edge when edgeShape is 'curve', filter node `isExpand` is false when edgeShape is 'polyline'
+    if (edge && !(edgeShape === 'polyline' && !node.isExpand)) {
         edge.useStyle(zrUtil.defaults({
             strokeNoScale: true, fill: null
         }, lineStyle));
diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json
index a46838963..473fa64b8 100644
--- a/test/runTest/actions/__meta__.json
+++ b/test/runTest/actions/__meta__.json
@@ -190,6 +190,7 @@
   "tree-image": 1,
   "tree-legend": 1,
   "tree-radial": 2,
+  "tree-polyline": 1,
   "treemap-action": 3,
   "treemap-disk": 3,
   "treemap-disk2": 3,
diff --git a/test/runTest/actions/tree-polyline.json b/test/runTest/actions/tree-polyline.json
new file mode 100644
index 000000000..0804954af
--- /dev/null
+++ b/test/runTest/actions/tree-polyline.json
@@ -0,0 +1 @@
+[{"name":"Action 1","ops":[{"type":"mousemove","time":1697,"x":518,"y":593},{"type":"mousemove","time":1907,"x":481,"y":502},{"type":"mousemove","time":2114,"x":454,"y":483},{"type":"mousemove","time":2330,"x":448,"y":490},{"type":"mousedown","time":2590,"x":448,"y":492},{"type":"mousemove","time":2624,"x":448,"y":492},{"type":"mouseup","time":2704,"x":448,"y":492},{"time":2705,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":3048,"x":449,"y":492},{"type":"mousemove","tim [...]
\ No newline at end of file


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