Skip to content

Commit 69393b9

Browse files
committed
added the jasmine test to lock issue 3224
1 parent 9f8f785 commit 69393b9

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

src/plots/gl3d/layout/tick_marks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function computeTickMarks(scene) {
4949

5050
if(Math.abs(axes._length) === Infinity ||
5151
Math.abs(axes._length) === -Infinity ||
52-
Number.isNaN(axes._length)) {
52+
isNaN(axes._length)) {
5353
ticks[i] = [];
5454
} else {
5555
axes._input_range = axes.range.slice();

test/jasmine/tests/gl3d_plot_interact_test.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,36 @@ describe('Test gl3d plots', function() {
558558
.catch(failTest)
559559
.then(done);
560560
});
561+
562+
it('@gl axis ticks should not be set when axis _length is NaN', function(done) {
563+
Plotly.plot(gd,
564+
{
565+
data: [{
566+
type: 'scatter3d',
567+
mode: 'markers',
568+
x: [1, 2],
569+
y: [3, 4],
570+
z: [5, 6]
571+
}],
572+
layout: {
573+
scene: {
574+
camera:{
575+
eye: {x: 1, y: 1, z: 0},
576+
center: {x: 0.5, y: 0.5, z: 1},
577+
up: {x: 0, y: 0, z: 1}
578+
}
579+
}
580+
}
581+
}
582+
)
583+
.then(function() {
584+
var zaxis = gd._fullLayout.scene.zaxis;
585+
expect(isNaN(zaxis._length)).toBe(true);
586+
expect(zaxis.dtick === undefined).toBe(true);
587+
})
588+
.catch(failTest)
589+
.then(done);
590+
});
561591
});
562592

563593
describe('Test gl3d modebar handlers', function() {

0 commit comments

Comments
 (0)