@@ -739,6 +739,10 @@ describe('Test box hover:', function() {
739
739
740
740
[ {
741
741
desc : 'base' ,
742
+ patch : function ( fig ) {
743
+ fig . layout . hovermode = 'x' ;
744
+ return fig ;
745
+ } ,
742
746
nums : [ 'median: 0.55' , 'min: 0' , 'q1: 0.3' , 'q3: 0.6' , 'max: 0.7' ] ,
743
747
name : [ 'radishes' , '' , '' , '' , '' ] ,
744
748
axis : 'day 1'
@@ -748,6 +752,7 @@ describe('Test box hover:', function() {
748
752
fig . data . forEach ( function ( trace ) {
749
753
trace . boxmean = true ;
750
754
} ) ;
755
+ fig . layout . hovermode = 'x' ;
751
756
return fig ;
752
757
} ,
753
758
nums : [ 'median: 0.55' , 'min: 0' , 'q1: 0.3' , 'q3: 0.6' , 'max: 0.7' , 'mean: 0.45' ] ,
@@ -759,6 +764,7 @@ describe('Test box hover:', function() {
759
764
fig . data . forEach ( function ( trace ) {
760
765
trace . boxmean = 'sd' ;
761
766
} ) ;
767
+ fig . layout . hovermode = 'x' ;
762
768
return fig ;
763
769
} ,
764
770
nums : [
@@ -770,6 +776,10 @@ describe('Test box hover:', function() {
770
776
} , {
771
777
desc : 'with boxpoints fences' ,
772
778
mock : require ( '@mocks/boxplots_outliercolordflt.json' ) ,
779
+ patch : function ( fig ) {
780
+ fig . layout . hovermode = 'x' ;
781
+ return fig ;
782
+ } ,
773
783
pos : [ 350 , 200 ] ,
774
784
nums : [
775
785
'median: 8.15' , 'min: 0.75' , 'q1: 6.8' ,
@@ -780,6 +790,7 @@ describe('Test box hover:', function() {
780
790
} , {
781
791
desc : 'with overlaid boxes' ,
782
792
patch : function ( fig ) {
793
+ fig . layout . hovermode = 'x' ;
783
794
fig . layout . boxmode = 'overlay' ;
784
795
return fig ;
785
796
} ,
@@ -799,7 +810,6 @@ describe('Test box hover:', function() {
799
810
trace . boxpoints = 'all' ;
800
811
trace . hoveron = 'points' ;
801
812
} ) ;
802
- fig . layout . hovermode = 'closest' ;
803
813
fig . layout . xaxis = { range : [ - 0.565 , 1.5 ] } ;
804
814
return fig ;
805
815
} ,
@@ -856,7 +866,6 @@ describe('Test box hover:', function() {
856
866
trace . hoveron = 'points' ;
857
867
trace . text = trace . y . map ( function ( v ) { return 'look:' + v ; } ) ;
858
868
} ) ;
859
- fig . layout . hovermode = 'closest' ;
860
869
fig . layout . xaxis = { range : [ - 0.565 , 1.5 ] } ;
861
870
return fig ;
862
871
} ,
@@ -871,7 +880,6 @@ describe('Test box hover:', function() {
871
880
trace . text = trace . y . map ( function ( v ) { return 'look:' + v ; } ) ;
872
881
trace . hoverinfo = 'text' ;
873
882
} ) ;
874
- fig . layout . hovermode = 'closest' ;
875
883
fig . layout . xaxis = { range : [ - 0.565 , 1.5 ] } ;
876
884
return fig ;
877
885
} ,
@@ -887,7 +895,6 @@ describe('Test box hover:', function() {
887
895
trace . hovertext = trace . y . map ( function ( v ) { return 'look:' + v ; } ) ;
888
896
trace . hoverinfo = 'text' ;
889
897
} ) ;
890
- fig . layout . hovermode = 'closest' ;
891
898
fig . layout . xaxis = { range : [ - 0.565 , 1.5 ] } ;
892
899
return fig ;
893
900
} ,
@@ -896,6 +903,10 @@ describe('Test box hover:', function() {
896
903
} , {
897
904
desc : 'orientation:h | hovermode:y' ,
898
905
mock : require ( '@mocks/box_grouped_horz.json' ) ,
906
+ patch : function ( fig ) {
907
+ fig . layout . hovermode = 'y' ;
908
+ return fig ;
909
+ } ,
899
910
pos : [ 430 , 130 ] ,
900
911
nums : [
901
912
'max: 1' , 'mean ± σ: 0.6833333 ± 0.2409472' , 'min: 0.3' ,
@@ -906,10 +917,6 @@ describe('Test box hover:', function() {
906
917
} , {
907
918
desc : 'orientation:h | hovermode:closest' ,
908
919
mock : require ( '@mocks/box_grouped_horz.json' ) ,
909
- patch : function ( fig ) {
910
- fig . layout . hovermode = 'closest' ;
911
- return fig ;
912
- } ,
913
920
pos : [ 430 , 130 ] ,
914
921
nums : [
915
922
'(max: 1, day 2)' , '(mean ± σ: 0.6833333 ± 0.2409472, day 2)' , '(min: 0.3, day 2)' ,
@@ -927,7 +934,6 @@ describe('Test box hover:', function() {
927
934
y : [ 13.1 , 14.2 , 14 , 13 , 13.3 ]
928
935
} ] ,
929
936
layout : {
930
- hovermode : 'closest' ,
931
937
xaxis : { range : [ 1.3775 , 2.5 ] }
932
938
}
933
939
} ,
@@ -942,7 +948,6 @@ describe('Test box hover:', function() {
942
948
trace . hoveron = 'points' ;
943
949
trace . hovertemplate = '%{y}<extra>pt #%{pointNumber}</extra>' ;
944
950
} ) ;
945
- fig . layout . hovermode = 'closest' ;
946
951
return fig ;
947
952
} ,
948
953
nums : '0.6' ,
@@ -955,6 +960,7 @@ describe('Test box hover:', function() {
955
960
y : [ 1 , 2 , 2 , 3 ]
956
961
} ] ,
957
962
layout : {
963
+ hovermode : 'x' ,
958
964
yaxis : { range : [ 1.6 , 2.4 ] } ,
959
965
width : 400 ,
960
966
height : 400
@@ -975,6 +981,7 @@ describe('Test box hover:', function() {
975
981
q3 : [ 3 ]
976
982
} ] ,
977
983
layout : {
984
+ hovermode : 'x' ,
978
985
width : 400 ,
979
986
height : 400
980
987
}
@@ -997,6 +1004,7 @@ describe('Test box hover:', function() {
997
1004
pointpos : 0
998
1005
} ] ,
999
1006
layout : {
1007
+ hovermode : 'x' ,
1000
1008
width : 400 ,
1001
1009
height : 400 ,
1002
1010
margin : { l : 0 , t : 0 , b : 0 , r : 0 }
@@ -1021,6 +1029,7 @@ describe('Test box hover:', function() {
1021
1029
hovertemplate : '%{x} | %{y}<extra>%{pointNumber[0]} | %{pointNumber[1]}</extra>'
1022
1030
} ] ,
1023
1031
layout : {
1032
+ hovermode : 'x' ,
1024
1033
width : 400 ,
1025
1034
height : 400 ,
1026
1035
margin : { l : 0 , t : 0 , b : 0 , r : 0 }
0 commit comments