@@ -23,6 +23,11 @@ var MINSELECT = constants.MINSELECT;
23
23
24
24
function getAxId ( ax ) { return ax . _id ; }
25
25
26
+ function visible ( searchInfo ) {
27
+ var cd0 = searchInfo . cd [ 0 ] ;
28
+ return cd0 && cd0 . trace && cd0 . trace . visible === true ;
29
+ }
30
+
26
31
module . exports = function prepSelect ( e , startX , startY , dragOptions , mode ) {
27
32
var zoomLayer = dragOptions . gd . _fullLayout . _zoomlayer ,
28
33
dragBBox = dragOptions . element . getBoundingClientRect ( ) ,
@@ -190,6 +195,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
190
195
selection = [ ] ;
191
196
for ( i = 0 ; i < searchTraces . length ; i ++ ) {
192
197
searchInfo = searchTraces [ i ] ;
198
+ if ( ! visible ( searchInfo ) ) continue ;
193
199
var thisSelection = fillSelectionItem (
194
200
searchInfo . selectPoints ( searchInfo , poly ) , searchInfo
195
201
) ;
@@ -218,6 +224,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
218
224
outlines . remove ( ) ;
219
225
for ( i = 0 ; i < searchTraces . length ; i ++ ) {
220
226
searchInfo = searchTraces [ i ] ;
227
+ if ( ! visible ( searchInfo ) ) continue ;
221
228
searchInfo . selectPoints ( searchInfo , false ) ;
222
229
}
223
230
0 commit comments