@@ -28,6 +28,8 @@ var assertElemInside = customAssertions.assertElemInside;
28
28
29
29
var groupTitlesMock = require ( '../../image/mocks/legendgroup-titles' ) ;
30
30
31
+ var splomLogMock = require ( '../../image/mocks/splom_log' ) ;
32
+
31
33
function touch ( path , options ) {
32
34
var len = path . length ;
33
35
Lib . clearThrottle ( ) ;
@@ -2554,6 +2556,45 @@ describe('hover on subplots when hoversameaxis is set to true and y hovermodes',
2554
2556
} ) ;
2555
2557
} ) ;
2556
2558
2559
+ describe ( 'splom hover on subplots when hoversameaxis is set to true and (x|y) hovermodes' , function ( ) {
2560
+ 'use strict' ;
2561
+
2562
+ var mock = Lib . extendDeep ( { } , splomLogMock ) ;
2563
+ mock . layout . hovermode = 'x' ;
2564
+ mock . layout . hoversameaxis = true ;
2565
+
2566
+ var gd ;
2567
+
2568
+ beforeEach ( function ( done ) {
2569
+ gd = createGraphDiv ( ) ;
2570
+ Plotly . newPlot ( gd , mock ) . then ( done ) ;
2571
+ } ) ;
2572
+
2573
+ afterEach ( destroyGraphDiv ) ;
2574
+
2575
+ it ( 'splom hoversameaxis: true' , function ( ) {
2576
+ Lib . clearThrottle ( ) ;
2577
+ Plotly . Fx . hover ( gd , { x : 200 , y : 200 } , 'xy' ) ;
2578
+ expect ( gd . _hoverdata . length ) . toBe ( 3 ) ;
2579
+ assertHoverLabelContent ( {
2580
+ nums : [ '100' , '100k' ] ,
2581
+ name : [ '' , '' ] ,
2582
+ axis : '100'
2583
+ } ) ;
2584
+
2585
+ Plotly . relayout ( gd , 'hovermode' , 'x unified' ) ;
2586
+
2587
+ Lib . clearThrottle ( ) ;
2588
+ Plotly . Fx . hover ( gd , { x : 200 , y : 200 } , 'xy' ) ;
2589
+ expect ( gd . _hoverdata . length ) . toBe ( 3 ) ;
2590
+
2591
+ Plotly . relayout ( gd , 'hovermode' , 'y unified' ) ;
2592
+ Lib . clearThrottle ( ) ;
2593
+ Plotly . Fx . hover ( gd , { x : 200 , y : 200 } , 'xy' ) ;
2594
+ expect ( gd . _hoverdata . length ) . toBe ( 3 ) ;
2595
+ } ) ;
2596
+ } ) ;
2597
+
2557
2598
describe ( 'hover on many lines+bars' , function ( ) {
2558
2599
'use strict' ;
2559
2600
0 commit comments