@@ -1020,6 +1020,9 @@ describe('Test hover label custom styling:', function() {
1020
1020
Plotly . plot ( gd , [ {
1021
1021
x : [ 1 , 2 , 3 ] ,
1022
1022
y : [ 1 , 2 , 1 ] ,
1023
+ marker : {
1024
+ color : [ 'yellow' , 'black' , 'cyan' ]
1025
+ } ,
1023
1026
hoverlabel : {
1024
1027
font : {
1025
1028
color : [ 'red' , 'green' , 'blue' ] ,
@@ -1065,6 +1068,45 @@ describe('Test hover label custom styling:', function() {
1065
1068
path : [ 'rgb(255, 255, 255)' , 'rgb(255, 255, 255)' ] ,
1066
1069
text : [ 13 , 'Arial' , 'rgb(255, 255, 255)' ]
1067
1070
} ) ;
1071
+
1072
+ // test base case
1073
+ return Plotly . update ( gd , { hoverlabel : null } , { hoverlabel : null } ) ;
1074
+ } )
1075
+ . then ( function ( ) {
1076
+ _hover ( gd , { xval : gd . _fullData [ 0 ] . x [ 0 ] } ) ;
1077
+
1078
+ assertPtLabel ( {
1079
+ path : [ 'rgb(255, 255, 0)' , 'rgb(68, 68, 68)' ] ,
1080
+ text : [ 13 , 'Arial' , 'rgb(68, 68, 68)' ]
1081
+ } ) ;
1082
+ assertCommonLabel ( {
1083
+ path : [ 'rgb(68, 68, 68)' , 'rgb(255, 255, 255)' ] ,
1084
+ text : [ 13 , 'Arial' , 'rgb(255, 255, 255)' ]
1085
+ } ) ;
1086
+ } )
1087
+ . then ( function ( ) {
1088
+ _hover ( gd , { xval : gd . _fullData [ 0 ] . x [ 1 ] } ) ;
1089
+
1090
+ assertPtLabel ( {
1091
+ path : [ 'rgb(0, 0, 0)' , 'rgb(255, 255, 255)' ] ,
1092
+ text : [ 13 , 'Arial' , 'rgb(255, 255, 255)' ]
1093
+ } ) ;
1094
+ assertCommonLabel ( {
1095
+ path : [ 'rgb(68, 68, 68)' , 'rgb(255, 255, 255)' ] ,
1096
+ text : [ 13 , 'Arial' , 'rgb(255, 255, 255)' ]
1097
+ } ) ;
1098
+ } )
1099
+ . then ( function ( ) {
1100
+ _hover ( gd , { xval : gd . _fullData [ 0 ] . x [ 2 ] } ) ;
1101
+
1102
+ assertPtLabel ( {
1103
+ path : [ 'rgb(0, 255, 255)' , 'rgb(68, 68, 68)' ] ,
1104
+ text : [ 13 , 'Arial' , 'rgb(68, 68, 68)' ]
1105
+ } ) ;
1106
+ assertCommonLabel ( {
1107
+ path : [ 'rgb(68, 68, 68)' , 'rgb(255, 255, 255)' ] ,
1108
+ text : [ 13 , 'Arial' , 'rgb(255, 255, 255)' ]
1109
+ } ) ;
1068
1110
} )
1069
1111
. catch ( fail )
1070
1112
. then ( done ) ;
0 commit comments