@@ -394,19 +394,23 @@ describe('Test gl3d plots', function() {
394
394
395
395
it ( '@gl should set the camera dragmode to orbit if the camera.up.z vector is set to be tilted' , function ( done ) {
396
396
Plotly . plot ( gd , {
397
- data : [ {
398
- type : 'scatter3d' ,
399
- x : [ 1 , 2 , 3 ] ,
400
- y : [ 2 , 3 , 1 ] ,
401
- z : [ 3 , 1 , 2 ]
402
- } ] ,
403
- layout : {
404
- scene : {
405
- camera : {
406
- up : { x :- 0.5777 , y :- 0.5777 , z :0.5777 }
407
- }
397
+ data : [ {
398
+ type : 'scatter3d' ,
399
+ x : [ 1 , 2 , 3 ] ,
400
+ y : [ 2 , 3 , 1 ] ,
401
+ z : [ 3 , 1 , 2 ]
402
+ } ] ,
403
+ layout : {
404
+ scene : {
405
+ camera : {
406
+ up : {
407
+ x : - 0.5777 ,
408
+ y : - 0.5777 ,
409
+ z : 0.5777
410
+ }
411
+ }
412
+ }
408
413
}
409
- }
410
414
} )
411
415
. then ( delay ( 20 ) )
412
416
. then ( function ( ) {
@@ -417,19 +421,23 @@ describe('Test gl3d plots', function() {
417
421
418
422
it ( '@gl should set the camera dragmode to turntable if the camera.up.z vector is set to be upwards' , function ( done ) {
419
423
Plotly . plot ( gd , {
420
- data : [ {
421
- type : 'scatter3d' ,
422
- x : [ 1 , 2 , 3 ] ,
423
- y : [ 2 , 3 , 1 ] ,
424
- z : [ 3 , 1 , 2 ]
425
- } ] ,
426
- layout : {
427
- scene : {
428
- camera : {
429
- up : { x :0 , y :0 , z :100 }
430
- }
424
+ data : [ {
425
+ type : 'scatter3d' ,
426
+ x : [ 1 , 2 , 3 ] ,
427
+ y : [ 2 , 3 , 1 ] ,
428
+ z : [ 3 , 1 , 2 ]
429
+ } ] ,
430
+ layout : {
431
+ scene : {
432
+ camera : {
433
+ up : {
434
+ x : - 0.0001 ,
435
+ y : 0 ,
436
+ z : 123.45
437
+ }
438
+ }
439
+ }
431
440
}
432
- }
433
441
} )
434
442
. then ( delay ( 20 ) )
435
443
. then ( function ( ) {
@@ -440,20 +448,18 @@ describe('Test gl3d plots', function() {
440
448
441
449
it ( '@gl should set the camera dragmode to turntable if the camera.up is not set' , function ( done ) {
442
450
Plotly . plot ( gd , {
443
- data : [ {
444
- type : 'scatter3d' ,
445
- x : [ 1 , 2 , 3 ] ,
446
- y : [ 2 , 3 , 1 ] ,
447
- z : [ 3 , 1 , 2 ]
448
- } ] ,
449
- layout : {
450
- scene : {
451
- camera : {
452
- eye : { x :1 , y :1 , z :1 } ,
453
- center : { x :0 , y :0 , z :0 }
454
- }
451
+ data : [ {
452
+ type : 'scatter3d' ,
453
+ x : [ 1 , 2 , 3 ] ,
454
+ y : [ 2 , 3 , 1 ] ,
455
+ z : [ 3 , 1 , 2 ]
456
+ } ] ,
457
+ layout : {
458
+ scene : {
459
+ camera : {
460
+ }
461
+ }
455
462
}
456
- }
457
463
} )
458
464
. then ( delay ( 20 ) )
459
465
. then ( function ( ) {
@@ -464,19 +470,22 @@ describe('Test gl3d plots', function() {
464
470
465
471
it ( '@gl should set the camera dragmode to turntable if any of camera.up.[x|y|z] is missing' , function ( done ) {
466
472
Plotly . plot ( gd , {
467
- data : [ {
468
- type : 'scatter3d' ,
469
- x : [ 1 , 2 , 3 ] ,
470
- y : [ 2 , 3 , 1 ] ,
471
- z : [ 3 , 1 , 2 ]
472
- } ] ,
473
- layout : {
474
- scene : {
475
- camera : {
476
- up : { x :null , z :0 }
477
- }
473
+ data : [ {
474
+ type : 'scatter3d' ,
475
+ x : [ 1 , 2 , 3 ] ,
476
+ y : [ 2 , 3 , 1 ] ,
477
+ z : [ 3 , 1 , 2 ]
478
+ } ] ,
479
+ layout : {
480
+ scene : {
481
+ camera : {
482
+ up : {
483
+ x : null ,
484
+ z : 0
485
+ }
486
+ }
487
+ }
478
488
}
479
- }
480
489
} )
481
490
. then ( delay ( 20 ) )
482
491
. then ( function ( ) {
@@ -487,19 +496,23 @@ describe('Test gl3d plots', function() {
487
496
488
497
it ( '@gl should set the camera dragmode to turntable if all camera.up.[x|y|z] are zero or missing' , function ( done ) {
489
498
Plotly . plot ( gd , {
490
- data : [ {
491
- type : 'scatter3d' ,
492
- x : [ 1 , 2 , 3 ] ,
493
- y : [ 2 , 3 , 1 ] ,
494
- z : [ 3 , 1 , 2 ]
495
- } ] ,
496
- layout : {
497
- scene : {
498
- camera : {
499
- up : { x :0 , y :0 , z :0 }
500
- }
499
+ data : [ {
500
+ type : 'scatter3d' ,
501
+ x : [ 1 , 2 , 3 ] ,
502
+ y : [ 2 , 3 , 1 ] ,
503
+ z : [ 3 , 1 , 2 ]
504
+ } ] ,
505
+ layout : {
506
+ scene : {
507
+ camera : {
508
+ up : {
509
+ x : 0 ,
510
+ y : 0 ,
511
+ z : 0
512
+ }
513
+ }
514
+ }
501
515
}
502
- }
503
516
} )
504
517
. then ( delay ( 20 ) )
505
518
. then ( function ( ) {
0 commit comments