The pergola.shapes library object defines shape object properties. A shape object defines an SVG element and its geometrical attributes only. No paint attributes or style.

View as standalone SVG

A shape object definition:


You can use a shape by invoking the utility function pergola.use(), which simulates the SVG <use> element. Because only the geometry is defined for shapes, you have total control over stroke width/scaling. Some classes are enabled to process the instance property shape (use cases in the buttons example). Learn more in the SHAPES library section of the Tutorial.