Skip to content

Commit 753b2c9

Browse files
committed
unwrap [].push.apply
turns out this leads to stack errors when used with very large arrays anyway it's redundant for the first trace. thx @rreusser!
1 parent aa434dd commit 753b2c9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/plots/cartesian/select.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,15 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
186186
selection = [];
187187
for(i = 0; i < searchTraces.length; i++) {
188188
searchInfo = searchTraces[i];
189-
[].push.apply(selection, fillSelectionItem(
189+
var thisSelection = fillSelectionItem(
190190
searchInfo.selectPoints(searchInfo, poly), searchInfo
191-
));
191+
);
192+
if(selection.length) {
193+
for(var j = 0; j < thisSelection.length; j++) {
194+
selection.push(thisSelection[j]);
195+
}
196+
}
197+
else selection = thisSelection;
192198
}
193199

194200
eventData = {points: selection};

0 commit comments

Comments
 (0)