You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/12/23 17:53:43 UTC

[GitHub] [incubator-echarts] chfw commented on a change in pull request #12821: feat(sankey): provide layout with unequal input and output paths

chfw commented on a change in pull request #12821:
URL: https://github.com/apache/incubator-echarts/pull/12821#discussion_r548090387



##########
File path: src/chart/sankey/SankeyView.js
##########
@@ -61,38 +61,58 @@ function fadeInItem(item, opacityPath) {
     el.highlight && el.highlight();
 }
 
+function sum(array, cb, orient) {
+    var sum = 0;
+    zrUtil.each(array, function (data) {
+      var value = +cb.call(array, data, orient);
+        if (!isNaN(value)) {
+            sum += value;
+        }
+    });
+    return sum;
+}
+
+function getEdgeValue(edge) {
+    return edge.getValue();
+}
+
 var SankeyShape = graphic.extendShape({
     shape: {
         x1: 0, y1: 0,
         x2: 0, y2: 0,
         cpx1: 0, cpy1: 0,
         cpx2: 0, cpy2: 0,
         extent: 0,
-        orient: ''
+        extent1: 0,
+        extent2: 0,
+        orient: '',
+        mode: ''
     },

Review comment:
       a human readable variable name would improve its maintenance effort greatly.




----------------------------------------------------------------
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:
users@infra.apache.org



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