@@ -62,26 +62,19 @@ function hoverOnBars(pointData, xval, yval, hovermode) {
62
62
return Math . max ( thisBarMaxPos ( di ) , di . p + t . bardelta / 2 ) ;
63
63
} ;
64
64
65
- function hoverPositionFn ( _minPos , _maxPos ) {
65
+ function inbox ( _minPos , _maxPos , maxDistance ) {
66
66
// add a little to the pseudo-distance for wider bars, so that like scatter,
67
67
// if you are over two overlapping bars, the narrower one wins.
68
68
return Fx . inbox ( _minPos - posVal , _maxPos - posVal ,
69
- maxHoverDistance + Math . min ( 1 , Math . abs ( _maxPos - _minPos ) / pRangeCalc ) - 1 ) ;
70
- }
71
-
72
- function spikePositionFn ( _minPos , _maxPos ) {
73
- // add a little to the pseudo-distance for wider bars, so that like scatter,
74
- // if you are over two overlapping bars, the narrower one wins.
75
- return Fx . inbox ( _minPos - posVal , _maxPos - posVal ,
76
- maxSpikeDistance + Math . min ( 1 , Math . abs ( _maxPos - _minPos ) / pRangeCalc ) - 1 ) ;
69
+ maxDistance + Math . min ( 1 , Math . abs ( _maxPos - _minPos ) / pRangeCalc ) - 1 ) ;
77
70
}
78
71
79
72
function positionFn ( di ) {
80
- return hoverPositionFn ( minPos ( di ) , maxPos ( di ) ) ;
73
+ return inbox ( minPos ( di ) , maxPos ( di ) , maxHoverDistance ) ;
81
74
}
82
75
83
76
function thisBarPositionFn ( di ) {
84
- return spikePositionFn ( thisBarMinPos ( di ) , thisBarMaxPos ( di ) ) ;
77
+ return inbox ( thisBarMinPos ( di ) , thisBarMaxPos ( di ) , maxSpikeDistance ) ;
85
78
}
86
79
87
80
function getSize ( di ) {
0 commit comments