Simple Shapes

Within Bonsai’s path module are a selection of shape classes. Note that these are globally exposed and inherit from the Path class.

var myShape = new Rect(10, 10, 100, 100);

myShape.stroke('#f00', 2);

For a more detailed overview and more details about the path module see the Paths Overview and the Path Module Documentation.