-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Keep orthographic zoom scales in fullLayout #4292
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 1 commit
4a649f0
fe19e47
b92230a
d825c0e
d486dcd
496059c
e4a30be
3b28fae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| var createCamera = require('gl-plot3d').createCamera; | ||||||||||||||||||||||||||||
| var createPlot = require('gl-plot3d').createScene; | ||||||||||||||||||||||||||||
| var mouseWheel = require('mouse-wheel'); | ||||||||||||||||||||||||||||
| var getContext = require('webgl-context'); | ||||||||||||||||||||||||||||
| var passiveSupported = require('has-passive-events'); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
@@ -243,7 +244,26 @@ function tryCreatePlot(scene, cameraObject, pixelRatio, canvas, gl) { | |||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| return failed < 2; | ||||||||||||||||||||||||||||
| if(failed < 2) { | ||||||||||||||||||||||||||||
| scene.wheelListener = mouseWheel(scene.glplot.canvas, function(dx, dy) { | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
| scene.glplot.canvas.addEventListener('wheel', function() { | |
| if(gd._context._scrollZoom.gl3d) { | |
| relayoutCallback(scene); | |
| } | |
| }, passiveSupported ? {passive: false} : false); |
which looks like also adds a mouse-wheel handler to the scene
- Shouldn't we also emit a
plotly_relayoutevent with theaspectratiokeys just like we do here:
plotly.js/src/plots/gl3d/scene.js
Lines 283 to 290 in 4a649f0
| var relayoutCallback = function(scene) { | |
| if(scene.fullSceneLayout.dragmode === false) return; | |
| var update = {}; | |
| update[scene.id + '.camera'] = getLayoutCamera(scene.camera); | |
| scene.saveCamera(gd.layout); | |
| scene.graphDiv.emit('plotly_relayout', update); | |
| }; |
for perspective projections?
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.
Addressed in fe19e47
Uh oh!
There was an error while loading. Please reload this page.