kejtos
kejtos10mo ago

Blinking chart

is there a way to prevent the blinking effect? I supose it does not rerender it fast enough?
10 Replies
Myles Scolnick
Myles Scolnick10mo ago
Is that matplotlib? If you can send a minimal example, I can look if there is something we can do
kejtos
kejtosOP10mo ago
hmm, while making it I realized I might know where issue is, since it happens in this case but not in another. Will test it. And it is altair btw.
Myles Scolnick
Myles Scolnick10mo ago
ah Altair shouldn’t have flickers, but maybe you’ve found an edge case
kejtos
kejtosOP10mo ago
aaah, oke, I thought it is because I do not precompute the values that gets plotted, since I have another similar graph, where I precompute the values and just change the size of the array that gets plotted, which does not flicker. I can send u the ntb, it should be in the cell 17. https://marimo.app/l/nukly4
marimo | a next-generation Python notebook
Explore data and build apps seamlessly with marimo, a next-generation Python notebook.
mcburton
mcburton10mo ago
I do get this blinking with matplotlib, don't have an example handy, but I figured it was due to re-rendering the whole plot on each change. Wasn't sure if there was a way around this without some kind of deep integration with matplotlib that could dynamically update parts of the axes without a full redraw (is that even possible with matplotlib?)
Myles Scolnick
Myles Scolnick10mo ago
There is a way to render matplotlib as svg instead of images. But I can also see if I can get images to swap performantly without a flicker. @mcburton can you also send me a minimal example?
mcburton
mcburton10mo ago
Yeah, maybe later today. it won't work on WASM since the libraries aren't ported to pyodide
Myles Scolnick
Myles Scolnick10mo ago
@kejtos I have a fix for the blinking (it was due to an edge case in our eager-resolving since it is a layered chart)
kejtos
kejtosOP10mo ago
AWESOME!