Mr. @Hoxbro this does not seem to work with an Xarray source sir. It keeps giving me Layout errors or that I am passing a function and not a Xarray Dataset. Is there a different way to update an existing hvplot based on an Xarray? (this is related to this question here)
def get_xds(event) -> xr.Dataset:
if len(files_select.value) == 0:
return xd_initial
else:
xd = fstd2nc.Buffer(files_select.value).to_xarray()
return xd[select_field.value]
hvplot.bind(get_xds, out_button).interactive().hvplot(
kind="quadmesh",
rasterize=True,
data_aspect=1,
frame_height=500,
cmap=cmap_sel.value,
crs=ccrs.PlateCarree(),
projection=ccrs.PlateCarree(),
project=True,
geo=True,
coastline=True,
global_extent=True,
widget_location='bottom',
title=f'{select_field.value}-{cmap_sel.value}'
)
where there are widgets in the sidebar that update the cmap and data_vars plotted and themselves are updated dynamically. Imanaged to get it working for an initial dataset but if I try to switch to another dataset it crashes the whole panel server.