plotly / plotly.js

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

after panning, a hover label appear above data point close to start position #4570

Open antoinerg opened 4 years ago

antoinerg commented 4 years ago

Originally discovered and reported by @jonmmease in https://github.com/plotly/plotly.js/issues/4377, I think this deserves an issue of its own considering it affects many trace types (at least scatter, image, heatmap and probably many more).

When a panning operation is over (ie. mouse up), a hover label will appear above the data point closest to the position of the mouse when the pan operation was initiated (ie. mouse down).

antoinerg commented 4 years ago

@etpinard I think you mentioned you had an idea on how to fix this one. Can you comment on it?

etpinard commented 4 years ago

If I had to bet, I think this has to do with:

https://github.com/plotly/plotly.js/blob/31a23fea96fd6f881f03fade1e4f78a5972326be/src/plots/plots.js#L3227-L3231

https://github.com/plotly/plotly.js/blob/31a23fea96fd6f881f03fade1e4f78a5972326be/src/plots/cartesian/graph_interact.js#L61-L65