Import it from @grafloria/renderer.
tsinterface TextBlockOptions
Properties
| Name | Type | Default | Description |
|---|---|---|---|
text | string | The label text. Honors explicit '\n' as hard line breaks. | |
x | number | Anchor X in the local coordinate space of the returned | |
y | number | Anchor Y in the local coordinate space of the returned | |
maxWidth? | number | Wrap width. Omit / Infinity → no wrapping (one line unless '\n' present). | |
align? | 'start' | 'middle' | 'end' | Horizontal text anchor. Default 'middle'. | |
valign? | 'top' | 'middle' | 'bottom' | Vertical alignment of the whole block around y. Default 'middle'. | |
fontSize? | number | Font size in px used for BOTH measurement and (optionally) emission. | |
fontFamily? | string | ||
fontWeight? | number | string | Font weight, emitted only when defined. | |
color? | string | Fill color. Emitted only when defined (CSS-mode callers omit it). | |
className? | string | ||
clipId? | string | When set, apply clip-path: url(#clipId) so overflow is hard-clipped. | |
maxLines? | number | Max rendered lines; extra lines collapse into an ellipsis on the last. | |
lineHeight? | number | Line-height multiplier. Default 1.2. | |
emitFontSize? | boolean | Emit the numeric fontSize as an attribute. Default true (CSS mode: false). | |
nonInteractive? | boolean | Set pointer-events: none (node labels don't intercept the mouse). |
Was this page helpful?