-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MRG: Bump colorbar control points #7188
MRG: Bump colorbar control points #7188
Conversation
Rather than snap back I think it's more user friendly to bump the other values down |
(and I would set the limits of all three to be the same, min/max of the abs(data)) |
... one reason for this is because as I user I expect that if I do an action, the GUI will accommodate it as much as possible. So If I say "I want the max to be X" via a click and drag, it should try to set the max to X, even if it means changing the mid and/or min. By contrast, what will happen with the current iteration is that the user will release the mouse, see the snap, then need to change mid to get their desired max. And maybe that won't even isn't enough because they might need to also change the min, then change the mid, then change the max to get their desired max value. Even the extreme case where the user sets the max such that it's less than the min can be useful, for example, to make it so that it basically becomes a binary mask (on or off) and you can easily change the limits of the mask by sliding the min up or max down. Getting this behavior would be much more cumbersome with the current snap behavior. A sort of in between would be what GIMP does with "levels" adjustment, which is to allow changing the min or max to slide the mid (actually they maintain ratios), but not allow min to exceed max or vice-versa. I can live with this, too, but still think I prefer my suggested behavior. |
Codecov Report
@@ Coverage Diff @@
## master #7188 +/- ##
==========================================
+ Coverage 89.75% 89.76% +<.01%
==========================================
Files 445 445
Lines 79726 79860 +134
Branches 12754 12772 +18
==========================================
+ Hits 71562 71688 +126
- Misses 5370 5374 +4
- Partials 2794 2798 +4 |
Awesome! Now just need to make them all have the same left/right limits for the slider |
At the same time I tested a different |
and then superimpose them, make 2 of them transparent, and color-code the dragging handles :) |
I tested this offline @drammock and I wasn't satisfied so far. Source code: https://gist.github.com/GuillaumeFavelier/ee40c130b7bbf65e2877a0ef24b2d8eb |
yeah, seems like it's not very robust. Too bad. |
It's really too bad that the auto-updating I tried a potential fix that doesn't do the draw callback any faster than 30 times a second as a heuristic, maybe it will fix things for you. In that same commit I also have a fix for some "flashing" at the extreme of the colormap I was getting, probably because the old code would sometimes set
I'll push once I tweak it and test locally... |
Pushed a commit to:
This fixed the flashing issues for me and everything works smoothly and as expected at my end now. @GuillaumeFavelier can you confirm the same at yours? |
b4a3036
to
9e14a24
Compare
9e14a24
to
beb75c0
Compare
This drastically improved the drag & slide experience and I don't notice any 'lag'. Thank you @larsoner ! |
What do you think @agramfort ? |
In that case, can you set it to 1/60 instead and if that works, commit the change? |
works perfectly @GuillaumeFavelier ! thx |
* Add SnapColorbarPoints helper class * Use BumpColorbarPoints helper class * Update tests * Rollback event_type to default * Set new range for colorbar sliders * ENH: Better colorbar logic * Improve coverage * Improve coverage * Tweak the callback refresh rate Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
* Add SnapColorbarPoints helper class * Use BumpColorbarPoints helper class * Update tests * Rollback event_type to default * Set new range for colorbar sliders * ENH: Better colorbar logic * Improve coverage * Improve coverage * Tweak the callback refresh rate Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
This PR furthers the discussion around the control over the end points of the colorbar in
_TimeViewer
and offers a prototype that 'snaps back' the value when they reach the limits (idea coming from @agramfort).Here is an animation:
what do you think @larsoner ? It's an alternative for the bumping of the values.
It's an item of #7162
ToDo
event_type
to default (suggested in MRG: Bump colorbar control points #7188 (comment))