Is there a better way to get the holomap's widget and use it elsewhere?

import xarray as xr
import panel as pn
pn.extension()

ds = xr.tutorial.open_dataset('air_temperature')
plot, widget = pn.Row(ds.hvplot('lon', 'lat'))[0]  # this line specifically seems unintuitive
pn.Column(plot, pn.WidgetBox(pn.Row(widget, pn.widgets.StaticText(value='Example Text'))))

Hi @ahuang11

I don’t think so, but I don’t know for sure.


My thoughts: You should be able to find out by inspecting what panel.pane.Holoviews does to get the widgets. And as far as I can see that is pretty complicated. And thus I don’t believe there is an “easy” way.

See https://github.com/holoviz/panel/blob/173885bf49db548c6194be0f72b3872b24ea21b8/panel/pane/holoviews.py#L331

But I think it would be a fair feature request to have a method that makes sense or have it documented what the best practice for using Panel to layout the widgets of a Holoviews object is.

I think one solution is just using a keyword arg:
image, select = ds.hvplot('lon', 'lat', widgets={'time':pn.widgets.Select})