@@ -314,14 +314,12 @@ function hover(gd, evt, subplot){
314
314
var fullLayout = gd . _fullLayout ,
315
315
plotinfo = fullLayout . _plots [ subplot ] ,
316
316
//If the user passed in an array of subplots, use those instead of finding overlayed plots
317
- subplots = ( Object . prototype . toString . call ( subplot ) == "[object Array]" ) ?
317
+ subplots = Array . isArray ( subplot ) ?
318
318
subplot :
319
-
320
- subplots = [ subplot ] . concat ( plotinfo . overlays
319
+ // list of all overlaid subplots to look at
320
+ [ subplot ] . concat ( plotinfo . overlays
321
321
. map ( function ( pi ) { return pi . id ; } ) ) ,
322
322
323
- // list of all overlaid subplots to look at
324
-
325
323
xaArray = subplots . map ( function ( spId ) {
326
324
return Plotly . Axes . getFromId ( gd , spId , 'x' ) ;
327
325
} ) ,
@@ -539,7 +537,7 @@ function hover(gd, evt, subplot){
539
537
} ;
540
538
var hoverLabels = createHoverText ( hoverData , labelOpts ) ;
541
539
542
- hoverAvoidOverlaps ( hoverData , rotateLabels ? "xa" : "ya" ) ;
540
+ hoverAvoidOverlaps ( hoverData , rotateLabels ? 'xa' : 'ya' ) ;
543
541
544
542
alignHoverText ( hoverLabels , rotateLabels ) ;
545
543
@@ -1156,9 +1154,9 @@ function hoverAvoidOverlaps(hoverData, ax) {
1156
1154
p0 = g0 [ g0 . length - 1 ] ,
1157
1155
p1 = g1 [ 0 ] ;
1158
1156
topOverlap = p0 . pos + p0 . dp + p0 . size - p1 . pos - p1 . dp + p1 . size ;
1159
-
1157
+
1160
1158
//Only group points that lie on the same axes
1161
- if ( topOverlap > 0.01 && ( p0 . pmin == p1 . pmin ) && ( p0 . pmax == p1 . pmax ) ) {
1159
+ if ( topOverlap > 0.01 && ( p0 . pmin === p1 . pmin ) && ( p0 . pmax = == p1 . pmax ) ) {
1162
1160
// push the new point(s) added to this group out of the way
1163
1161
for ( j = g1 . length - 1 ; j >= 0 ; j -- ) g1 [ j ] . dp += topOverlap ;
1164
1162
0 commit comments