@@ -433,10 +433,6 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
433
433
throttle . done ( throttleID ) . then ( function ( ) {
434
434
throttle . clear ( throttleID ) ;
435
435
436
- // Only points selected by the new selection are presented in eventData here
437
- // Should we provide all the selected points instead?
438
- dragOptions . gd . emit ( 'plotly_selected' , eventData ) ;
439
-
440
436
if ( ! immediateSelect && currentPolygon && dragOptions . selectionDefs ) {
441
437
// save last polygons
442
438
currentPolygon . subtract = subtract ;
@@ -454,6 +450,9 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
454
450
if ( dragOptions . doneFnCompleted ) {
455
451
dragOptions . doneFnCompleted ( selection ) ;
456
452
}
453
+
454
+ eventData . selections = gd . layout . selections ;
455
+ dragOptions . gd . emit ( 'plotly_selected' , eventData ) ;
457
456
} ) . catch ( Lib . error ) ;
458
457
} ;
459
458
}
@@ -531,6 +530,7 @@ function selectOnClick(evt, gd, xAxes, yAxes, subplot, dragOptions, polygonOutli
531
530
}
532
531
533
532
if ( sendEvents ) {
533
+ eventData . selections = gd . layout . selections ;
534
534
gd . emit ( 'plotly_selected' , eventData ) ;
535
535
}
536
536
}
@@ -1195,6 +1195,7 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
1195
1195
fillRangeItems ( eventData , poly ) ;
1196
1196
}
1197
1197
1198
+ eventData . selections = gd . layout . selections ;
1198
1199
gd . emit ( 'plotly_selected' , eventData ) ;
1199
1200
}
1200
1201
@@ -1215,6 +1216,7 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
1215
1216
1216
1217
if ( sendEvents ) {
1217
1218
if ( eventData . points . length ) {
1219
+ eventData . selections = gd . layout . selections ;
1218
1220
gd . emit ( 'plotly_selected' , eventData ) ;
1219
1221
} else {
1220
1222
gd . emit ( 'plotly_deselect' , null ) ;
0 commit comments