Canvas rendering helpers for d3.js