Fork me on GitHub
#data-science
<
2020-06-05
>
jumar12:06:06

What do you use to plot histograms (and possibly other charts) with Clojure? I have some data in CSV and want to visualize it quickly.

David Pham12:06:06

If you have ClojureScript, I use plotly

David Pham12:06:19

or on Clojure you can use plotly with libpython-clj

David Pham12:06:48

Most Clojurians use oz or saite/hanami

otfrom13:06:30

I've been happy with clj-plot for things lately, but that is because I need to generate a lot of static charts for pdfs

jumar13:06:05

I don't have ClojureScript. I like Oz but it looks rather low-level for this stuff (no built-in charts?) I was looking for something like incanter's histogram but more flexible and nicer.

David Pham13:06:37

Try libpython-clj

phoenixjj14:06:35

I have used incanter for generating histogram. You can find example in this repo > https://github.com/phoenix2082/punter

jumar16:06:37

Thanks for the pointers. I ended up playing with Oz and it wasn’t too hard to draw basic histograms

👍 4
🎉 4
practicalli-johnny17:06:28

Oz is fairly simple once you realise it's just a hash-map I did a number of example in Clojure here https://github.com/practicalli/oz-visualisations And some more info here. https://practicalli.github.io/blog/posts/visualising-uk-covid19-data-with-oz/ You can also use the vega-lite examples, as JavaScript or converting to Clojure

okwori15:06:20

Do we have a fix as to why the arc pie chart is not displaying/throwing an exception yet...

metasoarous18:06:52

Hey @jumar! Thanks for giving Oz a shot. And thanks to @jr0cket for sharing those resources.

metasoarous18:06:38

One thing to keep in mind: As far as charting is concerned, Oz is really just Vega-Lite and Vega under the hood. And as you've discovered, Vega-Lite in particular really is pretty easy to use for basic use cases. However, I hope you also find (as I and others have) that it's also really good at "growing with you" in power & expressiveness as you find yourself needing to do more detailed and interactive visualizations. It's really just a great framework.

8
metasoarous18:06:28

Finally, a number of other tools in the ecosystem (such as Saite, Hanami, Darkstar, Gorilla-REPL) also use Vega & Vega-Lite, so the grammar is very portable, and you're got some choices as far as tooling that fits your preferences & context.

metasoarous18:06:40

Please enjoy responsibly!

mauricio.szabo18:06:35

I also added a support for custom visualizations on Chlorine (socket-REPL package for Atom), so if there's someone that already use it, ping me (there's like... zero documentation so far, and it's still crude, but it works 😄)

❤️ 4
metasoarous18:06:29

Yes; Didn't mean to leave your tooling out above @mauricio.szabo, but it seems to further highlight just how much clj(s) support there is out there for Vega now!

mauricio.szabo18:06:46

@metasoarous no problem, I don't really remember if I already published that Atom now have support for this kind of extension 🙂 (But, I don't know if Chlorine works with Vega... probably you will have to do some wiring by hand, because when you require vega on Atom it requires as a Node.JS library and don't find "canvas" or something)

mauricio.szabo18:06:11

But, if you can require a library in JS, it probably works with Chlorine now 🙂.

metasoarous18:06:00

Oh; My bad. I may have misunderstood when you said "support for custom visualizations".

metasoarous18:06:58

I look forward to seeing the docs on that then.

chrisn23:06:07

There is another option. If you want to be strictly server-side you can use darkstar just to convert a vega json string into an svg and render that. https://github.com/applied-science/darkstar

👍 4
💯 4
❤️ 8
metasoarous18:06:08

Yup; For the record, I mentioned Darkstar above 🙂

metasoarous18:06:53

And doesn't http://tech.ml.dataset have some basic vega utilities?

chrisn22:06:32

Sorry, yes I see that now. I just quickly scanned. Not any more, everything like that was moved to tech.viz. That is why I now have the simpledata repository that people can just and then use immediately; the tech system now requires 3 separate dependencies if you want to train a classifier and see a plot of the output.