8000 refactor - less variable and use push · plotly/plotly.js@6e61bd8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6e61bd8

Browse files
committed
refactor - less variable and use push
1 parent 4ffb06c commit 6e61bd8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/components/legend/get_legend_data.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ module.exports = function getLegendData(calcdata, opts) {
7070

7171
// rearrange lgroupToTraces into a d3-friendly array of arrays
7272
var lgroupsLength = lgroups.length;
73-
var ltraces;
7473
var legendData;
7574

7675
// sort considering trace.legendrank and legend.traceorder
@@ -86,11 +85,11 @@ module.exports = function getLegendData(calcdata, opts) {
8685
};
8786

8887
if(hasOneNonBlankGroup && helpers.isGrouped(opts)) {
89-
legendData = new Array(lgroupsLength);
90-
88+
legendData = [];
9189
for(i = 0; i < lgroupsLength; i++) {
92-
ltraces = lgroupToTraces[lgroups[i]];
93-
legendData[i] = ltraces.sort(orderFn);
90+
legendData.push(
91+
lgroupToTraces[lgroups[i]].sort(orderFn)
92+
);
9493
}
9594
} else {
9695
// collapse all groups into one if all groups are blank

0 commit comments

Comments
 (0)
0