FWIW, I'm leaning toward something that just creates a Clojure map, converts it to js (hopefully via clj->js
), then leaves it to Vega
to evaluate it
like gyptis does (https://github.com/dvdt/gyptis)
Not a bad option 🙂
I guess it depends how much you plan to use it. If it's more than a little, it's not too bad usually to write a thin cljs wrapper over a js lib.
That's the approach I took with the Mathbox lib, which is another JS graphics lib. If you want to get an idea of what's involved, take a look at https://github.com/eggsyntax/cljs-mathbox
The actual wrappers (which was most of the work) are in https://github.com/eggsyntax/cljs-mathbox/tree/master/src/cljs_mathbox
A lot of it's stuff like this:
(defn bezier [mb-instance opts-map]
(. mb-instance bezier (clj->js opts-map)))
which is a bit tedious, but not hard.that looks interesting
& if you have to do a bunch of them, you could write a fn-to-js-method
macro or something...
my JS fu is not as good as I'd like it to be, so I favor something simple until I get a chunk of time to read up on all the frontend stuff I don't currently know
Totally.