Does someone know what is the easiest way to produce a crosshair pointer that is linked across plots?
I want to use the dedicated crosshair tool from the tool menu and not some dynamic map with (laggy) horizontal and vertical lines. When using Bokeh directly that seems to be easy. See attached stackoverflow question and accepted solution. Essentially you add the SAME crosshair object to several plots.
But I am not familiar enough with bokeh and holoviews to understand how to seamlessly shift between plot manipulation on the bokeh level and holoviews level.
For example there is an undo tool and also a zoom_out tool. All those tools can be added normally to your toolbar. For example this here adds a crosshair tool in the toolbar of a plot.
plot.opts(tools=['crosshair'])
Most of them are described here:
When you look through this page, you will find that you can configure some of the tools the way I did. For configuration, you need instantiate an object. For example the crosshair can be instantiated also as horizontal line only (using dimensions='width'), or as vertical line only (using dimensions='height'), as described on that page.
No, I mean creating a linked cross_hair by using hooks.
Normally crosshairs aren’t linked when supplying the tool object in the plot call, and the fix so far has been to use point stream + dmap. But this is better as it allows you to create linked crosshairs without the lag
Yeah. I am glad I finally figured it out how to do it in holoviews. They are pretty useful. I didn’t expect it to be so easy. I have never used a hook before.
This is really really just quite awesome, thanks for sharing your findings! I now have this working over a dmap tap graphs as @Material-Scientist points out now without the lagging alternative
Using holoviews 1.16.0 I can’t get the crosshair to link anymore. They just show up on each plot as if they would have been added individually. Has something changed about using hooks or the underlying bokeh tool?
Been using this tip for the last months on previous versions, thanks for pointing it out!