Repository navigation
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
Changes from 1 commit
0def4c5
1133214
01c4b90
090b6d6
ded655a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
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.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -786,6 +786,8 @@ def _set_artist_props(self, a): | |
| a.set_transform(self.transData) | ||
|
|
||
| a.axes = self | ||
| if a.mouseover: | ||
| self.mouseover_set.add(a) | ||
|
Member
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. Alarm bells... 🔔
Member
Author
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. The remove method takes care of this. |
||
|
|
||
| def _gen_axes_patch(self): | ||
| """ | ||
|
|
@@ -916,6 +918,7 @@ def cla(self): | |
| self.tables = [] | ||
| self.artists = [] | ||
| self.images = [] | ||
| self.mouseover_set = set() | ||
|
Member
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'm not a huge fan of the name. Is this really "artists who have mouseover enabled"? Can we come up with a better name? |
||
| self._current_image = None # strictly for pyplot via _sci, _gci | ||
| self.legend_ = None | ||
| self.collections = [] # collection.Collection instances | ||
|
|
||
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.