Black Lives Matter. Please consider donating to Black Girls Code today.

Spikes or crosshair on 2D plots

I want to show crosshair / spikes when user mouse hovers on data points. Something similar as shown in the graph at following link.

In 3D surface plots it is shown by default but 2D plots does not show it. Documentation says “showspikes” is available only in 3D but not in 2D.
Is there a way I can do this in 2D plots? Sample code would be helpful.

The crosshair / spikes are shown on our 2d WebGL plot (e.g. scattergl as in the link you provided above).

For a reproducible code snippet: