-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Emit a plotly_relayout' event upon mouseup, wheel #466
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
a7177f2
1b19b3a
34d15aa
3d8fe81
a10caec
604d739
ee8ff65
da01879
48682a4
63ec931
19c478d
e467c88
b212086
e8aa9cb
e02a3f6
4975417
7c23e2e
7eef2e1
2a13e92
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 |
---|---|---|
|
@@ -174,6 +174,7 @@ function initializeGLPlot(scene, fullLayout, canvas, gl) { | |
var relayoutCallback = function(scene) { | ||
var update = {}; | ||
update[scene.id] = getLayoutCamera(scene.camera); | ||
scene.saveCamera(scene.graphDiv.layout); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks if For example, using the The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @etpinard thanks for this find! I'll add a test case that covers this circumstance and resolve it. It's late and I'm planning to look at it early morning, but somewhat surprised as the 3d test I already put in, e.g. gl3d_scatter3d-connectgaps.json doesn't set the camera yet it didn't throw on the interaction test, so I'll start from your example above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no rush, the next release will be published next Tuesday or Wednesday. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @etpinard may I ask you to check if this single-line modification in saveCamera is all it takes - I infer from the code that the sameness check needs to be prepared for the possibility of a partially set camera. Also, I refactored the test case under which I put a new test for the partially set camera, and I hope you consider it an improvement over my original test case - it's more promise-oriented and explicitly passes around values rather than relying on globals. If it's OK with you, I'd try to put some of the test cases into a separate file, because this test file is excluded from the CI run due to unpredictability of some of the tests. I'm uncomfortable with the notion that an ever increasing number of tests is excluded so I'd try to loop some of them in. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes. This is all we need. Thanks!
Sure. Go for it!
+1 |
||
scene.graphDiv.emit('plotly_relayout', update); | ||
}; | ||
|
||
|
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'm ok with this here.
BUT we should add a comment in the
resetCameraLastSave
mode bar button handler.That handler looks in the un-updated
fullLayout.scene.camera
object to reset the camera to the last saved position.