-
-
Notifications
You must be signed in to change notification settings - Fork 144
Conversation
@rreusser Thanks for the suggestion! A tooltip component would be a nice addition. A few thoughts:
Overall this could look like:
|
@Marc-Andre-Rivet interesting concepts... let me provide a little more context though: A primary goal here is super-custom hover labels for The use case you're thinking of is attaching a tooltip to a specific element or elements, and having it show (with a specific duration and delay) when you hover over those elements. That's a really great use case that we should definitely keep open a pathway for, though we don't need to do it now. I wonder if the concept here can be used as is for the graph use case (and any other similar manually-positioned-and-displayed use case) but we add another mode, potentially with one more component to use along with it, for the hover-on-element use case? Something like: # one of the children of TooltipContext is a Tooltip?
dcc.TooltipContext(children=[dcc.Tooltip(...), "the content to hover on", dcc.Input(...)], duration, delay)
# or the Tooltip just gets a prop saying which component it should respond to
html.Div(id="my-content", children=...),
dcc.Tooltip(..., for="my-content", duration, delay) @rreusser do you intend to update https://github.com/plotly/dash-docs/pull/1104 to use the new |
Thanks for the suggestions, @Marc-Andre-Rivet! And apologies, I didn't give the full context of the PR, which is indeed that this is an alternate pathway to custom hovers, since working that into Plotly.js itself turned out to be rather limiting. I'll take a look at the loading component since that's actually necessary to use in this case as well.* (*) specifically, when you hover over a plot it should show a client-side tooltip immediately so you are aware something is happening, and then it should show the tooltip content once returned from the server. I used the @alexcjohnson Thanks for the additional context! Yes, I'm trying to improve this component by first getting those docs to look right. As a former Bootstrap user, I do actually like the idea of |
This needs plotly/plotly.js#5512 to land and be released in order to work, right? |
As discussed offline with @alexcjohnson might be best to rename this component to |
Removed default props that were not typed
superseded by #982 |
This PR adds a ToolTip component. In inline text it works like this:
and renders like this:
The other tooltips are positioned absolutely as
The intent is that the absolute CSS position is precisely where the tip of the caret sits, so that this component doesn't actually concern itself with positioning, hovering, etc. It is strictly the mechanical part of the box, along with the ability to position it easily.
I don't have strong feelings on whether it should do more to position itself on the screen or relative to a parent element or manage hovering by default, though my sense is that it's perhaps best to leave that to downstream consumers of the component.