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:
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.
@Marcos_Iturbe_Marenc you have not provided enough information to be able to speculate. In order to investigate we need a completeMinimal Reproducible Example that can actually be run. Failing that, all I can note is that the error message is due to trying to put columns with different lengths inside one ColumnDataSource. This is not allowed, a CDS is like a basic Pandas DataFrame, all columns must always have exactly the same length.
I will also note that varea_stack is not a basic single glyph. It is actually a convenience helper for coordinating multiple bar glyphs tied together with appropriate stack transforms. Depending on what you want to update, it may simply be much, much easier to just remove the old plot entirely, and replace it with a brand new plot, rather than trying to “update” the existing plot in place.