jointjs
Version:
JavaScript diagramming library
35 lines (31 loc) • 878 B
HTML
<p>A polyline 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>SVGPolylineElement</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 polyline = new joint.shapes.standard.Polyline();
polyline.resize(100, 100);
polyline.position(450, 210);
polyline.attr('root/title', 'joint.shapes.standard.Polyline');
polyline.attr('label/text', 'Polyline');
polyline.attr('body/refPoints', '0,0 0,10 10,10 10,0');
polyline.addTo(graph);</code></pre>