Skip to content

Bug fix issue 3224 - avoid NaN values for axis dticks #3233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/plots/gl3d/layout/tick_marks.js
Original file line number Diff line number Diff line change
@@ -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();
30 changes: 30 additions & 0 deletions test/jasmine/tests/gl3d_plot_interact_test.js
Original file line number Diff line number Diff line change
@@ -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() {