A polygon with a label.

Supported attrs properties

Selector Node Description
root SVGGElement Container of all nodes
body SVGPolygonElement Polygonal body of the shape
label SVGTextElement Text inside the body
var polygon = new joint.shapes.standard.Polygon();
polygon.resize(100, 100);
polygon.position(250, 210);
polygon.attr('root/title', 'joint.shapes.standard.Polygon');
polygon.attr('label/text', 'Polygon');
polygon.attr('body/refPoints', '0,10 10,0 20,10 10,20');
polygon.addTo(graph);