@@ -107,16 +107,16 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
107
107
// always will show up regardless of point size, but
108
108
// prioritize smaller points
109
109
var rad = Math . max ( 3 , di . mrc || 0 ) ;
110
- return Math . max ( Math . abs ( xa . c2p ( di . x ) - xa . c2p ( xval ) ) - rad , 1 - 3 / rad ) ;
110
+ return Math . max ( Math . abs ( xa . c2p ( di . x ) - xpx ) - rad , 1 - 3 / rad ) ;
111
111
} ,
112
112
dy = function ( di ) {
113
113
var rad = Math . max ( 3 , di . mrc || 0 ) ;
114
- return Math . max ( Math . abs ( ya . c2p ( di . y ) - ya . c2p ( yval ) ) - rad , 1 - 3 / rad ) ;
114
+ return Math . max ( Math . abs ( ya . c2p ( di . y ) - ypx ) - rad , 1 - 3 / rad ) ;
115
115
} ,
116
116
dxy = function ( di ) {
117
117
var rad = Math . max ( 3 , di . mrc || 0 ) ,
118
- dx = Math . abs ( xa . c2p ( di . x ) - xa . c2p ( xval ) ) ,
119
- dy = Math . abs ( ya . c2p ( di . y ) - ya . c2p ( yval ) ) ;
118
+ dx = xa . c2p ( di . x ) - xpx ,
119
+ dy = ya . c2p ( di . y ) - ypx ;
120
120
return Math . max ( Math . sqrt ( dx * dx + dy * dy ) - rad , 1 - 3 / rad ) ;
121
121
} ,
122
122
distfn = Fx . getDistanceFunction ( hovermode , dx , dy , dxy ) ;
@@ -132,15 +132,17 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
132
132
yc = ya . c2p ( di . y , true ) ,
133
133
rad = di . mrc || 1 ;
134
134
135
- pointData . color = getTraceColor ( trace , di ) ;
135
+ Lib . extendFlat ( pointData , {
136
+ color : getTraceColor ( trace , di ) ,
136
137
137
- pointData . x0 = xc - rad ;
138
- pointData . x1 = xc + rad ;
139
- pointData . xLabelVal = di . x ;
138
+ x0 : xc - rad ,
139
+ x1 : xc + rad ,
140
+ xLabelVal : di . x ,
140
141
141
- pointData . y0 = yc - rad ;
142
- pointData . y1 = yc + rad ;
143
- pointData . yLabelVal = di . y ;
142
+ y0 : yc - rad ,
143
+ y1 : yc + rad ,
144
+ yLabelVal : di . y
145
+ } ) ;
144
146
145
147
if ( di . tx ) pointData . text = di . tx ;
146
148
else if ( trace . text ) pointData . text = trace . text ;
0 commit comments