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
Add group and label to hover tooltip if provided by user #6125
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6125 +/- ##
==========================================
- Coverage 88.70% 88.55% -0.15%
==========================================
Files 314 316 +2
Lines 65993 66050 +57
==========================================
- Hits 58537 58490 -47
- Misses 7456 7560 +104
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
It seems to me like a good idea to have this enabled by default, but I'm guessing that there's a reason why it wasn't already in place.
A reason why it hasn't been implemented can be as simple as there has been no demand for it.
I don't really have high hopes for this getting merged
You shouldn't put down the effort you have put into the PR. If you don't believe in it yourself, it is hard to get others to believe in you 👍
I would like to see a unit test. To get the tooltips after creation you can play look around with hv.renderer('bokeh').get_plot(hv.Curve([])).handles
(in test we have bokeh_renderer
as shorthand for the first part).
This has nothing to do with this PR, but the legend seems wrong for your example.
Thanks, I adjusted my language. |
What's wrong about it? seems accurate to me and reflects the labels of the curves for which a label was given |
Tests added |
One last thing: Can you try setting the group/label to something like |
Just tried hvPlot from that branch. I think it's coming from these lines: There are maybe more cases, I just did a very quick check. |
Maybe if isinstance element, 2D, then don't include the label? |
At a HoloViz meeting, there was discussion about supporting a better syntax for a custom hover tool. Here is the unearthed thread on the topic: #1816 I would prefer a more fully featured custom hover tool syntax as originally proposed, as long as it supports adding arbitrary entries like 'label' and 'group' arg values, in addition to standard data dims. I will close this current PR, unmerged. |
Adds the group and label args to the bokeh hover tooltip if provided by user.
It seems to me like a good idea to have this enabled by default, but I'm guessing that there's a reason why it wasn't already in place. Opinions welcome.
Fixes #3603
Code
Screen.Recording.2024-02-20.at.11.59.48.AM.mov
TODO: