-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
PRF: only check some artists on mousemove #4878
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
PRF: only check some artists on mousemove #4878
Conversation
Instead of walking the full hitlist of the Axes, only check artists that ask to be part of the mouseover events. This is still missing logic to remove the artist from the mouseover_set when removing the artist from the Axes.
What would be wrong with checking |
I was trying to avoid walking the artist tree at all and avoid changing hit On the other hand, self.get_children would only do one layer, be only a bit On Fri, Aug 7, 2015, 9:05 AM Steven Silvester notifications@github.com
|
You're right, it makes more sense the way it is now. |
I prefer this approach to using the hitlist, it's cleaner and easier to follow what's being reported. @tacaswell I think this would be a good place to also address #4284 making, a similar property in axes, to report or not. |
@fariza Possibly, but by the time we get to this code, the decision about what Axes to hand the event to to process has already been made, although it is probably simple to look up if there are any twin axes here. I am inclined to punt on that to get the mouse-over code shippable ASAP. |
Initially reported over in #4738 , I encountered a very troubling bug with |
Also close #4918 |
This is useful when removing artists from an `Axes`
- disconnect the stale_callback (this assumes that matplotlib#4738 goes in) - remove the artist from the Axes.mousover_set - marks the parent axes/figure as stale - resets the artist's axes/figure to None
@matplotlib/developers I think this is ready to go. |
Forgot this last thing from been when i was working on this/writing up the On Wed, Aug 12, 2015, 2:54 PM Benjamin Root notifications@github.com
|
Been should be Ben. On Fri, Aug 14, 2015, 8:08 AM Thomas Caswell tcaswell@gmail.com wrote:
|
I did a little bit more investigation on this. The data I was displaying On Fri, Aug 14, 2015 at 8:09 AM, Thomas A Caswell notifications@github.com
|
The test error on python 2.6 looks real
|
The failure is due to import errors in test_artist in 2.6, hurray. I really want to just drop 2.6, but I will get this sorted out. |
Im 👍 on dropping python 2.6 but I guess should keep it round for 1.5 and 2.0. Skipping the tests on Python 2.6 is IMHO an acceptable solution if the import error is in the test. |
Drop 2.6??? Could we do that for 2.x? OrderedDicts here we come! 😄. |
Apparently `assert_is`, `assert_in`, and `assert_not_in` are not in the 2.6 version of nose, but are in all others.
The problem was that some of the fancier assert statements are not in 2.6, but are every where else (despite nose having the same version). I just switched to using |
PRF: only check some artists on mousemove
@@ -961,6 +980,21 @@ def format_cursor_data(self, data): | |||
data = [data] | |||
return ', '.join('{:0.3g}'.format(item) for item in data) | |||
|
|||
@property | |||
def mouseover(self): |
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.
Just wondering, have you ever measured the performance of descriptor access vs attribute lookup. You might be quite shocked 😱
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 have not, but I made this a property for the setter functionality.
@pelson I agree this isn't great, but the Another option I see is to periodically walk the children and cache which of them have a message to add to the mouse over string, but that has a higher chance of going out of sync than this method does. I have no problem renaming |
@@ -147,6 +147,23 @@ def remove(self): | |||
# callback has one parameter, which is the child to be removed. | |||
if self._remove_method is not None: | |||
self._remove_method(self) |
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.
Surely the logic for removing from the axes should live in the remove method itself. Is there a reason we can't do that?
Instead of walking the full hitlist of the Axes, only check artists
that ask to be part of the mouseover events.
This is still missing logic to remove the artist from the mouseover_set
when removing the artist from the Axes.
This is an alternative to #4847
attn @blink1073