holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.82k stars 521 forks source link

Regression of Issue #845 (Only first tab of Tabs re-renders datashader plot) #7055

Open andr-kun opened 3 months ago

andr-kun commented 3 months ago

ALL software version info

panel: 1.4.4 holoviews: 1.19.1 datashader: 0.16.3 bokeh: 3.4.3

Description of expected behavior and the observed behavior

The latest version of panel seems to have re-introduced the issue raised in #845, which was previously fixed and was working on earlier version of panel (tested previously working version was 1.3.4).

I discovered this issue while testing to see if the latest version of panel has fixed the issue I raised in #6001.

Complete, minimal, self-contained example code that reproduces the issue

This code example below is taken from #845.

import holoviews as hv
import numpy as np
import panel as pn
import pandas as pd
from holoviews.operation.datashader import dynspread, datashade, rasterize, shade
from holoviews.operation import decimate
import datashader as ds

pn.extension()

N = 1000000
x = np.random.random(N)
y = np.random.random(N)

dset = hv.Dataset(pd.DataFrame({'x': x,
                              'y': y, 
                              'z1': x*y,
                              'z2': -x*y}))

pts1 = hv.Points(dset, kdims=['x', 'y'], vdims=['z1'])
pts2 = hv.Points(dset, kdims=['x', 'y'], vdims=['z2'])

agg1 = ds.mean('z1')
agg2 = ds.mean('z2')

opts = dict(height=800, width=800)

plot1 = datashade(pts1, aggregator=agg1).options(**opts) * decimate(pts1)
plot2 = datashade(pts2, aggregator=agg2).options(**opts) * decimate(pts2)

plots = [('z1', pn.panel(plot1)), ('z2', pn.panel(plot2))]

pn.Tabs(*plots)

Screenshots or screencasts of the bug in action

https://github.com/user-attachments/assets/a853225b-3d58-4864-90d9-e46fb6d168ca

philippjfr commented 3 months ago

So this seems to be a slightly different issue from the one described in #845. Specifically at least for me the plot in the second tab does re-render on zoom, the problem is merely that if you zoom on the first tab that does not trigger a re-render on the second tab (and vice versa), so the resolutions don't match as you flip back and forth.

tabulator_rerender

andr-kun commented 3 months ago

Thanks for looking into this issue. I am not entirely sure what the issue in #845 is as there are only static screenshots there, but I am unable to replicate your result and am still seeing the same issue as I have posted previously, even in the very latest version of panel (1.4.5) as shown below.

Screen Recording 2024-08-05 at 13 16 52

(Note that the first tab - z1 - did show the correct resolution when switching from the second tab - z2 - at the end, as shown in the screenshot below)

Screenshot 2024-08-05 at 13 38 03

I have tried using both Firefox (128.0.3) and Chrome (127.0.6533.89) on MacOS (14.5) and the same behaviour was observed.