Skip to content
D
Documentation

LinkLabel

reference
1 min readUpdated

Import it from @grafloria/engine.

ts
interface LinkLabel

Properties

NameTypeDefaultDescription
idstring
textstring
positionnumber
offsetPoint
style?LabelStyle
rotation?'auto' | number
rotationOffset?number
keepUpright?boolean
textAnchor?'start' | 'middle' | 'end'
textBaseline?'top' | 'middle' | 'bottom'
textWrap?boolean
maxWidth?number
autoOffset?booleanAuto-position this label so it does not overlap nodes, other labels or links. Handled by the diagram-wide edge optimizer: offset is the label's PREFERRED placement and the optimizer searches outward from it only when it collides.
segmentIndex?number
slot?LinkLabelSlotOne of the three edge slots. Shorthand for position; ignored when the label carries an explicit position (see LinkLabelSlot).
html?stringRender this label as ARBITRARY HTML inside a foreignObject instead of SVG text. The string is injected verbatim, so it is the author's job to keep it trusted/escaped — exactly like any innerHTML seam.
template?stringName of a label template registered with registerLabelTemplate (@grafloria/renderer). The template returns VNodes, so it can emit SVG or a foreignObject full of HTML. Wins over html.
width?numberWidth of the HTML/template label's box (px). Default 120.
height?numberHeight of the HTML/template label's box (px). Default 28.

Was this page helpful?

LinkLabel — Grafloria