@@ -739,6 +739,10 @@ describe('Test box hover:', function() {
739739
740740 [ {
741741 desc : 'base' ,
742+ patch : function ( fig ) {
743+ fig . layout . hovermode = 'x' ;
744+ return fig ;
745+ } ,
742746 nums : [ 'median: 0.55' , 'min: 0' , 'q1: 0.3' , 'q3: 0.6' , 'max: 0.7' ] ,
743747 name : [ 'radishes' , '' , '' , '' , '' ] ,
744748 axis : 'day 1'
@@ -748,6 +752,7 @@ describe('Test box hover:', function() {
748752 fig . data . forEach ( function ( trace ) {
749753 trace . boxmean = true ;
750754 } ) ;
755+ fig . layout . hovermode = 'x' ;
751756 return fig ;
752757 } ,
753758 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() {
759764 fig . data . forEach ( function ( trace ) {
760765 trace . boxmean = 'sd' ;
761766 } ) ;
767+ fig . layout . hovermode = 'x' ;
762768 return fig ;
763769 } ,
764770 nums : [
@@ -770,6 +776,10 @@ describe('Test box hover:', function() {
770776 } , {
771777 desc : 'with boxpoints fences' ,
772778 mock : require ( '@mocks/boxplots_outliercolordflt.json' ) ,
779+ patch : function ( fig ) {
780+ fig . layout . hovermode = 'x' ;
781+ return fig ;
782+ } ,
773783 pos : [ 350 , 200 ] ,
774784 nums : [
775785 'median: 8.15' , 'min: 0.75' , 'q1: 6.8' ,
@@ -780,6 +790,7 @@ describe('Test box hover:', function() {
780790 } , {
781791 desc : 'with overlaid boxes' ,
782792 patch : function ( fig ) {
793+ fig . layout . hovermode = 'x' ;
783794 fig . layout . boxmode = 'overlay' ;
784795 return fig ;
785796 } ,
@@ -799,7 +810,6 @@ describe('Test box hover:', function() {
799810 trace . boxpoints = 'all' ;
800811 trace . hoveron = 'points' ;
801812 } ) ;
802- fig . layout . hovermode = 'closest' ;
803813 fig . layout . xaxis = { range : [ - 0.565 , 1.5 ] } ;
804814 return fig ;
805815 } ,
@@ -856,7 +866,6 @@ describe('Test box hover:', function() {
856866 trace . hoveron = 'points' ;
857867 trace . text = trace . y . map ( function ( v ) { return 'look:' + v ; } ) ;
858868 } ) ;
859- fig . layout . hovermode = 'closest' ;
860869 fig . layout . xaxis = { range : [ - 0.565 , 1.5 ] } ;
861870 return fig ;
862871 } ,
@@ -871,7 +880,6 @@ describe('Test box hover:', function() {
871880 trace . text = trace . y . map ( function ( v ) { return 'look:' + v ; } ) ;
872881 trace . hoverinfo = 'text' ;
873882 } ) ;
874- fig . layout . hovermode = 'closest' ;
875883 fig . layout . xaxis = { range : [ - 0.565 , 1.5 ] } ;
876884 return fig ;
877885 } ,
@@ -887,7 +895,6 @@ describe('Test box hover:', function() {
887895 trace . hovertext = trace . y . map ( function ( v ) { return 'look:' + v ; } ) ;
888896 trace . hoverinfo = 'text' ;
889897 } ) ;
890- fig . layout . hovermode = 'closest' ;
891898 fig . layout . xaxis = { range : [ - 0.565 , 1.5 ] } ;
892899 return fig ;
893900 } ,
@@ -896,6 +903,10 @@ describe('Test box hover:', function() {
896903 } , {
897904 desc : 'orientation:h | hovermode:y' ,
898905 mock : require ( '@mocks/box_grouped_horz.json' ) ,
906+ patch : function ( fig ) {
907+ fig . layout . hovermode = 'y' ;
908+ return fig ;
909+ } ,
899910 pos : [ 430 , 130 ] ,
900911 nums : [
901912 'max: 1' , 'mean ± σ: 0.6833333 ± 0.2409472' , 'min: 0.3' ,
@@ -906,10 +917,6 @@ describe('Test box hover:', function() {
906917 } , {
907918 desc : 'orientation:h | hovermode:closest' ,
908919 mock : require ( '@mocks/box_grouped_horz.json' ) ,
909- patch : function ( fig ) {
910- fig . layout . hovermode = 'closest' ;
911- return fig ;
912- } ,
913920 pos : [ 430 , 130 ] ,
914921 nums : [
915922 '(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() {
927934 y : [ 13.1 , 14.2 , 14 , 13 , 13.3 ]
928935 } ] ,
929936 layout : {
930- hovermode : 'closest' ,
931937 xaxis : { range : [ 1.3775 , 2.5 ] }
932938 }
933939 } ,
@@ -942,7 +948,6 @@ describe('Test box hover:', function() {
942948 trace . hoveron = 'points' ;
943949 trace . hovertemplate = '%{y}<extra>pt #%{pointNumber}</extra>' ;
944950 } ) ;
945- fig . layout . hovermode = 'closest' ;
946951 return fig ;
947952 } ,
948953 nums : '0.6' ,
@@ -955,6 +960,7 @@ describe('Test box hover:', function() {
955960 y : [ 1 , 2 , 2 , 3 ]
956961 } ] ,
957962 layout : {
963+ hovermode : 'x' ,
958964 yaxis : { range : [ 1.6 , 2.4 ] } ,
959965 width : 400 ,
960966 height : 400
@@ -975,6 +981,7 @@ describe('Test box hover:', function() {
975981 q3 : [ 3 ]
976982 } ] ,
977983 layout : {
984+ hovermode : 'x' ,
978985 width : 400 ,
979986 height : 400
980987 }
@@ -997,6 +1004,7 @@ describe('Test box hover:', function() {
9971004 pointpos : 0
9981005 } ] ,
9991006 layout : {
1007+ hovermode : 'x' ,
10001008 width : 400 ,
10011009 height : 400 ,
10021010 margin : { l : 0 , t : 0 , b : 0 , r : 0 }
@@ -1021,6 +1029,7 @@ describe('Test box hover:', function() {
10211029 hovertemplate : '%{x} | %{y}<extra>%{pointNumber[0]} | %{pointNumber[1]}</extra>'
10221030 } ] ,
10231031 layout : {
1032+ hovermode : 'x' ,
10241033 width : 400 ,
10251034 height : 400 ,
10261035 margin : { l : 0 , t : 0 , b : 0 , r : 0 }
0 commit comments