This is an super basic example of using KotoJS to make reusable components.
Please note that this example will only work on a very modern browser because the javascript is writting using ES2015 syntax.
For production applications where ES2015 is limitied, I recommend using a transpiler like babeljs to transpile the code to valid ES5 syntax.
See the starter template for more info.
Click here for ES5 version of this chart
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js
https://npmcdn.com/koto@0.1.6/dist/koto.js