Reusable extensions for d3