Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Interactive span selector improvement#20113
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
anntzer commentedMay 10, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
ericpre commentedMay 12, 2021
Thanks for the review! Indeed, this is a change in behaviour and the motivation for this really is to have the |
ericpre commentedMay 13, 2021
Actually, thinking a bit more about it, I would like to add a separate optional parameter to the |
Uh oh!
There was an error while loading.Please reload this page.
…er release. Deprecate span_stays
…e its interactivity.
…e `span_stays` to `interactive`.
…seSelector have been drawn.
7137b09 toc9efdfaCompareericpre commentedMay 20, 2021
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
… selector consistently with SpanSelector
ericpre commentedJun 19, 2021
@QuLogic, thanks for the review, I have addressed all points! |
ericpre commentedJun 28, 2021
@anntzer,@ianhi,@tacaswell,@QuLogic, is there anything left to do on this PR? |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
anntzer commentedJun 30, 2021
(Not that it adds much to the discussion as@tacaswell mostly summarized my points above, but I think that I finally realized why I am so attached to the old UI model: it mimicks the UI of text selection, where you can restart another selection by just clicking anywhere and selecting from there.) |
ericpre commentedJun 30, 2021
I see what you mean, however I would imagine that with the recent addition of |
tacaswell commentedJun 30, 2021
@anntzer I think the current state captures the best of the old behavior (click outside of the selection region and make a new span) and the new (you can drag either edge and if you click on the middle you drag the whole span). Both of the new interaction modes are things that I personally wished for in my past-life (to either scan a fixed-width window across some line or to tweak it to bejust the right width). |
| interactive : bool, default: False | ||
| Whether to draw a set of handles that allow interaction with the | ||
| widget after it is drawn. |
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.
To me the primary difference is whether the selector is still visible after the first selection.
Wheninteractive=True I get a selector that persists, but I can still modify later. Coming from that context I would expectinteractive=False to still show my selected region, but I cannot modify it anymore. This indicates thatinteractive is a misleading name.
When starting from scratch, I'd call thispersistent, but given that we havespan_stays keeping that is ok as well.
| button : `.MouseButton` or list of `.MouseButton` | ||
| The mouse buttons which activate the span selector. | ||
| line_props : dict, default: None |
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.
Since there's no canonical line in a span. the name does not make it clear what this controls. I'd call thesehandle_props orhandle_line_props if you want to be very explicit.
| The mouse buttons which activate the span selector. | ||
| line_props : dict, default: None | ||
| Line properties with which the interactive line are drawn. Only used |
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.
| Linepropertieswithwhichtheinteractivelinearedrawn.Onlyused | |
| Propertiesofthehandlerlinesattheedgesofthespan.Onlyused |
timhoffm commentedJun 30, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
🙄 8 minutes too late. Will open a follow-up PR. |
ericpre commentedJul 1, 2021
Thanks everyone for the reviews, it has been very useful! |
timhoffm commentedJul 1, 2021
Thanks@ericpre for keeping up! |
larsoner commentedJul 9, 2021
In MNE we allow users to update the selector colors, and have: This now emits a deprecation warning from this PR, but it doesn't indicate how code should be migrated. I looked at this and#20558 and hoped / thought maybe I could find some the |
jklymak commentedJul 9, 2021
@larsoner suggest you open an issue. |
Uh oh!
There was an error while loading.Please reload this page.
PR Summary
This PR updates the
SpanSelectorto make it consistent withRectangleSelector:span_staysin favour ofinteractiveinteractive=Truedrag_from_anywhereoption, in line withAllow Selectors to be dragged from anywhere within their patch #19657pressvrect,rectprops, for theSpanSelectorto_draw,drawtypefor the `RectangleSelectoractive_handlefor SpanSelector and RectangleSelectordirectiona propertyIf you are happy with the changes, I will do the remaining doc, examples, etc updates.
PR Checklist
pytestpasses).flake8on changed files to check).flake8-docstringsand runflake8 --docstring-convention=all).doc/users/next_whats_new/(follow instructions in README.rst there).doc/api/next_api_changes/(follow instructions in README.rst there).