D3 JavaScript data visualization in ClojureScript

288 views
Skip to first unread message

Kevin Lynagh

unread,
Aug 25, 2011, 4:42:12 PM8/25/11
to Clojure
We've been experimenting with ClojureScript and D3, a JavaScript DOM-
manipulation with an emphasis on data visualization, and we just put
our work on the Github:

https://github.com/lynaghk/cljs-d3/

Basically, this is a façade that proxies the native D3 JavaScript
functions so that you don't have to constantly use dot and dot-dot
interop macros.
We've also added some syntactic sugar to D3 so you can pass maps to
(attr) and (style);

(-> selection
(attr {:width 10 :height 20
:color #(if (< % 1) "red" "blue")}))

and other functions get a more Clojure-esque api:

(scales/linear :domain [0 1] :range [0 Width])

The official site is here:

http://keminglabs/cljs-d3/

We're switching to ClojureScript from CoffeeScript/JS for all of our
new interface/dataviz work, so we'll be adding a lot to this project
over the next few months.

We've submitted a talk proposal for the Conj:

http://keminglabs/d3.clj/

but in the mean time we are happy to chat with anyone about our
experiences wrapping a JS library for ClojureScript and data
visualization with Clojure in general.

best,

Kevin
Keming Labs

Chris Granger

unread,
Aug 25, 2011, 6:44:43 PM8/25/11
to Clojure
Very cool! I was actually implemented a little visualization lib
inspired by D3 directly in cljs. I'll clean it up and push it to
http://github.com/ibdknox/pinot tonight.

D3 is awesome, so I'm excited to see stuff like this. :)

Cheers,
Chris.

Kevin Lynagh

unread,
Aug 25, 2011, 7:47:05 PM8/25/11
to Clojure
Rad!

I used Compojure last time I did web development in Clojure, but since
I've been picking up ClojureScript I've also been using Pinot + Noir---
nice job on those guys. If you're going to the Conj, you'll have to
track me down so I can buy you a drink.

kevin
Reply all
Reply to author
Forward
0 new messages