Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
63 lines (37 sloc) 2.1 KB
  _____   ___  
 / ____| |__ \ 
| |         ) |
| |        / / 
| |____   / /_ 
 \_____| |____|

Declarative visualization in Clojure(Script)

C2 is a D3-inspired data visualization library for Clojure and ClojureScript. Map data directly to DOM-elements on the client-side or Hiccup vectors on the server-side and leverage the existing power of HTML, SVG, CSS, and the web ecosystem to construct bespoke data visualizations. For examples, see the official site.


ClojureScript is new. This library is newer. We have no idea what's going on, and we're going to break a lot of stuff figuring it out. Stable 1.0 release planned for May 2012.

Play around

See vrepl/README.markdown for instructions on using the built-in examples+interactive-development server.

There's also a two minute screencast.

The VREPL doesn't contain any ClojureScript---nice ClojureScript support+examples coming as soon as Clojure/ClojureScript code-sharing issues are resolved in Lein tooling.

To use from Clojure, add this to your project.clj:

[com.keminglabs/c2 "0.0.1"]


  • Fixup Clojure/ClojureScript support by moving as much of the source as possible to "cljx" intermediate format that can be statically transformed into platform-appropriate sources.

  • Moar documentation, consistent docstring format.

  • Official release


Most of C2 is written in platform-agnostic Clojure and tested with Midje. Run

lein midje --autotest

to start a test watcher, which will automatically reload namespaces and run tests when source or test files are changed.

For ClojureScript-specific integration testing, use our highly advanced, PhantomJS-powered "list-of-assertions" testing framework:

cake run script/compile_tests.clj && phantomjs test/integration/

or, if you're too cool to go headless, open up test/integration/runner.html in your browser.