Skip to content

Commit 212a219

Browse files
authored
Merge pull request #3550 from plotly/ortho-view-finalist
Orthographic projection for 3D plots - finalist
2 parents 79fa245 + 9af35cc commit 212a219

18 files changed

+3244
-332
lines changed

package-lock.json

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

package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,17 @@
5757
]
5858
},
5959
"dependencies": {
60-
"3d-view": "^2.0.0",
60+
"@plotly/d3-sankey": "0.7.2",
6161
"alpha-shape": "^1.0.0",
6262
"array-range": "^1.0.1",
6363
"canvas-fit": "^1.5.0",
6464
"color-normalize": "^1.3.0",
6565
"convex-hull": "^1.0.3",
6666
"country-regex": "^1.1.0",
6767
"d3": "^3.5.12",
68-
"@plotly/d3-sankey": "0.7.2",
69-
"d3-sankey-circular": "0.32.0",
7068
"d3-force": "^1.0.6",
7169
"d3-interpolate": "1",
70+
"d3-sankey-circular": "0.32.0",
7271
"delaunay-triangulate": "^1.1.6",
7372
"es6-promise": "^3.0.2",
7473
"fast-isnumeric": "^1.1.2",
@@ -81,7 +80,7 @@
8180
"gl-mat4": "^1.2.0",
8281
"gl-mesh3d": "^2.0.7",
8382
"gl-plot2d": "^1.4.2",
84-
"gl-plot3d": "^1.6.3",
83+
"gl-plot3d": "^2.0.0",
8584
"gl-pointcloud2d": "^1.0.2",
8685
"gl-scatter3d": "^1.1.6",
8786
"gl-select-box": "^1.0.3",

src/components/modebar/buttons.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,10 @@ function handleCamera3d(gd, ev) {
348348
var scene = fullLayout[sceneId]._scene;
349349

350350
if(attr === 'resetDefault') {
351-
aobj[key] = null;
351+
aobj[key] = Lib.extendDeep({}, scene.cameraInitial);
352+
aobj[key].up = null;
353+
aobj[key].eye = null;
354+
aobj[key].center = null;
352355
}
353356
else if(attr === 'resetLastSave') {
354357
aobj[key] = Lib.extendDeep({}, scene.cameraInitial);

src/plot_api/subroutines.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,10 @@ exports.doCamera = function(gd) {
600600
var sceneLayout = fullLayout[sceneIds[i]];
601601
var scene = sceneLayout._scene;
602602

603-
scene.setCamera(sceneLayout.camera);
603+
var cameraData = sceneLayout.camera;
604+
var isOrtho = !!(cameraData && cameraData.projection && cameraData.projection.type === 'orthographic');
605+
606+
scene.setCamera(cameraData, isOrtho);
604607
}
605608
};
606609

0 commit comments

Comments
 (0)