Repository navigation
Hover & text on shapes #4780
Description
Activity
@nicolaskruchten Would be nice with hover text for shapes.
Shapes are nice to utilize for marking/annotation in plots with vertical/horizontal lines. However it would be nice to have hover text, s.t. info is not visible at all times.
Working in WebViz using Dash and plotly. I've been testing some ways to obtain vertical lines with text info, and found the two possible solutions so far:
Agree, this would be great. If we can't have the full "hover" mechanism, what about enabling
the HTML title attribute?Reacted by Andrew Pikul, iacisme and hourloop-ianlaiI'm not aware there's any issue adding text in shapes these days, it's already a feature.
However hover labels/text for shapes could be nice. Unless I'm using a shape as the wrong solution for overlaying a few bars behind a scatter plot (as bars already have hover texts). I guess not all shape drawing on charts need to rather be data instead of drawing, otherwise why have shapes at all. But the feature set gradient between plotted data and plotted shapes which aren't data ― it sure implies careful decision making.
Reacted by Matteo Planchet and fin-galThis will be super useful for charts that rely on shapes (like line, rectangle) as markers to see more info about a marker. In my case, I cannot add a hidden decorative scatter trace to emulate hover tip behavior.
Are there any plans to implement it in the near future? As of plotly.js v3.6, shapes already support label/text so I'm anticipating if it will come next (given that annotations also support hover tips)?
This would be a really interesting issue for an ambitious community member to open a PR for!



We don't want layout shapes to be full traces but it would be pretty convenient to be able to add hoverlabels and text to them, for something like object-annotation or to label horizontal lines on plots.