-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Subplot mode bars #258
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
Merged
Merged
Subplot mode bars #258
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- using nested property to dive into fullLayout
- Use layout.dragmode and layout.hovermode as default for layout.scene?.dragmode and layout.scene?.hovermode if plot has only GL3D (backward compat) and if valid
instead of layout.dragmode
- which is more robust then via layout (in case where users partly supply the camera object.
- the previous version overrode the current scene layout
- this fixes an to this point undiscovered bug, where the camera position of non-first scenes in multi-scene wasn't set properly.
- to be consistent with scene2d - note that updateFx is called w/o passing through scene.proto.plot for Plotly.relayout when 'layout.dragmode' and/or 'layout.hovermode' are updated
- these will only run locally at the moment as and until #241 is resolved.
- propatet hovermode update into geo using updateFx - port relayout shortcut from modebar to Plotly.relayout - make toogle hover mode bar using stock Plotly.relayout
- graphs with more than one plot types get 'union buttons' which reset the view or toggle hover labels across all subplots.
so that cartesian plots keep retrieve their 'x' and 'y' hovermode when toggling.
|
||
function handleHover3d(gd, ev) { | ||
var button = ev.currentTarget, | ||
val = JSON.parse(button.getAttribute('data-val')) || false, |
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.
Will button.getAttribute('data-val')
always be defined? If not, I think this will throw an error.
Also, are we really storing JSON as a string in the dom with a data-attribute?
Looks good otherwise. Nice tests! |
instead of in JSON stringify/parse via the DOM element.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@mdtusz
A follow-up of #246
This PR ended up being pretty big as I kept discovering bugs in some very uncharted waters of the plotly.js subplot sea 🌊
Main additions
layout.hovermode
andlayout.dragmode
are now also attributes of each gl3d scene. This was needed so that cartesian and gl3d hovermodes and dragmodes don't conflict with one another. In gl3d-only graphsscene.hovermode
andscene.dragmode
inherit fromlayout.hovermode
andlayout.dragmode
respectively, keeping backward compatibility.Previously undiscovered bug fixes
false
(I can't believe we never caught that)camera
attribute of the first scene always..camera
attribute wasn't filled with alleye
,center
andup
objects did not work (resulted in a js error)