Skip to content

Commit 5c3742c

Browse files
committed
minimal fix
1 parent 67ea429 commit 5c3742c

File tree

5 files changed

+3
-25
lines changed

5 files changed

+3
-25
lines changed

src/plots/gl3d/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ exports.plot = function plotGl3d(gd) {
6969
if(!scene.cameraInitial) {
7070
scene.cameraInitial = Lib.extendDeep({}, sceneLayout.camera);
7171
}
72-
/*
73-
if(!sceneLayout._scene.cameraInitial) {
74-
sceneLayout._scene.cameraInitial = Lib.extendDeep({}, gd._fullLayout[sceneId].camera);
75-
}
76-
*/
77-
7872
scene.plot(fullSceneData, fullLayout, gd.layout);
7973
}
8074
};

src/plots/gl3d/layout/defaults.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,6 @@ function handleGl3dDefaults(sceneLayoutIn, sceneLayoutOut, coerce, opts) {
9797
sceneLayoutIn.aspectmode = sceneLayoutOut.aspectmode;
9898
}
9999

100-
var overwriteIn = false;
101-
if(sceneLayoutIn.camera &&
102-
sceneLayoutIn.camera.up &&
103-
sceneLayoutIn.camera.up.z !== 1) {
104-
overwriteIn = (sceneLayoutIn.dragmode !== 'turntable') ? true : false;
105-
}
106-
107-
if(overwriteIn === true) {
108-
sceneLayoutIn.dragmode = 'orbit';
109-
}
110-
111100
supplyGl3dAxisLayoutDefaults(sceneLayoutIn, sceneLayoutOut, {
112101
font: opts.font,
113102
scene: opts.id,
@@ -117,10 +106,6 @@ function handleGl3dDefaults(sceneLayoutIn, sceneLayoutOut, coerce, opts) {
117106
fullLayout: opts.fullLayout
118107
});
119108

120-
if(sceneLayoutOut.dragmode === 'turntable') {
121-
sceneLayoutOut.camera.up = [0, 0, 1];
122-
}
123-
124109
Registry.getComponentMethod('annotations3d', 'handleDefaults')(
125110
sceneLayoutIn, sceneLayoutOut, opts
126111
);

src/plots/gl3d/layout/layout_attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ module.exports = {
140140
valType: 'enumerated',
141141
role: 'info',
142142
values: ['orbit', 'turntable', 'zoom', 'pan', false],
143-
dflt: 'turntable',
143+
dflt: 'orbit',
144144
editType: 'plot',
145145
description: [
146146
'Determines the mode of drag interactions for this scene.'

src/plots/gl3d/scene.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ proto.updateFx = function(dragmode, hovermode) {
739739
camera.keyBindingMode = 'rotate';
740740

741741
} else if(dragmode === 'turntable') {
742+
camera.up = [0, 0, 1];
742743
camera.mode = 'turntable';
743744
camera.keyBindingMode = 'rotate';
744745

test/jasmine/tests/gl3d_plot_interact_test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ describe('Test gl3d modebar handlers', function() {
769769
buttonDefault.click();
770770
});
771771

772-
fit('@gl button resetCameraLastSave3d should reset camera to default', function(done) {
772+
it('@gl button resetCameraLastSave3d should reset camera to default', function(done) {
773773
var buttonDefault = selectButton(modeBar, 'resetCameraDefault3d');
774774
var buttonLastSave = selectButton(modeBar, 'resetCameraLastSave3d');
775775

@@ -808,8 +808,6 @@ describe('Test gl3d modebar handlers', function() {
808808
assertCameraEye(gd._fullLayout.scene, 0.1, 0.1, 1);
809809
assertCameraEye(gd._fullLayout.scene2, 2.5, 2.5, 2.5);
810810

811-
console.log("gd._fullLayout.scene._scene.cameraInitial=", gd._fullLayout.scene._scene.cameraInitial);
812-
813811
delete gd._fullLayout.scene._scene.cameraInitial;
814812
delete gd._fullLayout.scene2._scene.cameraInitial;
815813

0 commit comments

Comments
 (0)