My intended scenario was displaying a curve built from several thousand datapoints and allowing the user to mark points of interest on the curve with a mouse click. As it was a bit odd to mark a position on the curve when the cursor was quite afar from it, I changed hoverdistance
to 2
(hovermode
set to "closest"
) .
This works as expected except when the plot is zoomed out so that the distance between the points becomes large. Therefore, I would like to be able to detect when the click was not only on the point but also on the line segment drawn between the points (and which point it would translate to).
Any hints? Thanks.