Selection1d

Title
Curve selection streams example
Description
A linked streams example demonstrating how to use the Selection1D stream to access Curves selected using a tap tool on one plot and mirror them on another plot.
Backends
Bokeh
Tags
streams, linked, selection, interactive
In [ ]:
import numpy as np
import holoviews as hv
from holoviews import streams
hv.extension('bokeh')
In [ ]:
%%opts NdOverlay [legend_limit=0] Curve [tools=['tap']] (line_width=10)
ndoverlay = hv.NdOverlay({i: hv.Curve(np.arange(10)*i) for i in range(5)})

selection = streams.Selection1D(source=ndoverlay)
dmap = hv.DynamicMap(lambda index: ndoverlay[index] if index else ndoverlay.clone(),
                     kdims=[], streams=[selection])
ndoverlay + dmap

Download this notebook from GitHub (right-click to download).