Skip to content

Commit d25c335

Browse files
committed
added camera tests
1 parent b65fa61 commit d25c335

File tree

1 file changed

+74
-61
lines changed

1 file changed

+74
-61
lines changed

test/jasmine/tests/gl3d_plot_interact_test.js

+74-61
Original file line numberDiff line numberDiff line change
@@ -394,19 +394,23 @@ describe('Test gl3d plots', function() {
394394

395395
it('@gl should set the camera dragmode to orbit if the camera.up.z vector is set to be tilted', function(done) {
396396
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+
}
408413
}
409-
}
410414
})
411415
.then(delay(20))
412416
.then(function() {
@@ -417,19 +421,23 @@ describe('Test gl3d plots', function() {
417421

418422
it('@gl should set the camera dragmode to turntable if the camera.up.z vector is set to be upwards', function(done) {
419423
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+
}
431440
}
432-
}
433441
})
434442
.then(delay(20))
435443
.then(function() {
@@ -440,20 +448,18 @@ describe('Test gl3d plots', function() {
440448

441449
it('@gl should set the camera dragmode to turntable if the camera.up is not set', function(done) {
442450
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+
}
455462
}
456-
}
457463
})
458464
.then(delay(20))
459465
.then(function() {
@@ -464,19 +470,22 @@ describe('Test gl3d plots', function() {
464470

465471
it('@gl should set the camera dragmode to turntable if any of camera.up.[x|y|z] is missing', function(done) {
466472
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+
}
478488
}
479-
}
480489
})
481490
.then(delay(20))
482491
.then(function() {
@@ -487,19 +496,23 @@ describe('Test gl3d plots', function() {
487496

488497
it('@gl should set the camera dragmode to turntable if all camera.up.[x|y|z] are zero or missing', function(done) {
489498
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+
}
501515
}
502-
}
503516
})
504517
.then(delay(20))
505518
.then(function() {

0 commit comments

Comments
 (0)