Fork me on GitHub
#clerk
<
2023-05-08
>
Carsten Behring13:05:31

how can I get a clerk result being a long string to word wrap in browser?

mkvlr17:05:07

use a custom string-viewer without pagination (no :page-size attr and wrap it in a hiccup element that does the wrapping

mkvlr17:05:36

This Wednesday at https://everytimezone.com/s/a80340ff @jacek.schae and I are running a https://clojure.stream/workshops/clerk. Looks like we’ll be a nice small group so we should be able to work directly with folks and go deep. There’s still time to sign up.

Peter Tonner17:05:59

I was wondering if there is a way to parameterize a notebook when building it? This would be useful for example having a notebook training an ML model, where key parameters like identity of the dataset, model hyperparameters, etc are different each time but you want to have a consistent rendered html summary of the modeling run. An example of this for jupyter is https://github.com/nteract/papermill. Maybe this could be supported with some metadata associated with certain vars in the notebook, which could then be overriden when calling build! ?

Sam Ritchie18:05:02

You could do it with a dynamic variable in your notebook’s namespace

Peter Tonner19:05:27

right that makes sense, or maybe the dynamic variable should actually be defined outside the namespace? so then you would do something like (binding [config/model :linregression ...] (clerk/build! {:paths ["notebooks/model_train.clj"]} ...)). or do I misunderstand how binding can be used?

Sam Ritchie19:05:39

That would work if model_train depends on config. This should be straightforward to test out and if it doesn’t work we should make it work

👍 2
mkvlr19:05:24

would also recommend to the the value to an atom or something that implements IDeref, to get value semantics so things work well with clerk’s caching

👍 2
Sam Ritchie19:05:35

I can now declare charts-as-values, and everything plays well with clerk/col and clerk/row

Sam Ritchie19:05:57

and of course they’re interactive

2
mkvlr19:05:45

@sritchie09 so good! Will you be generating the clojure wrapper api or write it by hand?

Sam Ritchie19:05:40

I think I am going to write it by hand at first since I want to be careful about the signatures here. Like in mathbox some of the components need to generate an output array, and then write to that and have a custom emit call into mathbox

👍 4
Sam Ritchie19:05:12

but I bet I’ll learn how to make the compile interface better from that experience, and maybe I’ll be able to automate a future pass

Sam Ritchie19:05:39

@U5H74UNSF you could imagine also a final step where we do as you had suggested, and process the viewer to lift all of the reagent/with-let entries up to a single with-let at the top

Sam Ritchie19:05:18

@U5H74UNSF you could almost have a mafs-clerk jvm library, but without Emmy you can’t pass functions, so you’d have to provide quoted function bodies. which is a deal-breaker imo