This will put a tooltip at the beginning and the end of the segment, but users will tend to put their cursor near the middle of the segment and expect a tooltip to appear. Even more importantly, users won't get a tooltip if they are zoomed into the middle of a segment.
I've been getting around this problem by using add_lines() instead, but this is terribly inefficient when I'm trying to plot thousands of these segments at once, and it doesn't solve the zooming problem. E.g.
As far as I'm aware, plotly/plotly.js doesn't really provide a better option than your add_lines() workaround. If the inefficiently is happening at render time, then you may be able to get a speed up from toWebGL()
I posted about this here in RStudio community in mid-June but didn't get any responses.
Edit Aug17: Stopped using x-unified hovermode, added new video to show the problem more clearly. Also posted another RStudio community post.
Maybe this feature exists, but I'm missing it? I would like to have a tooltip that extends across the entire length of a segment from
add_segments().Example:
This will put a tooltip at the beginning and the end of the segment, but users will tend to put their cursor near the middle of the segment and expect a tooltip to appear. Even more importantly, users won't get a tooltip if they are zoomed into the middle of a segment.
I've been getting around this problem by using
add_lines()instead, but this is terribly inefficient when I'm trying to plot thousands of these segments at once, and it doesn't solve the zooming problem. E.g.The text was updated successfully, but these errors were encountered: