
Strokes: Let's pretend D3 was written in ClojureScript - sebg
https://github.com/dribnet/strokes
======
woah
I like all the stuff that D3 has, but it's all done through the most obnoxious
cute chaining API. Why can't a low level library have simple, if more verbose,
normal function calls? I see that this thing doesn't try to solve the problem
at all.

------
mrcactu5
I remember getting excited about functional approaches to d3, but then the
excitement died down

[https://keminglabs.com/c2/](https://keminglabs.com/c2/)

[https://github.com/seliopou/elm-d3](https://github.com/seliopou/elm-d3)

In all fairness mBostock works very hard on d3 and he is prolific at it as
evidence by his bl.ocks.org pages but his library is very opinionated as well

~~~
jdminhbg
Most of what C2 provided is now better-provided by React and a ClojureScript
layer over top of it -- I upgraded my C2 project to use Reagent. I think this
is actually why C2 is abandoned, although I don't know for sure.

~~~
lynaghk
I'm the author of C2, and you're exactly right. React provides everything that
C2's underlying DOM manipulation library
([https://github.com/lynaghk/singult/](https://github.com/lynaghk/singult/))
does. React is faster, capable with more browsers, and has better API hooks
that let callers control the low-level details.

~~~
harperlee
Thanks for C2! I've just looked and it is indeed indicated as "Deprecated" in
github, but in keminglabs.com it still states "C2 is a very early project, and
there’s a lot left to do." Perhaps that could be updated... I remember some
time ago I wondered this, and I didn't see the "Deprecated" in github, if it
already was.

------
jbranchaud
Is anyone working on a library similar to d3 that is written from the ground
up in ClojureScript?

------
pandeiro
toxi's thi-ng/geom[1] library deserves a mention in this space.

[1]: [https://github.com/thi-ng/geom](https://github.com/thi-ng/geom)

~~~
reitzensteinm
I recently attended a workshop with Karsten (in fact, the last commit to geom
was a small bugfix I authored there). He's a really smart guy and the amount
of ground covered by the libraries is bewildering.

Probably worth checking out the main site for an overview if you haven't seen
it before:

[http://thi.ng/](http://thi.ng/)

------
jraines
the example links (s.trokes.org) are broken. HN hug? Although my browser is
saying it's a DNS resolution issue.

~~~
dribnet
sorry - s.trokes.org was just a clone of bl.ocks.org with syntax highlight
support for clojure. I've updated the links to blocks and the examples are
working again.

------
arohner
I've recently had good success writing raw SVG from ClojureScript. What does
D3 provide on top of that?

~~~
cpbotha
Probably the most important innovation of d3 is the idea of the DOM - data
join. Mike Bostock, handsome father of d3.js and maker of all that is pure and
wonderful (I have the good fortune to spend lots of work time using d3),
mentioned this himself during his reddit AMA, see
[https://www.reddit.com/r/dataisbeautiful/comments/3k3if4/hi_...](https://www.reddit.com/r/dataisbeautiful/comments/3k3if4/hi_im_mike_bostock_creator_of_d3js_and_a_former/cuul8go)

In short, you get some data, you join it with a selection of wholly or
partially non-existent DOM, and then you work with the enter (new), update
(existing) and exit (not required for the new data) selection. This is an
extremely powerful metaphor for representing data and performing dynamic data
updates using arbitrary mixes of SVG (or any other DOM) elements. (oh, based
on this mechanism, you can build really beautiful visual transitions)

Here's a short introduction to the join idea in d3:
[https://bost.ocks.org/mike/join/](https://bost.ocks.org/mike/join/)

BTW, programming in d3.js already feels a whole lot like programming in a
functional language.

