[whatwg] Usemap and ismap for canvas tag
Greg Houston
gregory.houston at gmail.com
Tue Mar 4 21:25:50 PST 2008
David,
I really didn't mean to shift the emphasis to SVG at all. I don't
think anyone is going to try "running a Gaussian blur of a
dynamically generated mouse-driven turbulence displacement of a bitmap
[via] JavaScript on a canvas image."
All I am doing here is making simple pie charts, and I would like
those pie charts to have simple hot spots, nothing fancy. With hot
spots these simple canvas graphics then have very basic interactivity
such as links and tooltips without increasing the overhead of the
canvas element. Also, implementing this in the browsers should be
trivial since the usemap and ismap functionality already exists for
the img tag.
This is just about very basic functionality and is aimed to benefit
simple-minded web developers like myself who are not necessarily
trying to perform graphic rocket science.
<canvas id="myChart" width="200" height="200" usemap="#myMap"></canvas>
Greg
On Tue, Mar 4, 2008 at 9:47 PM, ddailey <ddailey at zoominternet.net> wrote:
> Greg, I remember seeing the quote here:
>
> > "<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."
>
> at some point in time and thinking to myself that it was basically
> inaccurate. I realize it is probably not you who wrote this delightful
> aphorism of guidance for the rest of us, so it is not with you that I would
> raise objection.
>
> For me, SVG does not at all focus on pre-computed image documents, but
> rather it is because of its dynamic qualities that I use it. It is more
> complex than canvas, that is for sure. I think in terms of speed, though, it
> all depends on what you are doing. Try running a Gaussian blur of a
> dynamically generated mouse-driven turbulence displacement of a bitmap
> through your own JavaScript on a canvas image -- then let's talk benchmarks.
> [references available upon request]
>
> But certainly and absolutely I would have never shown SVG more than a
> passing glance if it had been focused on pre-computed image documents -- how
> boring! VML was perfectly interactive and canvas-like for most mundane
> purposes, it just didn't have bitblits. If MS had had the foresight to put
> bitblits in VML we'd all be using Silverlight now and Microsoft would buy
> Google. </kidding>
>
> I think the aphoristic quote may have propagated from the relatively
> confined arena of WHATWG to the more noticeable archives of the W3C (am not
> sure about this) but it might be nice for whoever runs the canvas boat to
> steer the comparison a little more precisely.
>
> regards,
> David
>
>
>
>
> ----- Original Message -----
> From: "Greg Houston" <gregory.houston at gmail.com>
> To: <whatwg at lists.whatwg.org>
> Sent: Monday, March 03, 2008 11:40 PM
> Subject: Re: [whatwg] Usemap and ismap for canvas tag
>
>
> >> 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