@@ -218,7 +218,6 @@ describe('Test gl3d plots', function() {
218
218
} ) ;
219
219
} )
220
220
. then ( _hover )
221
- . then ( delay ( 20 ) )
222
221
. then ( function ( ) {
223
222
assertHoverLabelContent (
224
223
{
@@ -231,11 +230,12 @@ describe('Test gl3d plots', function() {
231
230
. then ( done ) ;
232
231
} ) ;
233
232
234
- it ( '@noCI @ gl should display correct hover labels and emit correct event data (scatter3d case)' , function ( done ) {
233
+ it ( '@gl should display correct hover labels and emit correct event data (scatter3d case)' , function ( done ) {
235
234
var _mock = Lib . extendDeep ( { } , mock2 ) ;
236
235
237
236
function _hover ( ) {
238
- mouseEvent ( 'mouseover' , 605 , 271 ) ;
237
+ mouseEvent ( 'mouseover' , 0 , 0 )
238
+ mouseEvent ( 'mouseover' , 655 , 221 ) ;
239
239
return delay ( 20 ) ( ) ;
240
240
}
241
241
@@ -247,14 +247,13 @@ describe('Test gl3d plots', function() {
247
247
} ) ;
248
248
} )
249
249
. then ( _hover )
250
- . then ( delay ( 20 ) )
251
250
. then ( function ( ) {
252
- assertHoverText ( 'x: 134.03 ' , 'y: −163.59 ' , 'z: −163.59 ' ) ;
253
- assertEventData ( 134.03 , - 163.59 , - 163.59 , 0 , 3 , {
254
- 'marker.symbol' : undefined ,
255
- 'marker.size' : 40 ,
256
- 'marker.color' : 'black ' ,
257
- 'marker.line.color' : undefined
251
+ assertHoverText ( 'x: 100.75 ' , 'y: −102.63 ' , 'z: −102.63 ' ) ;
252
+ assertEventData ( 100.75 , - 102.63 , - 102.63 , 0 , 0 , {
253
+ 'marker.symbol' : 'circle' ,
254
+ 'marker.size' : 10 ,
255
+ 'marker.color' : 'blue ' ,
256
+ 'marker.line.color' : 'black'
258
257
} ) ;
259
258
assertHoverLabelStyle ( d3 . selectAll ( 'g.hovertext' ) , {
260
259
bgcolor : 'rgb(0, 0, 255)' ,
@@ -270,15 +269,15 @@ describe('Test gl3d plots', function() {
270
269
} )
271
270
. then ( _hover )
272
271
. then ( function ( ) {
273
- assertHoverText ( 'x: Feb 1, 2017 ' , 'y: −163.59 ' , 'z: −163.59 ' ) ;
272
+ assertHoverText ( 'x: Jan 11, 2016 ' , 'y: −102.63 ' , 'z: −102.63 ' ) ;
274
273
275
274
return Plotly . restyle ( gd , {
276
275
x : [ [ new Date ( 2017 , 2 , 1 ) , new Date ( 2017 , 2 , 2 ) , new Date ( 2017 , 2 , 3 ) , new Date ( 2017 , 2 , 4 ) ] ]
277
276
} ) ;
278
277
} )
279
278
. then ( _hover )
280
279
. then ( function ( ) {
281
- assertHoverText ( 'x: Mar 4 , 2017' , 'y: −163.59 ' , 'z: −163.59 ' ) ;
280
+ assertHoverText ( 'x: Mar 1 , 2017' , 'y: −102.63 ' , 'z: −102.63 ' ) ;
282
281
283
282
return Plotly . update ( gd , {
284
283
y : [ [ 'a' , 'b' , 'c' , 'd' ] ] ,
@@ -289,25 +288,25 @@ describe('Test gl3d plots', function() {
289
288
} )
290
289
. then ( _hover )
291
290
. then ( function ( ) {
292
- assertHoverText ( 'x: Mar 4 , 2017' , 'y: d ' , 'z: 10B ' ) ;
291
+ assertHoverText ( 'x: Mar 1 , 2017' , 'y: a ' , 'z: 10 ' ) ;
293
292
294
293
return Plotly . relayout ( gd , 'scene.xaxis.calendar' , 'chinese' ) ;
295
294
} )
296
295
. then ( _hover )
297
296
. then ( function ( ) {
298
- assertHoverText ( 'x: 二 7 , 2017' , 'y: d ' , 'z: 10B ' ) ;
297
+ assertHoverText ( 'x: 二 4 , 2017' , 'y: a ' , 'z: 10 ' ) ;
299
298
300
299
return Plotly . restyle ( gd , 'text' , [ [ 'A' , 'B' , 'C' , 'D' ] ] ) ;
301
300
} )
302
301
. then ( _hover )
303
302
. then ( function ( ) {
304
- assertHoverText ( 'x: 二 7 , 2017' , 'y: d ' , 'z: 10B ' , 'D ' ) ;
303
+ assertHoverText ( 'x: 二 4 , 2017' , 'y: a ' , 'z: 10 ' , 'A ' ) ;
305
304
306
305
return Plotly . restyle ( gd , 'hovertext' , [ [ 'Apple' , 'Banana' , 'Clementine' , 'Dragon fruit' ] ] ) ;
307
306
} )
308
307
. then ( _hover )
309
308
. then ( function ( ) {
310
- assertHoverText ( 'x: 二 7 , 2017' , 'y: d ' , 'z: 10B ' , 'Dragon fruit ' ) ;
309
+ assertHoverText ( 'x: 二 4 , 2017' , 'y: a ' , 'z: 10 ' , 'Apple ' ) ;
311
310
312
311
return Plotly . restyle ( gd , {
313
312
'hoverlabel.bgcolor' : [ [ 'red' , 'blue' , 'green' , 'yellow' ] ] ,
@@ -317,11 +316,11 @@ describe('Test gl3d plots', function() {
317
316
. then ( _hover )
318
317
. then ( function ( ) {
319
318
assertHoverLabelStyle ( d3 . selectAll ( 'g.hovertext' ) , {
320
- bgcolor : 'rgb(255, 255 , 0)' ,
321
- bordercolor : 'rgb(68, 68, 68 )' ,
319
+ bgcolor : 'rgb(255, 0 , 0)' ,
320
+ bordercolor : 'rgb(255, 255, 255 )' ,
322
321
fontSize : 20 ,
323
322
fontFamily : 'Arial' ,
324
- fontColor : 'rgb(68, 68, 68 )'
323
+ fontColor : 'rgb(255, 255, 255 )'
325
324
} , 'restyled' ) ;
326
325
327
326
return Plotly . relayout ( gd , {
@@ -333,7 +332,7 @@ describe('Test gl3d plots', function() {
333
332
. then ( _hover )
334
333
. then ( function ( ) {
335
334
assertHoverLabelStyle ( d3 . selectAll ( 'g.hovertext' ) , {
336
- bgcolor : 'rgb(255, 255 , 0)' ,
335
+ bgcolor : 'rgb(255, 0 , 0)' ,
337
336
bordercolor : 'rgb(255, 255, 0)' ,
338
337
fontSize : 20 ,
339
338
fontFamily : 'Roboto' ,
@@ -347,18 +346,18 @@ describe('Test gl3d plots', function() {
347
346
var label = d3 . selectAll ( 'g.hovertext' ) ;
348
347
349
348
expect ( label . size ( ) ) . toEqual ( 1 ) ;
350
- expect ( label . select ( 'text' ) . text ( ) ) . toEqual ( 'x: 二 7 , 2017y: dz: 10BDragon fruit ' ) ;
349
+ expect ( label . select ( 'text' ) . text ( ) ) . toEqual ( 'x: 二 4 , 2017y: az: 10Apple ' ) ;
351
350
352
351
return Plotly . restyle ( gd , 'hoverinfo' , [ [ null , null , 'dont+know' , null ] ] ) ;
353
352
} )
354
353
. then ( _hover )
355
354
. then ( function ( ) {
356
- assertHoverText ( 'x: 二 7 , 2017' , 'y: d ' , 'z: 10B ' , 'Dragon fruit ' ) ;
355
+ assertHoverText ( 'x: 二 4 , 2017' , 'y: a ' , 'z: 10 ' , 'Apple ' ) ;
357
356
358
357
return Plotly . restyle ( gd , 'hoverinfo' , 'text' ) ;
359
358
} )
360
359
. then ( function ( ) {
361
- assertHoverText ( null , null , null , 'Dragon fruit ' ) ;
360
+ assertHoverText ( null , null , null , 'Apple ' ) ;
362
361
363
362
return Plotly . restyle ( gd , 'hovertext' , 'HEY' ) ;
364
363
} )
@@ -368,18 +367,18 @@ describe('Test gl3d plots', function() {
368
367
return Plotly . restyle ( gd , 'hoverinfo' , 'z' ) ;
369
368
} )
370
369
. then ( function ( ) {
371
- assertHoverText ( null , null , '10B ' ) ;
370
+ assertHoverText ( null , null , '10 ' ) ;
372
371
373
372
return Plotly . restyle ( gd , 'hovertemplate' , 'THIS Y -- %{y}<extra></extra>' ) ;
374
373
} )
375
374
. then ( function ( ) {
376
- assertHoverText ( null , null , null , 'THIS Y -- d ' ) ;
375
+ assertHoverText ( null , null , null , 'THIS Y -- a ' ) ;
377
376
} )
378
377
. catch ( failTest )
379
378
. then ( done ) ;
380
379
} ) ;
381
380
382
- it ( '@noCI @ gl should display correct hover labels and emit correct event data (surface case)' , function ( done ) {
381
+ it ( '@gl should display correct hover labels and emit correct event data (surface case)' , function ( done ) {
383
382
var _mock = Lib . extendDeep ( { } , mock3 ) ;
384
383
385
384
function _hover ( ) {
@@ -395,7 +394,6 @@ describe('Test gl3d plots', function() {
395
394
} ) ;
396
395
} )
397
396
. then ( _hover )
398
- . then ( delay ( 20 ) )
399
397
. then ( function ( ) {
400
398
assertHoverText ( 'x: 1' , 'y: 2' , 'z: 43' , 'one two' ) ;
401
399
assertEventData ( 1 , 2 , 43 , 0 , [ 1 , 2 ] ) ;
0 commit comments