5 ms·
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 o
by krcz 14y ago
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.
- derefr 14y agoAlternatively, just put some invisible DOM elements on top of the canvas and put your click handlers on those. It's imagemaps all over again ;)
- bluesmoon 14y agoThis 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.
- ant512 14y ago"some kind of scene abstraction": http://simianzombie.com/files/javascript/canvasui4.html http://simianzombie.com/files/javascript/canvasui4.html