
Introducing d3-shape - ingve
https://medium.com/@mbostock/introducing-d3-shape-73f8367e6d12
======
mambodog
I've recently been experimenting with how best to leverage the wealth of
knowledge which has gone into d3 within the context of React, where the
conventional selection-driven APIs become a hinderance rather than a help.

Around that time, I noticed the new modular repos on the d3 Github org[1]
coming together, and have since been watching with great anticipation. I'm
glad to see d3 evolving for a new world where its excellent, fine-tuned
collection of math and drawing functions work in concert with your rendering
framework of choice.

[1] [https://github.com/d3](https://github.com/d3)

~~~
mambodog
For example, here's something pointless I threw together combining d3-shape,
d3-scale and react-motion:
[https://jsbin.com/mehata/edit?js,output](https://jsbin.com/mehata/edit?js,output)

------
pathsjs
Shameless plug: the design of this seems really similar to my own library
paths.js. In both cases, the starting point is observing that nowadays people
usually already use some framework to manipulate the DOM, so what is actually
needed is some way of computing some description of shapes starting from the
data (and suitable accessor functions). see
[https://andreaferretti.github.io/paths-js-
demo](https://andreaferretti.github.io/paths-js-demo)

~~~
pacomerh
One thing, I was playing with the graph tree demo and it freezes after a few
drags, every single time. Is this part of the demo?

~~~
andreaferretti
Yeah, the graph chart is buggy, and advertised as such. I have been wanting to
improve that for a while, but I did not find the time yet...:-(

------
iheartmemcache
I was literally working on almost the same thing all day, except with dot
syntax compat (so you get all the GraphViz/LaTeX/Docbook/Doxygen benefits). Oh
well, excellent work, my good man !

------
nathancahill
RIP all other JS charting libraries.

~~~
atonse
Eh I'm not so sure. I used NVD3 as a charting library on a project because I
wanted to use d3 after seeing all the amazing work others have done, but found
it to be very confusing. I'm not sure how much of that is NVD3 or how much of
that was just d3.

I think it helps if you just understand the mental model that d3 is going for.
Clearly tons of people are able to do good work with it.

~~~
paradite
I agree d3 is confusing at the start, especially the data join concept and
method chaining. But once you put enough effort to understand exactly what
each function does (through experimenting with browser inspector), it becomes
as easy to use as jQuery.

------
dvdplm
Rendering is broken in Firefox on iOS. Known issue? Otherwise it looks great!

~~~
mbostock
Would you mind filing a bug with more information?
[https://github.com/d3/d3-shape/issues](https://github.com/d3/d3-shape/issues)

------
SimeVidas
Is there an isolated demo (JS Bin & co.)? Couldn’t find it in the text/repo.

------
michaelcolenso
This is great. Thanks Mike.

