W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2008

[whatwg] Usemap and ismap for canvas tag

From: Greg Houston <gregory.houston@gmail.com>
Date: Mon, 3 Mar 2008 22:40:52 -0600
Message-ID: <29ae901a0803032040u4d33ce4dp283c031110097069@mail.gmail.com>
> 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
Received on Monday, 3 March 2008 20:40:52 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:40 UTC