HTML/Canvas and SVG
Appearance
< HTML
NOTE: THE MATERIAL ON THIS WIKI PAGE IS BEING MIGRATED ONTO THE WEB EDUCATION COMMUNITY GROUP'S DEDICATED WIKI PAGE, AT http://www.w3.org/community/webed/wiki/HTML/Canvas_and_SVG.
Canvas and SVG Elements
The <svg> element is intended the 2D vector rendering. The <canvas> element gives access to the 2D Context API.
Technical comparison
| SVG | 2D Context API |
|---|---|
| document-based | script-based |
| vectors | pixel operations |
| object model with hi-testing and events | low-level graphics API, no scene graph |
| performance hit with large numbers of shapes | fast rendering |
| accessible | must create accessible equivalent |
Use case comparison
| SVG | 2D Context API |
|---|---|
| user interfaces | fast-paced games |
| scalable images | very complex images |
| interactive animations | highly dynamic visualizations |
| for designers | for developers |