Selection1D#

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


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.

Dependencies: Bokeh

Backends: Bokeh

import numpy as np
import holoviews as hv
from holoviews import opts
from holoviews import streams
hv.extension('bokeh')
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])
layout = ndoverlay + dmap
layout.opts(
    opts.Curve(tools=['tap'], line_width=10),
    opts.NdOverlay(legend_limit=0))
This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.

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