UNPKG

jointjs

Version:

JavaScript diagramming library

36 lines (32 loc) 844 B
<p>A path with a label.</p> <b>Supported <code>attrs</code> properties</b></p> <table> <tr> <th>Selector</th> <th>Node</th> <th>Description</th> </tr> <tr> <td>root</td> <td><i>SVGGElement</i></td> <td>Container of all nodes</td> </tr> <tr> <td>body</td> <td><i>SVGPathElement</i></td> <td>Generic body of the shape</td> </tr> <tr> <td>label</td> <td><i>SVGTextElement</i></td> <td>Text inside the body</td> </tr> </table> <pre><code>var path = new joint.shapes.standard.Path(); path.resize(100, 100); path.position(50, 210); path.attr('root/title', 'joint.shapes.standard.Path'); path.attr('label/text', 'Path'); path.attr('body/refD', 'M 0 5 10 0 C 20 0 20 20 10 20 L 0 15 Z'); path.addTo(graph); </code></pre>