@@ -52,6 +52,7 @@ function hoverOnBars(pointData, xval, yval, hovermode, opts) {
52
52
}
53
53
54
54
var period = trace [ posLetter + 'period' ] ;
55
+ var isClosestOrPeriod = isClosest || period ;
55
56
56
57
function thisBarMinPos ( di ) { return thisBarExtPos ( di , - 1 ) ; }
57
58
function thisBarMaxPos ( di ) { return thisBarExtPos ( di , 1 ) ; }
@@ -62,7 +63,7 @@ function hoverOnBars(pointData, xval, yval, hovermode, opts) {
62
63
return di [ posLetter ] + sgn * w / 2 ;
63
64
}
64
65
65
- var minPos = isClosest || period ?
66
+ var minPos = isClosestOrPeriod ?
66
67
thisBarMinPos :
67
68
function ( di ) {
68
69
/*
@@ -80,7 +81,7 @@ function hoverOnBars(pointData, xval, yval, hovermode, opts) {
80
81
return Math . min ( thisBarMinPos ( di ) , di . p - t . bardelta / 2 ) ;
81
82
} ;
82
83
83
- var maxPos = isClosest || period ?
84
+ var maxPos = isClosestOrPeriod ?
84
85
thisBarMaxPos :
85
86
function ( di ) {
86
87
return Math . max ( thisBarMaxPos ( di ) , di . p + t . bardelta / 2 ) ;
@@ -156,7 +157,7 @@ function hoverOnBars(pointData, xval, yval, hovermode, opts) {
156
157
// if we get here and we're not in 'closest' mode, push min/max pos back
157
158
// onto the group - even though that means occasionally the mouse will be
158
159
// over the hover label.
159
- if ( ! isClosest && ! period ) {
160
+ if ( ! isClosestOrPeriod ) {
160
161
minPos = function ( di ) {
161
162
return Math . min ( thisBarMinPos ( di ) , di . p - t . bargroupwidth / 2 ) ;
162
163
} ;
0 commit comments