@@ -216,6 +216,33 @@ describe('Test box hover:', function() {
216
216
'' , '' , '' , '' , '' , '' , '' , '' , '' , '' , 'radishes'
217
217
] ,
218
218
axis : 'day 1'
219
+ } , {
220
+ desc : 'text items on hover' ,
221
+ patch : function ( fig ) {
222
+ fig . data . forEach ( function ( trace ) {
223
+ trace . boxpoints = 'all' ;
224
+ trace . hoveron = 'points' ;
225
+ trace . text = trace . y . map ( function ( v ) { return 'look:' + v ; } ) ;
226
+ } ) ;
227
+ fig . layout . hovermode = 'closest' ;
228
+ return fig ;
229
+ } ,
230
+ nums : [ '(day 1, 0.7)\nlook:0.7' , '(day 1, 0.6)\nlook:0.6' , '(day 1, 0.6)\nlook:0.6' ] ,
231
+ name : [ 'radishes' , 'radishes' , 'radishes' ]
232
+ } , {
233
+ desc : 'only text items on hover' ,
234
+ patch : function ( fig ) {
235
+ fig . data . forEach ( function ( trace ) {
236
+ trace . boxpoints = 'all' ;
237
+ trace . hoveron = 'points' ;
238
+ trace . text = trace . y . map ( function ( v ) { return 'look:' + v ; } ) ;
239
+ trace . hoverinfo = 'text' ;
240
+ } ) ;
241
+ fig . layout . hovermode = 'closest' ;
242
+ return fig ;
243
+ } ,
244
+ nums : [ 'look:0.7' , 'look:0.6' , 'look:0.6' ] ,
245
+ name : [ '' , '' , '' ]
219
246
} ] . forEach ( function ( specs ) {
220
247
it ( 'should generate correct hover labels ' + specs . desc , function ( done ) {
221
248
run ( specs ) . catch ( fail ) . then ( done ) ;
0 commit comments