[whatwg] Usemap and ismap for canvas tag
Greg Houston
gregory.houston at gmail.com
Mon Mar 3 20:40:52 PST 2008
> Wouldn't it make more sense just to use SVG?
Dynamic interactive charts and graphs seem to fall into the gray area
between what is more appropriate for canvas or SVG.
"<canvas> is designed for creating images dynamically in scripts. SVG
focuses on pre-computed image documents, and is more complex and
slower to generate dynamically."
So canvas is tuned more for creating dynamic charts and graphs whereas
SVG is better apt for static sprites and interface elements with the
bonus that it "can automatically detect interaction".
WHATWG SVG and Canvas Comparison:
http://wiki.whatwg.org/wiki/SVG_and_canvas
My second idea of being able to add canvas shapes directly to the DOM
may be too much. Though since canvas "renders onto a fixed-resolution
bitmap" and is basically a flat image, giving the canvas element the
usemap and ismap properties doesn't seem like it would be a big issue.
Browser agents could probably use pretty much the exact same code for
both the img and canvas tag where image maps are concerned. The
benefit would be being able to add hot spots for links and tooltips to
canvas drawings. It seems silly that something as dynamic as the
canvas element would have less interactivity than the img element.
Greg
More information about the whatwg
mailing list