jupyterbokehjupyter-labholoviewsdatashader

Turn off automatic interaction HoloViews / Bokeh charts in Jupyter?


How do I have the chart display without any engagement buttons clicked on?

Would like the top button (see picture), which is currently defaulting on, to default off.

How to have this not automatically turn on?


Solution

  • Currently Holoviews does not expose this option directly, so you have to define a custom hook which modifies the underlying bokeh model, it should look something like this:

    def tools(plot, element):
        plot.handles['plot'].toolbar.active_drag = None
    
    hv.Curve([]).opts(hooks=[tools])