Re-usable charts for d3.js