@@ -651,19 +651,21 @@ function _hover(gd, evt, subplot, noHoverEvent) {
651
651
} ;
652
652
sortHoverData ( ) ;
653
653
654
- // If in compare mode, select every point at position
655
654
if (
656
655
helpers . isXYhover ( _mode ) &&
657
656
hoverData [ 0 ] . length !== 0 &&
658
657
hoverData [ 0 ] . trace . type !== 'splom' // TODO: add support for splom
659
658
) {
659
+ // pick winning point
660
660
var winningPoint = hoverData [ 0 ] ;
661
+ // discard other points
661
662
hoverData = [ winningPoint ] ;
662
663
663
- var customXVal = customVal ( 'x' , winningPoint , fullLayout ) ;
664
- var customYVal = customVal ( 'y' , winningPoint , fullLayout ) ;
664
+ var winX = getCoord ( 'x' , winningPoint , fullLayout ) ;
665
+ var winY = getCoord ( 'y' , winningPoint , fullLayout ) ;
665
666
666
- findHoverPoints ( customXVal , customYVal ) ;
667
+ // in compare mode, select every point at position
668
+ findHoverPoints ( winX , winY ) ;
667
669
668
670
var finalPoints = [ ] ;
669
671
var seen = { } ;
@@ -1908,7 +1910,7 @@ function orderRangePoints(hoverData, hovermode) {
1908
1910
return first . concat ( second ) . concat ( last ) ;
1909
1911
}
1910
1912
1911
- function customVal ( axLetter , winningPoint , fullLayout ) {
1913
+ function getCoord ( axLetter , winningPoint , fullLayout ) {
1912
1914
var ax = winningPoint [ axLetter + 'a' ] ;
1913
1915
var val = winningPoint [ axLetter + 'Val' ] ;
1914
1916
0 commit comments