Skip to main content

Polygon

A polygon with a label.

SVG selectors

Supported attrs properties:

SelectorNodeDescription
rootSVGGElementContainer of all nodes
bodySVGPolygonElementPolygonal body of the shape
labelSVGTextElementText inside the body
const polygon = new shapes.standard.Polygon();
polygon.resize(100, 100);
polygon.position(250, 210);
polygon.attr('root/title', 'shapes.standard.Polygon');
polygon.attr('label/text', 'Polygon');
polygon.attr('body/refPoints', '0,10 10,0 20,10 10,20');

Stay in the know

Be where thousands of diagramming enthusiasts meet

Star us on GitHub