Skip to content

Commit df066d5

Browse files
authored
Merge pull request #3308 from plotly/issue-3302_revision
Bug fix - adjust tick distances in perspective views
2 parents 5a9e340 + fa7f028 commit df066d5

File tree

5 files changed

+44
-15
lines changed

5 files changed

+44
-15
lines changed

package-lock.json

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"gl-mat4": "^1.2.0",
7979
"gl-mesh3d": "^2.0.2",
8080
"gl-plot2d": "^1.4.0",
81-
"gl-plot3d": "^1.6.0",
81+
"gl-plot3d": "^1.6.1",
8282
"gl-pointcloud2d": "^1.0.1",
8383
"gl-scatter3d": "^1.1.0",
8484
"gl-select-box": "^1.0.2",
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"data":[
3+
{
4+
"type": "surface",
5+
"contours": {
6+
"x": {"show": true},
7+
"y": {"show": true},
8+
"z": {"show": false}
9+
},
10+
"x": [0, 4],
11+
"y": [0, 1, 2, 3, 4],
12+
"z": [[0, 0], [0, 0], [0, 1], [1, 1], [1, 1]]
13+
}
14+
],
15+
"layout": {
16+
"title": "Tick distances and contour lines in perspective view.",
17+
"width": 1000,
18+
"height": 500,
19+
"scene": {
20+
"xaxis": {"nticks": 32},
21+
"yaxis": {"nticks": 32},
22+
"camera": {
23+
"center": {"x": 0, "y": 0.25, "z": 0.0},
24+
"eye": {"x": 0.75, "y": 0.25, "z": 0.25},
25+
"up": {"x": 0, "y": 0, "z": 1}
26+
}
27+
}
28+
}
29+
}

test/jasmine/tests/gl3d_plot_interact_test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -714,15 +714,15 @@ describe('Test gl3d plots', function() {
714714
.then(done);
715715
});
716716

717-
it('@gl axis ticks should not be set when axis _length is NaN', function(done) {
717+
it('@gl should not set _length to NaN and dtick should be defined.', function(done) {
718718
Plotly.plot(gd,
719719
{
720720
data: [{
721721
type: 'scatter3d',
722722
mode: 'markers',
723723
x: [1, 2],
724724
y: [3, 4],
725-
z: [5, 6]
725+
z: [0.000000005, 0.000000006]
726726
}],
727727
layout: {
728728
scene: {
@@ -737,8 +737,8 @@ describe('Test gl3d plots', function() {
737737
)
738738
.then(function() {
739739
var zaxis = gd._fullLayout.scene.zaxis;
740-
expect(isNaN(zaxis._length)).toBe(true);
741-
expect(zaxis.dtick === undefined).toBe(true);
740+
expect(isNaN(zaxis._length)).toBe(false);
741+
expect(zaxis.dtick === undefined).toBe(false);
742742
})
743743
.catch(failTest)
744744
.then(done);

0 commit comments

Comments
 (0)