Hi there 👋 ; first time with Clerk here.
I'm trying a variation on the https://book.clerk.vision/#vega-lite. I am trying to use a local csv file for the secondary data source in the example. I found mention of Clerk serving local files https://clojurians.slack.com/archives/C035GRLJEP8/p1696673633562989?thread_ts=1696669747.621369&cid=C035GRLJEP8 and https://github.com/nextjournal/clerk/blob/d9cab25aae62029557cff3346e7bd06e878999cd/src/nextjournal/clerk/webserver.clj#L338, but I'm having trouble getting that to work.
My clerk notebook is being served from notebooks/sunrise_us.clj. I've got the file in _fs/data/sunrise-times.csv. But when I navigate to localhost:7777/data/sunrise-times.csv, I get a 404, and I don't see it listed in Clerk home. What am I missing? Thanks.
How I understand when I read this:
The file should be in data/sunrise.csv in your project, but the url in your browser should be /_fs/data/sunrise.csv
Of course! I’ll try this shortly, but that definitely looks right.
Still a work in progress, but I'm really enjoying this! Thanks for the help.
I don't see the file serving behavior documented in the Book of Clerk; I'd be happy to submit a PR if you think that'd be helpful.
Hey 👋 Clerk newbie here. I'd like to make my Clerk notebook a little more interactive by using (sci/react?) input elements and either call server-side functions via the Clerk web-socket and/or set! refs in sci and have them sync'ed to the server. I've searched through the Clerk source but I'm pretty much lost. Any pointers/ideas?
Have you seen the book section on how to write your own viewers? https://book.clerk.vision/#render
Ah yes - didn't get that. That lets me create input things and refs. 👍 But how can I communicate back to the server?
I think the idea is to create a "synced atom". https://book.clerk.vision/#clerk-sync
I understood synced atoms as being synced from the server to the client. I want the orher way. But will try. Thank you.
they sync both ways
Perfect 🎉 🚀 !!
@borkdude and any chance to call server-side functions from the client/sci through the clerk web-socket?
I don't think #clerk has this feature yet. Perhaps @mkvlr has thoughts about it
@henrikheine yes, you can call (nextjournal.clerk.render/clerk-eval expression-to-eval) to eval things on the JVM, returns a promise with the result
Excelent! Clerk & sci are awsome!!