-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Data tooltip support #25831
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
base: main
Are you sure you want to change the base?
Data tooltip support #25831
Conversation
Add tooltip API to backend_bases.py and get/set_hover() to artist.pyi
task 2 - added hover backend implementation & tk specific label
Test addition for hover
Remove figure not None check
Added support for lists of string literals as arbitrary data tooltips
modified hover functions stub files & fixed style
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.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping @matplotlib/developers
or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
Looks good! Ready to review. |
Add documentation
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.
Mostly looked closely at the things that were flagging CI such as sphinx warnings.
Broad strokes, I think it looks pretty good, though I would want to take a bit more time to play around with it.
I do think that if this requires changes to other backends we should at least have a plan for achieving feature parity where possible (particularly for gui backends, as this seems to edit tk and qt, but not some of the other options). That doesn't necessarily have to be done in this PR, but having a plan would be good.
Do you feel comfortable squashing commits down? if not, we can do so on merge.
#9) * implemented hover feature for other backends; fixed string list; added dict * fix linter issues * more linter issues --------- Co-authored-by: Yanshi Chen <[email protected]>
* implemented hover feature for other backends; fixed string list; added dict * fix linter issues * more linter issues * fix documentations --------- Co-authored-by: Yanshi Chen <[email protected]>
Based on #23378 (comment) I assume @timhoffm's intent was to have some real "native" tooltip which does not live in the toolbar, but can instead span multiple lines. |
Thank you for this work, however we are currently unlikely to take it in it's current state. We have two major concerns:
|
PR summary
Closes #23378
This adds data tooltip support to the tkinter, qt, gtk3, gtk4, and wx backend. The tooltip is added as a label in the bottom right hand corner whenever the cursor hovers over a data point.
The tooltip can also be set with a list of explicit strings or a user-defined function.
explicit string:
ax.plot(rand(3), 'o', hover=['London', 'Paris', 'Barcelona'])
user-defined function:
PR checklist