Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b3eeab

Browse files
committed
no need to loop over all the traces when waterfallmode is not group
1 parent 3b984ff commit 6b3eeab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/traces/waterfall/defaults.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ function crossTraceDefaults(fullData, fullLayout) {
8282
return Lib.coerce(traceOut._input, traceOut, attributes, attr);
8383
}
8484

85-
for(var i = 0; i < fullData.length; i++) {
86-
traceOut = fullData[i];
85+
if(fullLayout.waterfallmode === 'group') {
86+
for(var i = 0; i < fullData.length; i++) {
87+
traceOut = fullData[i];
88+
traceIn = traceOut._input;
8789

88-
traceIn = traceOut._input;
89-
if(fullLayout.waterfallmode === 'group') {
9090
handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce);
9191
}
9292
}

0 commit comments

Comments
 (0)