I'm trying to create a dashboard with two holoviews objects: a panel pn.widgets.Select
object that contains a list of xarray variables, and a hvplot object that takes the selected variable on input, like this:
def hvmesh(var=None):mesh = ds[var].hvplot.quadmesh(x='x', y='y', rasterize=True, crs=crs, width=600, height=400, groupby=list(ds[var].dims[:-2]), cmap='jet')return mesh
Here's what an example mesh looks like for a particular variable (one that has both time and height dimensions):
I would like to have the map update when I select a variable from the panel widget: I tried to do this as a dynamic map, like this:
from holoviews.streams import Params
import holoviews as hvvar_stream = Params(var_select, ['value'], rename={'value': 'var'})mesh = hv.DynamicMap(hvmesh, streams=[var_stream])
but when I try to display the map, I get:
Exception: Nesting a DynamicMap inside a DynamicMap is not supported.
It would seem a common need to select the variable for hvplot from a panel widget. What is the best way to accomplish this with pyviz?
In case it's useful, here is my full attempt Jupyter Notebook.