A helper for making reusable d3 graphs