@@ -23,6 +23,11 @@ var MINSELECT = constants.MINSELECT;
2323
2424function getAxId ( ax ) { return ax . _id ; }
2525
26+ function visible ( searchInfo ) {
27+ var cd0 = searchInfo . cd [ 0 ] ;
28+ return cd0 && cd0 . trace && cd0 . trace . visible === true ;
29+ }
30+
2631module . exports = function prepSelect ( e , startX , startY , dragOptions , mode ) {
2732 var zoomLayer = dragOptions . gd . _fullLayout . _zoomlayer ,
2833 dragBBox = dragOptions . element . getBoundingClientRect ( ) ,
@@ -190,6 +195,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
190195 selection = [ ] ;
191196 for ( i = 0 ; i < searchTraces . length ; i ++ ) {
192197 searchInfo = searchTraces [ i ] ;
198+ if ( ! visible ( searchInfo ) ) continue ;
193199 var thisSelection = fillSelectionItem (
194200 searchInfo . selectPoints ( searchInfo , poly ) , searchInfo
195201 ) ;
@@ -218,6 +224,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
218224 outlines . remove ( ) ;
219225 for ( i = 0 ; i < searchTraces . length ; i ++ ) {
220226 searchInfo = searchTraces [ i ] ;
227+ if ( ! visible ( searchInfo ) ) continue ;
221228 searchInfo . selectPoints ( searchInfo , false ) ;
222229 }
223230
0 commit comments