Skip to content

Interface: TextLabel ​

Experimental

One label. Position is in DATA space (see DataTransform); JS numbers are float64.

Extends ​

Properties ​

PropertyTypeDescriptionInherited from
align?"center" | "left" | "right"Experimental Alignment of lines within a multi-line block. Default: follows anchorX.TextStyle.align
anchorX?TextAnchorXExperimental Default left.TextStyle.anchorX
anchorY?TextAnchorYExperimental Default baseline.TextStyle.anchorY
angle?numberExperimental Rotation in degrees, Plotly textangle / tickangle convention: clockwise positive on screen, about the anchor point. Default 0.TextStyle.angle
color?RGBAExperimental sRGB 0–1 RGBA, straight alpha. Default opaque black.TextStyle.color
font?Partial<TextFont>Experimental Merged field-by-field: { ...defaults, ...style.font, ...label.font }.TextStyle.font
lineHeight?numberExperimental Line advance as a multiple of the font size. Default TEXT_DEFAULT_LINE_HEIGHT.TextStyle.lineHeight
maxWidth?numberExperimental Max line width in px (font units). Default: unlimited.TextStyle.maxWidth
offset?readonly [number, number]Experimental Screen-space offset from the anchor in px, [dx, dy] with +y down. Not rotated by angle.TextStyle.offset
outline?TextOutline | nullExperimental Outline/halo/shadow; null disables an outline inherited from the shared style. An outline takes precedence over font.shadow, which otherwise becomes the outline pass (a CSS shadow is an outline of width 0 with blur and offset).TextStyle.outline
overflow?TextOverflowExperimental Default wrap. Only used when maxWidth is finite.TextStyle.overflow
runs?TextRunLinesExperimental Rich text (E2.10): lines of styled runs, drawn instead of text as one batch member per run (see text-runs.ts). Leave unset for plain text, which is drawn as one member (the fast path). Rich labels do not wrap or ellipsize (maxWidth is ignored), like Plotly's SVG text.-
textstringExperimental The text, or its plain-text equivalent when TextLabel.runs is set.-
xnumberExperimental-
ynumberExperimental-
z?numberExperimental Default 0.-

Released under the MIT License.