Tutorial/Example of a d3.js HTML5 app with reuseable methods and autoscaling