-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate setting pickradius via set_picker #16154
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -516,7 +516,7 @@ def set_picker(self, picker): | |
|
||
Parameters | ||
---------- | ||
picker : None or bool or float or callable | ||
picker : None or bool or callable | ||
This can be one of the following: | ||
|
||
- *None*: Picking is disabled for this artist (default). | ||
|
@@ -525,14 +525,6 @@ def set_picker(self, picker): | |
artist will fire a pick event if the mouse event is over | ||
the artist. | ||
|
||
- A float: If picker is a number it is interpreted as an | ||
epsilon tolerance in points and the artist will fire | ||
off an event if it's data is within epsilon of the mouse | ||
event. For some artists like lines and patch collections, | ||
the artist may provide additional data to the pick event | ||
that is generated, e.g., the indices of the data within | ||
epsilon of the pick event | ||
|
||
- A function: If picker is callable, it is a user supplied | ||
function which determines whether the artist is hit by the | ||
mouse event:: | ||
|
@@ -543,6 +535,10 @@ def set_picker(self, picker): | |
artist, return *hit=True* and props is a dictionary of | ||
properties you want added to the PickEvent attributes. | ||
|
||
- *deprecated*: For `.Line2D` only, *picker* can also be a float | ||
that sets the tolerance for checking whether an event occurred | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm, you can see how this ended up here, given that we can also pass a function at this point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But at least functions are not misinterpretable as numbers... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the other solution to only set the pick radius if picker is not a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, you can do that (but what about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I guess you can deprecate it and see if anyone notices... I do think there is some advantage to having the pick logic all in one place, rather than here and in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have some further cleanups too, but as always and as you say, if people show up with pitchforks, we can always revert the change... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I was thinking about t his as well, but it occurred to me that |
||
"on" the line; this is deprecated. Use `.Line2D.set_pickradius` | ||
instead. | ||
""" | ||
self._picker = picker | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.