Started as discussion on discourse : - https://discourse.holoviz.org/t/trimesh-a…nd-dynamicmap-whats-broken/2920
I am using a fairly recently created environment (so recent libs). I downloaded the sample notebook Trimesh — HoloViews 1.14.5 documentation and added the following cells to create a trimesh in a function. The dynamic map created by this does not update.
#### ALL software version info
windows 10 with conda install. partial list of versions and builds below
```
bokeh 2.3.3 py39haa95532_0
holoviews 1.14.6 pyhd3eb1b0_1
hvplot 0.7.3 pyhd3eb1b0_1
jupyter_client 7.0.1 pyhd3eb1b0_0
jupyter_core 4.7.1 py39haa95532_0
python 3.9.7 h6244533_1
```
#### Description of expected behavior and the observed behavior
#### Complete, minimal, self-contained example code that reproduces the issue
Download the Jupyter notebook from https://holoviews.org/reference/elements/bokeh/TriMesh.html
Add the following cells at the end
```
def generate_trimesh(n_angles, n_radii):
min_radius=0.25
# First create the x and y coordinates of the points.
radii = np.linspace(min_radius, 0.95, n_radii)
angles = np.linspace(0, 2*np.pi, n_angles, endpoint=False)
angles = np.repeat(angles[..., np.newaxis], n_radii, axis=1)
angles[:, 1::2] += np.pi/n_angles
x = (radii*np.cos(angles)).flatten()
y = (radii*np.sin(angles)).flatten()
z = (np.cos(radii)*np.cos(angles*3.0)).flatten()
nodes = np.column_stack([x, y, z])
# Apply Delaunay triangulation
delaunay = Delaunay(np.column_stack([x, y]))
# Mask off unwanted triangles.
xmid = x[delaunay.simplices].mean(axis=1)
ymid = y[delaunay.simplices].mean(axis=1)
mask = np.where(xmid*xmid + ymid*ymid < min_radius*min_radius, 1, 0)
simplices = delaunay.simplices[np.logical_not(mask)]
nodes = hv.Points(nodes, vdims='z')
trimesh = hv.TriMesh((simplices, nodes))
return trimesh.opts(
opts.TriMesh(cmap='viridis', edge_color='z', filled=True, height=400,
tools=['hover'], width=400))
dmap=hv.DynamicMap(generate_trimesh,kdims=['n_angles','n_radii'])
dmap.redim.range(n_angles=(5,100),n_radii=(2,20))
```
The cell above renders with controls for n_angles and n_radii but does not update the trimesh from the original 5,2 combo at the beginning.
```
dmap.select(n_angles=18,n_radii=4)
```
The above works fine!
#### Stack traceback and/or browser JavaScript console output
There is a warning when displaying the dynamic map
```
c:\Users\psandhu\Miniconda3\envs\env_iwfm\lib\site-packages\holoviews\element\util.py:318: FutureWarning: Passing 'suffixes' which cause duplicate columns {'z_x'} in the result is deprecated and will raise a MergeError in a future version.
df = pd.merge(df, nodes, left_on=[v3.name], right_on=[idx.name])
c:\Users\psandhu\Miniconda3\envs\env_iwfm\lib\site-packages\holoviews\element\util.py:318: FutureWarning: Passing 'suffixes' which cause duplicate columns {'z_x'} in the result is deprecated and will raise a MergeError in a future version.
df = pd.merge(df, nodes, left_on=[v3.name], right_on=[idx.name])
```
When I move the sliders for either kdim I get this error in the js console
```
Exception in Comm callback Error: Size mismatch
at Object.e.assert (eval at append_javascript (outputarea.js:758), <anonymous>:316:158)
at a.select (eval at append_javascript (outputarea.js:758), <anonymous>:330:2590)
at x.set_data (eval at append_javascript (outputarea.js:758), <anonymous>:403:3587)
at V.set_data (eval at append_javascript (outputarea.js:758), <anonymous>:366:3458)
at V.update_data (eval at append_javascript (outputarea.js:758), <anonymous>:366:3303)
at V.t (eval at append_javascript (outputarea.js:758), <anonymous>:366:1905)
at V.s (eval at append_javascript (outputarea.js:758), <anonymous>:347:447)
at r.emit (eval at append_javascript (outputarea.js:758), <anonymous>:320:657)
at r.emit (eval at append_javascript (outputarea.js:758), <anonymous>:320:742)
at _setv (eval at append_javascript (outputarea.js:758), <anonymous>:319:4716) Error: Size mismatch
at Object.e.assert (eval at append_javascript (http://localhost:8889/static/notebook/js/main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195:13), <anonymous>:316:158)
at a.select (eval at append_javascript (http://localhost:8889/static/notebook/js/main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195:13), <anonymous>:330:2590)
at x.set_data (eval at append_javascript (http://localhost:8889/static/notebook/js/main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195:13), <anonymous>:403:3587)
at V.set_data (eval at append_javascript (http://localhost:8889/static/notebook/js/main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195:13), <anonymous>:366:3458)
at V.update_data (eval at append_javascript (http://localhost:8889/static/notebook/js/main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195:13), <anonymous>:366:3303)
at V.t (eval at append_javascript (http://localhost:8889/static/notebook/js/main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195:13), <anonymous>:366:1905)
at V.s (eval at append_javascript (http://localhost:8889/static/notebook/js/main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195:13), <anonymous>:347:447)
at r.emit (eval at append_javascript (http://localhost:8889/static/notebook/js/main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195:13), <anonymous>:320:657)
at r.emit (eval at append_javascript (http://localhost:8889/static/notebook/js/main.min.js?v=f1ffcc85342b2a9c45ba434c8f1ce101d995e4384bfa196254b0682e057f067d246c34e884bed8d784d3165a09864d5dc58f19b32fcab07130e8f9542f7c76a5:59195:13), <anonymous>:320:742)
at _setv (eval at append_javascript (http://localhost:8889/static/notebook/js/main.min.js?v=f
```
#### Screenshots or screencasts of the bug in action