Reusable charts with d3.js and react.js