@@ -268,7 +268,7 @@ function _hover(gd, evt, subplot, noHoverEvent) {
268268 // mapped onto each of the currently selected overlaid subplots
269269 var xvalArray , yvalArray ;
270270
271- var itemnum , curvenum , cd , trace , subplotId , subploti , mode ,
271+ var itemnum , curvenum , cd , trace , subplotId , subploti , _mode ,
272272 xval , yval , pointData , closedataPreviousLength ;
273273
274274 // spikePoints: the set of candidate points we've found to draw spikes to
@@ -403,9 +403,9 @@ function _hover(gd, evt, subplot, noHoverEvent) {
403403 }
404404
405405 // within one trace mode can sometimes be overridden
406- mode = hovermode ;
407- if ( helpers . isUnifiedHover ( mode ) ) {
408- mode = mode . charAt ( 0 ) ;
406+ _mode = hovermode ;
407+ if ( helpers . isUnifiedHover ( _mode ) ) {
408+ _mode = _mode . charAt ( 0 ) ;
409409 }
410410
411411 // container for new point, also used to pass info into module.hoverPoints
@@ -463,20 +463,20 @@ function _hover(gd, evt, subplot, noHoverEvent) {
463463
464464 // for a highlighting array, figure out what
465465 // we're searching for with this element
466- if ( mode === 'array' ) {
466+ if ( _mode === 'array' ) {
467467 var selection = evt [ curvenum ] ;
468468 if ( 'pointNumber' in selection ) {
469469 pointData . index = selection . pointNumber ;
470- mode = 'closest' ;
470+ _mode = 'closest' ;
471471 } else {
472- mode = '' ;
472+ _mode = '' ;
473473 if ( 'xval' in selection ) {
474474 xval = selection . xval ;
475- mode = 'x' ;
475+ _mode = 'x' ;
476476 }
477477 if ( 'yval' in selection ) {
478478 yval = selection . yval ;
479- mode = mode ? 'closest' : 'y' ;
479+ _mode = _mode ? 'closest' : 'y' ;
480480 }
481481 }
482482 } else if ( customXVal !== undefined && customYVal !== undefined ) {
@@ -490,7 +490,7 @@ function _hover(gd, evt, subplot, noHoverEvent) {
490490 // Now if there is range to look in, find the points to hover.
491491 if ( hoverdistance !== 0 ) {
492492 if ( trace . _module && trace . _module . hoverPoints ) {
493- var newPoints = trace . _module . hoverPoints ( pointData , xval , yval , mode , {
493+ var newPoints = trace . _module . hoverPoints ( pointData , xval , yval , _mode , {
494494 hoverLayer : fullLayout . _hoverlayer
495495 } ) ;
496496
@@ -650,7 +650,7 @@ function _hover(gd, evt, subplot, noHoverEvent) {
650650
651651 // If in compare mode, select every point at position
652652 if (
653- helpers . isXYhover ( mode ) &&
653+ helpers . isXYhover ( _mode ) &&
654654 hoverData [ 0 ] . length !== 0 &&
655655 hoverData [ 0 ] . trace . type !== 'splom' // TODO: add support for splom
656656 ) {
0 commit comments