News for hackers. Stuff that matters.
Re:Introducing d3-scale by lfittl on Monday December 28, 2015 @03:11PM (#10803071)
I'd love for d3 to have great integration with React - whats your suggested approach?

https://github.com/FormidableLabs/victory seems most promising, but isn't really d3, more "d3-like".

Re:Introducing d3-scale by mbostock on Monday December 28, 2015 @03:16PM (#10803100)
I haven’t used React enough to form a strong opinion on right vs. wrong, but one of my objectives in decoupling D3 (see the new modules at https://github.com/d3) is to make it easier for people to use just the parts of D3 they need.
Re:Introducing d3-scale by mambodog on Monday December 28, 2015 @04:33PM (#10803521)
The recent more-modular approach d3 is taking (specifically, the separation of DOM selection-driven APIs from the data manipulation stuff) means you can now just use d3 with React directly.

For example, you can use d3-scale to map from data to drawing coordinates, or straight to SVG path data (using d3-path/d3-shape). You can then easily render this to an inline SVG using React (or to some other backend using React libs like react-canvas and gl-react). Building the svg elements directly this way makes it easier to attach React event handlers to them, and gives you more fine grained control, rather than using off-the-shelf components.

Here's an example combining d3-shape and d3-scale with React and react-motion: https://jsbin.com/mehata/9/edit?js,output

Re:Introducing d3-scale by esmevane on Monday December 28, 2015 @04:29PM (#10803499)
I had a pretty decent working example of coupling the two earlier this year: http://beatmatch.esmevane.com/

I wired things up using a Flux-like architecture, where the Store would periodically signal a data change and the component would render it, transitions and all. It all worked out pretty much as I expected.

https://github.com/esmevane/beatmatch/blob/master/assets/scr...

https://github.com/esmevane/beatmatch/blob/master/assets/scr...

Re:Introducing d3-scale by phunge on Monday December 28, 2015 @11:13PM (#10805152)
Here's a writeup on a few approaches: http://slides.com/shirleywu/deck#/
Re:Introducing d3-scale by graffitici on Monday December 28, 2015 @03:11PM (#10803077)
Yes, this would be fantastic!