-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Improve camera init #3585
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
Improve camera init #3585
Conversation
@archmoj I checked out your branch locally and I can't rotate any of the gl3d mocks! This mock does not rotate: http://localhost:3000/devtools/test_dashboard/#gl3d_surface_after_heatmap Maybe there is something wrong on my side... Please let me know if rotation does work for the mock above. Also, if it doesn't work, we really should have a test to catch this 😮 ! |
@antoinerg thanks for testing this. Interestingly it used to work without that so I thought it could be enabled by the |
@archmoj so you do confirm that you also can't rotate the gl3d traces? If that is the case, I am really worried about the fact that no tests failed. Why is that? |
@antoinerg Yes, I do confirm that. |
… test - also avoid return in updateFx to ensure dragmode and hovermode stay on the same ground
… the identical camera object in creating gl3d scene
package.json
Outdated
@@ -80,7 +80,7 @@ | |||
"gl-mat4": "^1.2.0", | |||
"gl-mesh3d": "^2.0.8", | |||
"gl-plot2d": "^1.4.2", | |||
"gl-plot3d": "^2.1.1", | |||
"gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#5f28e06ac02b248e6990ef385d2df49bb3a7baf8", |
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.
I added this test in respect to that. plotly.js/test/jasmine/tests/gl3d_plot_interact_test.js Lines 131 to 145 in a200e78
|
I could reproduce the bug and confirm that this PR fixes it. Here's the Codepen with the fix: https://codepen.io/antoinerg/pen/rRMOox?editors=1010 @etpinard, I think it's ready to go but maybe we should wait before merging to master? |
This looks good! I'm curious: how expansive was that extra call to create camera object? I'm a little scared of releasing this in a patch release. Maybe we should wait for 1.46.0 🤔 @archmoj have you manually tested zoom/pan/rotate on multiple gl3d mocks? |
Yes I totally agree.
Yes and they seem to be working. |
Great. Let's put this under 1.46.0 |
It is! I'm testing it one last time now. 👌 |
@@ -313,7 +313,7 @@ describe('Test isosurface', function() { | |||
}); | |||
}); | |||
|
|||
describe('@noCI hover', function() { | |||
describe('hover', function() { |
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.
Not anything new, but I noticed this test
it('should clear *cauto* when restyle *cmin* and/or *cmax*', function(done) { |
is missing a @gl
tag.
💃 💃 let's get this in |
This PR would improve camera initialisation setup for gl3d plots.
First - it fixes bug #3576 by disabling undesirable rotation/pan when the click is done on the initial mouse location.
Second - it removes one extra expensive call to create camera object. This is done by improving
gl-plot3d
interface to also accept & reuse camera object created insideplotly.js
scene. Also gl-plot3d'screateCamera
andcreateScene
are revised and their mouse listeners are packed to be enabled by centralised functions.Finally - all the previous gl3d jasmine tests with
noCI
flag could be run on CI.@plotly/plotly_js