TextBlock
A rectangle with an HTML label (with a fallback to SVG label for IE).
SVG selectors​
Supported attrs
properties:
Selector | Node | Description |
---|---|---|
root | SVGGElement | Container of all nodes |
body | SVGRectElement | Rectangular body of the shape |
label | HTMLDivElement | Text inside the body |
const textBlock = new shapes.standard.TextBlock();
textBlock.resize(100, 100);
textBlock.position(250, 610);
textBlock.attr('root/title', 'shapes.standard.TextBlock');
textBlock.attr('body/fill', 'lightgray');
textBlock.attr('label/text', 'Hyper Text Markup Language');
// Styling of the label via `style` presentation attribute (i.e. CSS).
textBlock.attr('label/style/color', 'red');