nbb

dabrazhe 2022-09-21T16:12:17.653939Z

Hi, checking out nbb. What's the minimal workflow to target a web browser? I would like to try a ClojureScript graphics or animation library. Is nbb a good fit for this use case?

borkdude 2022-09-21T16:13:18.681889Z

nbb doesn't target the browser, it runs on Node.js

borkdude 2022-09-21T16:13:57.483259Z

Perhaps #scittle is more what you want combined with e.g. vega-lite

borkdude 2022-09-21T16:14:01.409279Z

not sure

borkdude 2022-09-21T16:14:26.976999Z

But for command line / server side libraries Node.js might have some graphical stuff

dabrazhe 2022-09-23T14:47:06.058359Z

These projects look pretty great, and elaborate, thank you. I guess I am looking for smth more simple. Like maria.cloud, but run locally with VSC and minimal installation, that kids can use without being overwhelmed. I have to backtrack a little.

👍 1
dabrazhe 2022-09-22T17:03:14.465719Z

Hi! actually browser does not matter that much, nice to have. I want to create a minimal setup that is easy to install and can render graphics and simple animation based on primitives

👍 1
dabrazhe 2022-09-22T17:04:35.702619Z

Vega appears to be geared towards business chart. But if it can render other sort of graphics it would be interesting to learn more

Daniel Slutsky 2022-09-22T17:29:19.064119Z

For browser-free uses of Vega, there is also Darkstar: https://github.com/applied-science/darkstar

borkdude 2022-09-22T17:29:59.921429Z

https://twitter.com/KimmoKoskinen/status/1247603600450355202

👍 1
Daniel Slutsky 2022-09-22T17:30:25.191769Z

> But if it can render other sort of graphics it would be interesting to learn more Curious to hear more about what you have in mind and would find useful.

borkdude 2022-09-21T16:17:33.224519Z

cc @cldwalker

borkdude 2022-09-21T16:19:25.904169Z

I think some folks have also used #scittle with vega-lite

borkdude 2022-09-21T16:19:31.320729Z

cc @daslu

Daniel Slutsky 2022-09-21T17:21:25.369929Z

Thanks!

borkdude 2022-09-21T17:25:52.015799Z

So @daslu - do you have any suggestions for @dennisa?

Daniel Slutsky 2022-09-21T17:42:14.906719Z

It looks wonderful. I'll try to think about possible use cases. 🤔 🙏 Mentioning also @carsten.behring who created an EDN version of the Vega-Lite official examples: https://behrica.github.io/vl-galery/convert/ and @jsa-aerial, the author of https://github.com/jsa-aerial/hanami.

borkdude 2022-09-21T17:44:12.315379Z

@daslu What I was getting it is I think you made some stuff with scittle + vega-lite, which I hoped you could share with @dennisa

borkdude 2022-09-21T17:44:32.838989Z

But I could be misremembering it

2022-09-21T17:53:29.425279Z

https://github.com/cldwalker/bb-clis/blob/master/doc/scripts.md#bb-vis is the updated readme to that script. I haven't used it in awhile unfortunately. For what I was doing, vl2* commands were all that I needed to interface with. If I ever need to dip into the vega-lite api I'd definitely switch to nbb 🙂

Daniel Slutsky 2022-09-21T17:53:31.272859Z

Oh, sorry. Yes, I do use Vega-Lite from Scittle, simply to render plots in an html page. How would that be useful in an #nbb script?

borkdude 2022-09-21T17:54:00.319099Z

Well, I first pointed @dennisa to #nbb but it wasn't clear to me he wished to target the browser

Daniel Slutsky 2022-09-21T17:54:12.540339Z

Ohhh

Daniel Slutsky 2022-09-21T17:57:05.418789Z

Here is a piece of cljs code I'm using from #scittle to render a Vega / Vega-Lite spec: https://github.com/scicloj/clay/blob/d09b981342124ba8fb4769e682c7a52d7070aedd/src/scicloj/clay/v1/tool/scittle/cljs_generation.clj#L19

(defn vega [spec]
     [:div
      {:ref (fn [el]
              (-> el
                  (js/vegaEmbed (clj->js spec)
                                (clj->js {:renderer :svg}))
                  (.then (fn [res]))
                  (.catch (fn [err] (println (str "vegaEmbed error: " err))))))}])
It works when the following dependencies are in the page:


🙏 1
borkdude 2022-09-21T17:58:13.347379Z

Thanks!

Daniel Slutsky 2022-09-21T17:59:39.589539Z

Please tell me if I can help some how. I'm curious to hear about troubles & surprises.

Daniel Slutsky 2022-09-21T16:19:33.150309Z

@daslu has joined the channel