Hi,
I am wondering if I am doing something wrong or not. I am trying to plot multiple large timeseries in a row. I use rasterize for that. Everything works fine, but as soon as I press the reset button from the tools, it is taking more time to update when zooming in/out.
Here is the code I use to build the curves:
def plot_ts(timeseries: list):
# create times
times = []
for ts in timeseries:
times.append(np.arange(len(ts)))
# create fake channel names
ch_names = [f"ch_{i}" for i in range(len(timeseries))]
# generate curve for each ts
curve = None
for i, ch in enumerate(ch_names):
if curve is None:
curve = rasterize(
hv.Curve(
(
times[i],
timeseries[i],
),
),
# precompute=True,
).opts(
ylabel=f"{ch}",
)
else:
curve += rasterize(
hv.Curve(
(
times[i],
timeseries[i],
),
),
# precompute=True,
).opts(
ylabel=f"{ch}",
)
return curve
Then I run it with fake data:
timeseries = [np.random.rand(50000) + np.random.randint(-1, 1) for _ in range(20)]
curves = plot_ts(timeseries, share_y=False)
curves.cols(1)
panel = pn.panel(curves)
server = pn.serve(panel)
Behavior is very nice until I reset the plot:
Is it expected behavior from the “reset” button or am I doing something wrong ?
Any help would be much appreciated!