-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Plot widget - allow disabling zoom and drag for x and y separately #2901
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bec7012
Set whether zooming allowed for x and y separately
OmegaJak 02e7fa1
Set whether dragging allowed for x and y separately
OmegaJak 40601a5
Add disclaimers about interaction with data_aspect
OmegaJak 6159620
Show zoom & drag behavior in plot demo/charts instead of context menu…
OmegaJak a516aa2
Code review suggestions - use AxisBools::any()
OmegaJak 0603570
Simplify allow_drag and allow_zoom APIs to take in Into<AxisBools>
OmegaJak 188efe9
Remove unnecessary using...
OmegaJak dcf506e
Remove unrelated change
OmegaJak 0bffe9e
Merge branch 'master' into separate-x-y-zoom-drag
OmegaJak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
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.
It would be very easy to maintain backwards compatibility here by keeping these methods and having them set both x and y at the same time.
Question to the reviewers: what's the preference - keep backwards compatibility here or go with a more minimal API?
I'll update the changelog once this is decided.
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 vote keeping the old one. Not just for backwards compatibility, but also ergonomics: in most cases, you want to control both the same
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.
Yeah, good point. It occurs to me now that having it be generic in
T
where T : Into<AxisBools>
would produce the best of both worlds. That way there's only the one method needed, and it maintains the current ergonomics for setting both at once, while allowing the new flexibility.The main cost I see there is that it requires exposing AxisBools, which has been private until now. I guess it will also be a little more verbose to disable just one of the axes, as you'll have to do something like
.allow_zoom(AxisBools::new(false, true))
(unless we keep theallow_zoom_x/y
methods, which doesn't seem worth it). I'll go ahead and update with the new signature, and probably drop the x/y-specific methods.