clerk

Sam Ritchie 2023-11-17T19:19:02.817749Z

question about this: https://probcomp.github.io/gen-finance/ it looks like when I refresh a vega-lite chart too fast, I get a flicker as the chart disappears and re-appears. Is there a clean way to have the vega-lite viewer preserve its area during a refresh?

mkvlr 2023-11-17T21:27:09.200849Z

Matt implemented this a while back so it should work. Does it only happen with the editor or with normal clerk as well?

Sam Ritchie 2023-11-18T03:39:45.659959Z

Oh interesting I’m not sure, this notebook only works in editor mode so I didn’t have these fast-reloading charts in normal mode

Sam Ritchie 2023-11-21T17:33:34.158409Z

@mkvlr do you have a pointer to the PR where matt fixed this? maybe I can figure out how to get the fix working in editor mode…

mkvlr 2023-11-21T17:36:11.652589Z

@sritchie09 should be https://github.com/nextjournal/clerk/pull/231

Sam Ritchie 2023-11-21T17:48:00.204969Z

interesting, I will test if the flicker is still present. I see when I look at the react-vega codebase that vega-embed actually has a modifyView command… https://github.com/vega/react-vega/blob/master/packages/react-vega/src/Vega.tsx#L41

Sam Ritchie 2023-11-21T17:48:41.327609Z

maybe we need to do more of what react-vega is doing, or pull it in instead of vega-embed?

Sam Ritchie 2023-11-21T17:51:48.028609Z

@mkvlr another issue I was running into in editor mode that I THINK we had seen before was that syntax quoting and unquote together fail in editor mode… @borkdude might remember the details

Sam Ritchie 2023-11-21T18:11:33.722079Z

https://github.com/nextjournal/clerk/issues/576

Sam Ritchie 2023-11-21T23:51:55.328229Z

I got the Vega component refreshing correctly by using the component directly instead of the clerk/vl wrapper with inspect! This makes more sense inside of a viewer anyway