sheluchin / hiccup-d3

D3-Charts written in Clojure

Home Page:https://rollacaster.github.io/hiccup-d3/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hiccup-d3

hiccup-d3 provides D3 charts written in ClojureScript.

Usage

This is not a library. Just copy one of the examples as a starting point for your chart: https://rollacaster.github.io/hiccup-d3/.

The example code assumes D3 is already required.

Rationale

Transforming a D3 example from Observable to ClojureScript is repetitive work

D3 can only process JavaScript data structures but to use the result you need to transform it into Clojure data structures. A common solution is to transform them into hiccup. Every time I start a new chart I repeat this task, to avoid this I created hiccup-d3 to have a common starting point for D3 charts.

hiccup-d3 is no wrapper library

Interop between ClojureScript and JavaScript works well. Therefore, I did not want to create a wrapper which would add additional abstractions. Parts of D3 are written in an idiomatic Clojure style and focus on transforming data. Only those parts are part of hiccup-d3. Maybe I’ll try to write a library for the other parts in the future.

About

D3-Charts written in Clojure

https://rollacaster.github.io/hiccup-d3/

License:MIT License


Languages

Language:Clojure 92.2%Language:HTML 6.8%Language:JavaScript 0.8%Language:CSS 0.2%