Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Clicks and hovers can be done on canvas, using hack that renders on second (invisible) canvas each object with its own, constant color and then checking color of the pixel at coordinates of cursor. It would probably need some kind of scene abstraction though.


Alternatively, just put some invisible DOM elements on top of the canvas and put your click handlers on those. It's imagemaps all over again ;)


This is how flot works. The base chart is drawn on canvas. All labels including axes, legends and mouseovers are DOM elements that are absolutely positioned over the canvas.

The canvas itself is always inside a canvascontainer div that also contains all the other dom elements.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: