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/06/23 21:49:00 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_r444528338



##########
File path: src/chart/sankey/SankeyView.js
##########
@@ -61,38 +61,60 @@ function fadeInItem(item, opacityPath) {
     el.highlight && el.highlight();
 }
 
+function sum(array, cb, orient) {
+    var sum = 0;
+    var len = array.length;
+    var i = -1;
+    while (++i < len) {
+        var value = +cb.call(array, array[i], orient);
+        if (!isNaN(value)) {
+            sum += value;
+        }
+    }

Review comment:
       Please try this es6 for..in looping syntax:
   
   var a =[ 3, 2, 1]
   for(index in a){
       // do something with it.
       console.log(index);
   }




----------------------------------------------------------------
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