
I’m trying to make a dinamic plot. My initial code to create the plot is the following:
p = figure(title="Total Incidents", x_axis_label='Date', y_axis_label='Incidents',x_axis_type='datetime',width=1200, height=500)
start_time=time.time()
p.varea_stack(list(map(str,unique_values)),x="x_values", source=source, color=magma(len(unique_values)))
print(time.time()-start_time)
This works fine even if the plot generates a list[GlyphRenderer] of length 200.
The time spent is: 0.15152668952941895
My goal is being able to update the plot. My current code inside a callback is the following:
data,unique_values=update(freq,group)
source.data =data
p.renderers=[]
start_time=time.time()
p.varea_stack(list(map(str,unique_values)),x="x_values", source=source, color=magma(len(unique_values)))
print(time.time()-start_time)
It works but if the list[GlyphRenderer] length is elevated(I’m trying with 158) the time spent is 17.01542377471924
Why does it take so long? Any possible solutions?
I’m new to Bokeh and I don’t know if this is the correct way to update plots.

