nbb 2022-09-21

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?

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

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

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

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

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

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

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

> 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.

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

Thanks!

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

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.

@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

But I could be misremembering it

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 🙂

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?

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

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

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

@daslu has joined the channel