canvas love

Posted by rhelmer on 18 Feb 2009 at 11:39 pm | Tagged as: mozilla, open web

I am reading about Bespin all over the place, with a lot of focus on SVG versus canvas, canvas not working in Internet Explorer, etc.

I don’t know Bespin’s plans in this area, but lots of projects which use canvas (such as flot) also test with and provide excanvas, which uses IE’s VML support to provide the basic canvas API. I have read that excanvas does not work in IE8′s standards mode, however it does work in quirks mode.

There seems to be lots of little explosions of creativity around the combination of faster Javascript interpreters and canvas, like these “3D in 2D” demos, Box2D physics (this works in IE8 thanks to excanvas).

I’ve been working on a project which does graphs and other data visualization in the browser. I ended up using jquery and flot although raphael (which uses SVG or VML, so supports IE) was in the running as well. Working with raphael is neat because everything you create is a DOM object so it’s a lot like working with HTML, but in the end flot just has many more out-of-the-box features like selection support, timescales, and so on. Not having IE support is not an option, and I’d rather not depend on Flash or other plugin if at all possible; I am quite pleased that there are a ton of reasonable ways to acheive this given those constraints.

I know this stuff is obvious to most of us around here, but I’m surprised that excanvas doesn’t come up more in these discussions. It is obviously not as ideal as having honest-to-goodness canvas or SVG support in all major browsers, but it’s a very creative way to drag IE along, putting a Javascript wrapper around their similar-but-different native feature.

One Response to “canvas love”

  1. on 19 Feb 2009 at 10:08 am rhelmer

    (sorry Alex, accidentally deleted your commented, but here is a response to what I suggest for line charts):

    I am using flot for line charts, and it works well, check out the examples.

Trackback This Post | Subscribe to the comments through RSS Feed

Leave a Reply