@@ -1020,6 +1020,9 @@ describe('Test hover label custom styling:', function() {
10201020 Plotly . plot ( gd , [ {
10211021 x : [ 1 , 2 , 3 ] ,
10221022 y : [ 1 , 2 , 1 ] ,
1023+ marker : {
1024+ color : [ 'yellow' , 'black' , 'cyan' ]
1025+ } ,
10231026 hoverlabel : {
10241027 font : {
10251028 color : [ 'red' , 'green' , 'blue' ] ,
@@ -1065,6 +1068,45 @@ describe('Test hover label custom styling:', function() {
10651068 path : [ 'rgb(255, 255, 255)' , 'rgb(255, 255, 255)' ] ,
10661069 text : [ 13 , 'Arial' , 'rgb(255, 255, 255)' ]
10671070 } ) ;
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+ } ) ;
10681110 } )
10691111 . catch ( fail )
10701112 . then ( done ) ;
0 commit comments