plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

show tooltip when hovering over selected points on scatter plot

Open oreyan1990 opened this issue 8 months ago • 1 comments

Hello,

I’ve encountered an issue when using Plotly’s scatter plot. When I select specific points on the scatter graph and then try to hover over those selected points, the tooltip fails to appear. This behavior is inconsistent with how tooltips normally function on the plot, where they display the relevant data for each point when hovered over.

Steps to reproduce:

  1. Create a scatter plot with multiple data points.
  2. Select one or more points on the graph.
  3. Hover over the selected points.
  4. Notice that the tooltip does not appear for the selected points.

you can find an example in Plotly's documentation :

https://plotly.com/javascript/line-and-scatter/

Image

oreyan1990 avatar Apr 07 '25 10:04 oreyan1990

The behavior change was introduced in #6243 commit 4138cf040cc5a0e661781b64aaeafc53b3961f3f when the 'pointer-events' was changed from stroke to all which disabled the tooltip

munteannatan avatar May 06 '25 08:05 munteannatan

@gvwilson I just ran into this too. Might not be super high-priority, but I'd argue it's a bug rather than a feature request. It's at least an unintended change (thanks for tracking it down @munteannatan!) but also the selected points are clearly the ones you care most about so it's frustrating to not be able to see their hover information.

alexjohnson-kobold avatar Aug 22 '25 01:08 alexjohnson-kobold

Changing pointer-events was important to the new selection behavior added in #6243, so that selections can be dragged. I suspect the solution will be to explicitly forward mousemove events (and I suppose enter and exit - maybe everything except mousedown?) in the selection element to the subplot drag/hover handing element.

alexjohnson-kobold avatar Aug 22 '25 02:08 alexjohnson-kobold