Skip to content

Commit 057e4ac

Browse files
committed
prep for adding selection bounds to event data
1 parent 5be72de commit 057e4ac

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/plots/cartesian/select.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
5050
cd,
5151
trace,
5252
searchInfo,
53-
selection = [];
53+
selection = [],
54+
eventData;
5455
for(i = 0; i < gd.calcdata.length; i++) {
5556
cd = gd.calcdata[i];
5657
trace = cd[0].trace;
@@ -87,13 +88,15 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
8788
searchInfo = searchTraces[i];
8889
[].push.apply(selection, searchInfo.selectPoints(searchInfo, poly));
8990
}
90-
dragOptions.gd.emit('plotly_selecting', {points: selection});
91+
92+
eventData = {points: selection};
93+
dragOptions.gd.emit('plotly_selecting', eventData);
9194
};
9295

9396
dragOptions.doneFn = function(dragged, numclicks) {
9497
if(!dragged && numclicks === 2) dragOptions.doubleclick();
9598
else {
96-
dragOptions.gd.emit('plotly_selected', {points: selection});
99+
dragOptions.gd.emit('plotly_selected', eventData);
97100
}
98101
outlines.remove();
99102
for(i = 0; i < searchTraces.length; i++) {

0 commit comments

Comments
 (0)