diff --git a/src/plots/gl3d/layout/tick_marks.js b/src/plots/gl3d/layout/tick_marks.js index 97b4e20fed5..8999e4886c0 100644 --- a/src/plots/gl3d/layout/tick_marks.js +++ b/src/plots/gl3d/layout/tick_marks.js @@ -47,7 +47,8 @@ function computeTickMarks(scene) { axes._length = (glRange[i].hi - glRange[i].lo) * glRange[i].pixelsPerDataUnit / scene.dataScale[i]; - if(Math.abs(axes._length) === Infinity) { + if(Math.abs(axes._length) === Infinity || + isNaN(axes._length)) { ticks[i] = []; } else { axes._input_range = axes.range.slice(); diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index 7cdb1e36e7f..7c29eba4bac 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -558,6 +558,36 @@ describe('Test gl3d plots', function() { .catch(failTest) .then(done); }); + + it('@gl axis ticks should not be set when axis _length is NaN', function(done) { + Plotly.plot(gd, + { + data: [{ + type: 'scatter3d', + mode: 'markers', + x: [1, 2], + y: [3, 4], + z: [5, 6] + }], + layout: { + scene: { + camera: { + eye: {x: 1, y: 1, z: 0}, + center: {x: 0.5, y: 0.5, z: 1}, + up: {x: 0, y: 0, z: 1} + } + } + } + } + ) + .then(function() { + var zaxis = gd._fullLayout.scene.zaxis; + expect(isNaN(zaxis._length)).toBe(true); + expect(zaxis.dtick === undefined).toBe(true); + }) + .catch(failTest) + .then(done); + }); }); describe('Test gl3d modebar handlers', function() {