I am new to JS. I have read some React.js code in ES6. It's very clean. I would like to use React.js for a web app and follow their workflow. Part of the app display charts. I am looking at d3.js. But I don't know how I can use d3 in ES6. All examples I found so far are not in ES6. How do I write/convert one? Looking to use something similar to http://bl.ocks.org/erichoco/6694616 . thanks!
2 Answers
Check https://github.com/uber/react-vis - a nice ReactJS wrapper for D3.
Documentation: http://uber.github.io/react-vis/#/
Works with create-react-app out of the box. And they also have instructions for babel
Comments
Here's a really simple way - and this is without consideration of preloading, fetched data, etc. - all the javascript in there can be stuck in the render() method so that it's executed at render() time or made available on some DOM element like a button.
This guy says it a lot better and has awesome examples: https://github.com/freddyrangel/playing-with-react-and-d3
Hope that helps!