Zooming should re-render elements for Trimesh


I’m using rasterise and TriMesh together with data shader to plot irregularly gridded data:

simplices = coupler_elements.loc[mesh.no_cyclic_elem]
nodes = gv.Points(coupler_data_df, vdims=["Ocean Hydr."])

trimesh = gv.TriMesh((simplices, nodes),
projected_trimesh = gv.project(trimesh, projection=ccrs.Robinson())
    # Tools:
    # Figure Height/Width:
    # Projection:
    # Colorbar:
    clabel="Hydrological Discharge in Ocean")

This works nicely, and I get a map. However, when I zoom in, the triangular elements aren’t re-rendered with the new resolution. I could have sworn I had this working before, but I can’t find the notebook I made… perhaps something like this would therefore be good to include in the documentation? I’d be happy to contribute an example!

Any hints would be appreciated! :slight_smile:

Failure to update a datashaded plot will usually result in error messages on your browser’s JavaScript console; try checking there to see what’s happening. One common reason for that behavior is not having the right extension installed. E.g. are you using JupyterLab without first running “jupyter labextension install @pyviz/jupyterlab_pyviz”?

Unfortunately no…? This might be interesting to look into. I had the following enabled in my Jupyterlab:

jupyter labextension list                           
JupyterLab v1.2.6
Known labextensions:
   app dir: /Users/pgierz/anaconda3/envs/fesom_viz/share/jupyter/lab
        @jupyter-widgets/jupyterlab-manager v1.1.0  enabled  OK
        @pyviz/jupyterlab_pyviz v0.8.0  enabled  OK
        dask-labextension v1.1.0  enabled  OK

Turning off the dask-labextension resulted in the correct behaviour, and I’m able to zoom in again. However, I can imagine that for some tasks users might want to have both of these things active. I’m happy to provide logs if it helps with debugging; just let me know what you need.