Hacker News new | ask | show | jobs
by austinhyde 3266 days ago
Having gone through the process of marrying react and d3 - IMHO it's far easier to let react do DOM diffing and manipulation, and let d3 worry about data processing. The two work great together, just so long as you don't try to shoehorn one into the other. React more or less mirrors data(), enter(), and exit() with props, componentDid(/Will)Mount, and componentWillUnmount
2 comments

Having officiated the same kind of union between Ember and D3 in a few different ways, I have to agree - let Ember handle rendering, and D3 handles dynamic data binding. I've been working on an open source Ember library based on these concepts: http://locusenergy.github.io/ember-sparkles/#/sine-wave
This may be too late for you, but this is a great library that marries d3 with React. https://github.com/tannerlinsley/react-charts
Yeah, that does exactly the thing I was describing from a quick skim. https://github.com/uber/react-vis does it as well. I've found that attempting to wrangle one of these chart libs takes more time than a quick `myData.map(d => <line path={linefunc(d)}/>)` or similar.