All examples By author By category About

syntagmatic

Convert SVG to Retina Canvas

Convert SVG to canvas on-the-fly. Updated to support higher pixel densities, like Retina displays. Compare to Andrew Mollica's example which looks slightly fuzzy on high-density displays.

This article from MDN explains the process: Drawing DOM object into a canvas. This works for any DOM object, not just SVG. Not sure if this is well supported by older browsers. Works on Chrome, Firefox and IE 10 for me. The bar chart is a fork of this block by Mike Bostock: Canvas Bar Chart.