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
hovertool tooltips interpretation could be more flexible #8155
Comments
I don't mean to seem overly down on these ideas, but the logic for hit testing and hover formatting is already one of the single most complicated parts of BokehJS, adding even more complexity will need a serious justification. (And sharing tools, one of the proposed justifications is simply not possible at all) TLDR, things I think are do-able:
|
Ok I've tried using a single string instead of a list of tuples and I can get it to work closer to how I want but now I cannot force newlines within the hovertool box:
So I hope we can either get the tuple method to parse the special fields of the first element of the 2-element tuple or get the string parsing to handle newline characters. I think the former will be more intuitive and allow cleaner code. What do you think? As for my other requests, after reading your details I'm ok to drop them and work the just the glyph name attribute as the x_axis_name should usually be the same for all glyphs in a plot. And I'm fine to make new hover tools or tooltips for each plot if we can satisfy my request above. |
@jasonsross you can supply a more sophisticated HTML template to get any number of lines: https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#custom-tooltip |
@bryevdv deleted my recent comment cause I realized it was the difference between $y and @$name that I was describing. Thanks for all the discussions and helping me understand the hover tool tips better. I think it's functional enough as is and we can close this issue. |
Currently the Hovertool tooltips accepts some special fields and allows datetime formatting but I'm finding the flexibility a little lacking.
Let's say I have a HoverTool like below that I want to define once and reuse for multiple figures by using the special fields as much as possible so it can display the correct names and values for data in a ColumnDataSource.
Some issues I have with the current form:
("$name","$y")
So putting all this together, I am picturing being able to do the following:
I assume adding properties to glyphs is quite the ask so I would say the xname/yname is less serious request here. Perhaps in the short term it's possible to just grab the x and y glyph property here (only if they are strings when using a source) even though the formatting of those might not be what you would prefer shows up in the tooltip.
But I hope getting special field interpretations working on the first tooltip tuple item could be easily done as well as automatic datetime formatting.
I'm happy to try to work on this issue myself but would need a little direction on where these special fields are being interpreted and passed to the plot.
The text was updated successfully, but these errors were encountered: