Converts the collection to an HTML <canvas> element and returns the canvas. The canvas will be resized to fit its contents.

var canvas ={r:50}).toCanvas();



As above, but passes the collection containing the <canvas> element to the callback function when the image has been applied to the canvas. The callback’s this object will be the original collection.

toCanvas(callback, canvas)

As above, but will apply an image of the collection to an existing canvas element (or a collection containing the canvas).

Browser support

All modern browsers support HTML canvas. To confirm, check that === true.

if ({
    // create canvas
else {
    // fallback
Painting is just another way of keeping a diary.
Pablo Picasso