Example notebooks demonstrating interactive visualization of unstructured grid (UGrid) data using hvplot.xugrid — a new extension for hvPlot that adds .hvplot.trimesh() for xugrid UgridDataArray and UgridDataset objects.
Extra dimensions (time, depth layers) automatically become interactive slider widgets.
| Notebook | Description |
|---|---|
| FVCOM_xugrid.ipynb | FVCOM coastal ocean model output — sea surface elevation and currents on an unstructured triangular mesh |
| STOFS_xugrid.ipynb | STOFS (Storm Surge) model output — water levels on a large unstructured mesh with time sliders |
conda env create -f environment.yml
conda activate hvplot-xugrid-examples
jupyter labThis installs hvplot from the xugrid PR branch. Once the PR is merged, replace the pip install line with the released hvplot package.
import xugrid as xu
import hvplot.xugrid
ds = xu.open_dataset("your_ugrid_file.nc")
uda = ds["zeta"] # UgridDataArray
# Plot with time slider
uda.hvplot.trimesh(rasterize=True, cmap="viridis", geo=True, tiles="OSM")