Default value for widgets


Is there any way to specify a default initial value for a widget created by hvplot.quadmesh when a groupby dimension is specified? I see a stackoverflow post from a while back that gets at it. I don’t see the requested issue filed in either panels or hvplot.

Just wondered if this ever got addressed.

I think for now the best approach is to specify the fields dict in the hvPlot call, e.g. here’s an example using the rasm sample dataset, setting the default value for the time dimension:

import hvplot.xarray
import xarray as xr

rasm = xr.tutorial.load_dataset('rasm')

rasm.hvplot.quadmesh('xc', 'yc', fields={'time': {'default': rasm.time.values[10]}}, rasterize=True, project=True)

Thanks so much, this is exactly what I needed.

I noticed ‘fields’ isn’t documented; is this a ‘use at your own risk’ sort of thing?


It’s pretty well supported just a gap in the documentation. Contributions welcome :slightly_smiling_face: