Interactive Pipelines#

The plots built up over the first few tutorials were all highly interactive in the web browser, with interactivity provided by Bokeh plotting tools within the plots or in some cases by HoloViews generating a Bokeh widget to select for a groupby over a categorical variable. However, when you are exploring a dataset, you might want to see how any aspect of the data or plot changes if varied interactively. Luckily, hvPlot makes it almost trivially easy to do this, so that you can very easily explore any parameter or setting in your code.

Panel widgets#

To do this, we will need a widget library, and here we will be using Panel to generate Bokeh widgets under user control, just as hvPlot uses Panel to generate widgets for a groupby as shown previously. Let’s first get ahold of a Panel widget to see how they work. Here, let’s create a Panel floating-point number slider to specify an earthquake magnitude between zero and nine:

import pathlib

import holoviews as hv
import hvplot.pandas # noqa
import numpy as np
import pandas as pd
import panel as pn

pn.extension(sizing_mode='stretch_width')