Fork me on GitHub
#datavis
<
2016-08-01
>
aaelony16:08:19

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

eggsyntax16:08:13

Not a bad option 🙂

eggsyntax16:08:01

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.

eggsyntax16:08:37

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

eggsyntax16:08:53

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.

aaelony16:08:13

that looks interesting

eggsyntax16:08:39

& if you have to do a bunch of them, you could write a fn-to-js-method macro or something...

aaelony16:08:49

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