100pah commented on a change in pull request #10084: Update sankey diagram with 
levels setting, reducing code size and so on.
URL: 
https://github.com/apache/incubator-echarts/pull/10084#discussion_r264230102
 
 

 ##########
 File path: src/chart/sankey/sankeyLayout.js
 ##########
 @@ -141,14 +141,10 @@ function computeNodeBreadths(nodes, edges, nodeWidth, 
width, height, orient, nod
             if (isItemDepth && item.depth > maxNodeDepth) {
                 maxNodeDepth = item.depth;
             }
-            if (orient === 'vertical') {
-                node.setLayout({y: isItemDepth ? item.depth : x}, true);
-                node.setLayout({dy: nodeWidth}, true);
-            }
-            else {
-                node.setLayout({x: isItemDepth ? item.depth : x}, true);
-                node.setLayout({dx: nodeWidth}, true);
-            }
+            node.setLayout({depth: isItemDepth ? item.depth : x}, true);
+            orient === 'vertical' ? node.setLayout({dy: nodeWidth}, true)
 
 Review comment:
   Recomand code style: 
   ```js
   xxx
      ? yyy
      : zzz
   ```
   or 
   ```js
   xxx ? yyy : zzz
   ```
   or 
   ```js
   xxx 
       ? yyy : zzz
   ```
   See <http://echarts.apache.org/coding-standard.html>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to