Skip to content

Rename recently introduced parameters in SpanSelector #20558

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 1 commit into from
Jul 1, 2021

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Jun 30, 2021

PR Summary

Follow up to #20113.

  • IMHO two parameters were not named clearly, so renaming
    • line_props -> handle_props
    • maxdist -> handle_grab_distance
  • Minor improvements:
    • document default for buttons
    • document default for drag_from_anywhere
    • properly document onselect

Heads up: I also see a naming issue with interactive (see #20113 (comment)), but it's unclear if we should go back to the old span_stay or a different new name. To be discussed in tomorrows dev call. This can be addressed separately from this PR.

@timhoffm timhoffm added this to the v3.5.0 milestone Jun 30, 2021
@ericpre
Copy link
Member

ericpre commented Jul 1, 2021

Indeed, the new names are much better, would it make sense to also rename these for RectangleSelector/EllipseSelector?

I agree with #20113 (comment) that the name doesn't describe completely what it does. However, persistent is not good enough, as was span_stays, because it doesn't describe the fact that the selector can be changed "interactively" using the handle.
The motivation in renaming it to interactive in #20113 was to improve the consistency with RectangleSelector/EllipseSelector.

Maybe a better way to do this is to add persistent alongside interactive_handle (or something similar)? This will allow the case where the selector patch stays on the axis (is persistent) but is not interactive? interactive_handle=True will need to set persistent=True. Even if this makes the API of the selector slightly more complicated by adding more argument, the meaning of the arguments are more clear!

@tacaswell
Copy link
Member

Indeed, the new names are much better, would it make sense to also rename these for RectangleSelector/EllipseSelector?

Yes

@tacaswell tacaswell merged commit 11a628f into matplotlib:master Jul 1, 2021
@timhoffm timhoffm deleted the span-selector branch July 1, 2021 18:46
@ericpre ericpre mentioned this pull request Jul 6, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants