UNPKG

jointjs

Version:

JavaScript diagramming library

35 lines (31 loc) 832 B
<p>An image 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>image</td> <td><i>SVGImageElement</i></td> <td>Image body of the shape</td> </tr> <tr> <td>label</td> <td><i>SVGTextElement</i></td> <td>Text below the image</td> </tr> </table> <pre><code>var image = new joint.shapes.standard.Image(); image.resize(150, 100); image.position(25, 410); image.attr('root/title', 'joint.shapes.standard.Image'); image.attr('label/text', 'Image'); image.attr('image/xlinkHref', 'image.png'); image.addTo(graph);</code></pre>