-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Bug fix: applying camera up.z vector at scene init #3256
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
Changes from 17 commits
f82007b
d8ef9eb
556268b
eb72856
789cfd9
4014c35
1ae12b3
cb6dab7
67ea429
5c3742c
3ab1b1d
5b24f51
d338058
b8da9ba
899b568
724416b
c9eed54
b65fa61
d25c335
f8bf472
6af04f2
9ef8a70
f43f944
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -140,7 +140,7 @@ module.exports = { | |||
| valType: 'enumerated', | ||||
| role: 'info', | ||||
| values: ['orbit', 'turntable', 'zoom', 'pan', false], | ||||
| dflt: 'turntable', | ||||
| dflt: 'orbit', | ||||
|
||||
| coerce('dragmode', opts.getDfltFromLayout('dragmode')); |
getDfltFromLayout is part of it but then there's the dynamic default based on camera. I don't think you want to be altering sceneIn.dragmode with enableTurnTable, you just want to be setting the dynamic default. The logic is something like:
- If
getDfltFromLayoutreturns a value, use that. - If not but the user provides a
camerathat's not{x: 0, y: 0, z: >0}dfltDragmode='orbit' - If neither of those,
dfltDragmode = 'turntable' - Then you call
coerce('dragmode', dfltDragmode) so the user can still explicitly provide whatever. - The only case that's still weird at that point is if the user explicitly says
dragmode: 'turntable', camera: {up: {not z-up}}. My inclination at that point is to setsceneOut.camera.up(and NOTsceneIn.camera.up) to{x: 0, y: 0, z: 1}. That won't change the behavior - the user might still wonder whyupis not being honored - but at least it would raise an alarm if you callPlotly.validate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alexcjohnson, I will modify it to be this way.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -394,7 +394,7 @@ describe('Test gl3d plots', function() { | |
|
|
||
| it('@gl should be able to reversibly change trace type', function(done) { | ||
| var _mock = Lib.extendDeep({}, mock2); | ||
| var sceneLayout = { aspectratio: { x: 1, y: 1, z: 1 } }; | ||
| var sceneLayout = { aspectratio: { x: 1, y: 1, z: 1 }, dragmode: 'turntable' }; | ||
|
||
|
|
||
| Plotly.plot(gd, _mock) | ||
| .then(delay(20)) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is getting better by the minute. Thanks for your efforts @archmoj
Now, would there be a way to tweak this condition such that
gl3d_ibm-plotandgl3d_surface-lightingstill default todragmode: 'turntable'?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point @etpinard. Let me check.