3 ms·
There are a variety of ways that you can use canvas with D3. For example: force layouts (http://bl.ocks.org/3231307 http://bl.ocks.org/3231307 and http://bl.ock
by mbostock 14y ago
There are a variety of ways that you can use canvas with D3. For example: force layouts (http://bl.ocks.org/3231307 http://bl.ocks.org/3231307 and http://bl.ocks.org/3180395 http://bl.ocks.org/3180395), time-series charts (http://square.github.com/cubism/ http://square.github.com/cubism/), custom DOM-to-canvas renderers (http://bl.ocks.org/1276463 http://bl.ocks.org/1276463).
If you mean you want D3 to support behind-the-scenes mapping from SVG to Canvas, that will never happen. Unlike Dygraphs, D3 is not a charting library, so it doesn’t abstract the underlying representation; with D3, you’re still using the DOM, albeit with a more convenient API. Magically converting SVG to Canvas would be a huge amount of work. And for what? In many cases SVG performance is comparable to Canvas, and SVG offers conveniences that Canvas cannot, such as external styling via CSS, simple declarative event listeners, and the ability to inspect elements.
- deleted 14y ago[deleted]
- rich_harris 14y agoPlus with SVG you get Retina support for free.