Fork me on GitHub
#clerk
<
2023-06-27
>
Sam Ritchie00:06:40

cross-posting some new powerful abilities for Clerk: https://clojurians.slack.com/archives/C06MAR553/p1687824938993259

🎉 6
🍩 2
Colin (fosskers)04:06:07

For some reason my Plotly graphs are just not updating, even though I've confirmed in the REPL that my values are different

Colin (fosskers)04:06:22

It seems stuck on the old graph for some reason

Colin (fosskers)04:06:17

Blowing away my .clerkfixed it.

Aziz Aldawood04:06:34

happened to me before. try disabling caching for the chart

Colin (fosskers)04:06:05

Is that a plotly option or a clerk one?

Colin (fosskers)05:06:46

Thanks!

âś… 2
Colin (fosskers)02:06:15

Yup, that fixed it!

Colin (fosskers)02:06:31

Specifically ^::clerk/no-cache

hkjels11:06:16

Can Clerk be forced to run using ClojureScript and not Clojure?

jackrusher11:06:58

Clerk uses both Clojure and Clojurescript. Can you describe your use case? We might be able to find something that works for it.

hkjels11:06:42

I am generating SVG graphics directly within the system. In Clojure, I aim for these to appear as static images. However, for the ClojureScript part, I would like these SVGs to be interactive, responding to touch and mouse input. The challenge I'm facing is that when I run the notebook in Clerk, it seems to display only the static Clojure version, as far as I can tell.

hkjels11:06:44

I tried to rename the notebook to cljs, but that had no effect

jackrusher11:06:00

You can create a viewer that gets run on the browser side and communicates with the JVM through a websocket. That’s how things like Emmy’s interactive viewers work: https://clojurians.slack.com/archives/C06MAR553/p1687824938993259

jackrusher11:06:05

You can see a simple example using a “sync” atom (whose state is automatically synchronized between the front and back ends) in this thread: https://clojurians.slack.com/archives/C035GRLJEP8/p1687533657002039

hkjels11:06:00

I see. The atoms in question are in the implementation and not in the notebook itself. I will read up on these links and see if I can make it work.

jackrusher11:06:56

You would create an atom in your notebook that’s decorated with some metadata that indicates to clerk that it should be sync’d. If you take a look at Martin’s answer in the thread I just posted you’ll see what I mean. We’ll hopefully get this part of Clerk documented in the Book of Clerk pretty soon 🙂

đź‘Ť 2
oly08:06:17

@U0B1SDL67 can't help on the clerk side but vary curious in what your doing and how with svg's, I have an app which does exactly this it reactive drawing on the frontend but can also generates the svg's on the backend and can output jpeg or png images to share. mainly curious on the libraries / tools your using to accomplish this your end if that's something you don't mind sharing ?

hkjels10:06:37

@UU67HFS2X I'm making a graph library 🙂

hkjels10:06:48

atm, reagent is the only dependency. Eventually, I will likely add threejs as well

oly10:06:40

ah okay, because you mentioned back end that peaked my interest I was curious how you where handling rendering, I have been using batik for that side of it but curious about other tools 🙂