@@ -69,13 +69,17 @@ function sankeyModel(layout, d, traceIndex) {
69
69
Lib . warn ( 'node.pad was reduced to ' , sankey . nodePadding ( ) , ' to fit within the figure.' ) ;
70
70
}
71
71
72
+ // Counters for nested loops
73
+ var i , j , k ;
74
+
72
75
// Create transient nodes for animations
73
76
for ( var nodePointNumber in calcData . _groupLookup ) {
74
77
var groupIndex = parseInt ( calcData . _groupLookup [ nodePointNumber ] ) ;
75
78
76
79
// Find node representing groupIndex
77
80
var groupingNode ;
78
- for ( var i = 0 ; i < graph . nodes . length ; i ++ ) {
81
+
82
+ for ( i = 0 ; i < graph . nodes . length ; i ++ ) {
79
83
if ( graph . nodes [ i ] . pointNumber === groupIndex ) {
80
84
groupingNode = graph . nodes [ i ] ;
81
85
break ;
@@ -100,7 +104,6 @@ function sankeyModel(layout, d, traceIndex) {
100
104
}
101
105
102
106
function computeLinkConcentrations ( ) {
103
- var i , j , k ;
104
107
for ( i = 0 ; i < graph . nodes . length ; i ++ ) {
105
108
var node = graph . nodes [ i ] ;
106
109
// Links connecting the same two nodes are part of a flow
@@ -167,7 +170,6 @@ function sankeyModel(layout, d, traceIndex) {
167
170
168
171
// Force node position
169
172
if ( trace . node . x . length !== 0 && trace . node . y . length !== 0 ) {
170
- var i ;
171
173
for ( i = 0 ; i < Math . min ( trace . node . x . length , trace . node . y . length , graph . nodes . length ) ; i ++ ) {
172
174
if ( trace . node . x [ i ] && trace . node . y [ i ] ) {
173
175
var pos = [ trace . node . x [ i ] * width , trace . node . y [ i ] * height ] ;
0 commit comments