plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
16.92k stars 1.86k forks source link

violin plot show hovers in wrong positions after zoomed by rangeslider #5146

Open likeben opened 4 years ago

likeben commented 4 years ago
图片
archmoj commented 4 years ago

@likeben Is this a regression? If so which version caused it? Also we appreciate if you could possibly provide a "minimal" codepen.

likeben commented 4 years ago

@archmoj

plotly version: the latest 1.55.2 codepen: https://codepen.io/likeben/pen/GRZBQww PS: there is no problem if layout.hovermode is "x unified"

图片
archmoj commented 3 years ago

It does not look like a regression or bug to me.

alexcjohnson commented 3 years ago

@archmoj I think everything looks fine except the KDE hover label and effect. Here's what hover looks like on this plot with no range slider:

Screen Shot 2020-10-26 at 5 35 16 PM

But even without zooming, when you include a range slider the mouse-following crossbar disappears and the KDE label jumps to the middle:

Screen Shot 2020-10-26 at 5 36 00 PM

And then when you zoom in, it looks like the KDE point aligns itself with the middle of the same violin on the range slider, rather than the box in the main plot. The effect is particularly pronounced if you zoom toward one end but then hover on a violin near the other side of the plot.

Screen Shot 2020-10-26 at 5 38 22 PM