Skip to content

Interface: TextStyle ​

Experimental

Style shared by all labels (TextData.style) and overridable per label.

Extended by ​

Properties ​

PropertyTypeDescription
align?"center" | "left" | "right"Experimental Alignment of lines within a multi-line block. Default: follows anchorX.
anchorX?TextAnchorXExperimental Default left.
anchorY?TextAnchorYExperimental Default baseline.
angle?numberExperimental Rotation in degrees, Plotly textangle / tickangle convention: clockwise positive on screen, about the anchor point. Default 0.
color?RGBAExperimental sRGB 0–1 RGBA, straight alpha. Default opaque black.
font?Partial<TextFont>Experimental Merged field-by-field: { ...defaults, ...style.font, ...label.font }.
lineHeight?numberExperimental Line advance as a multiple of the font size. Default TEXT_DEFAULT_LINE_HEIGHT.
maxWidth?numberExperimental Max line width in px (font units). Default: unlimited.
offset?readonly [number, number]Experimental Screen-space offset from the anchor in px, [dx, dy] with +y down. Not rotated by angle.
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).
overflow?TextOverflowExperimental Default wrap. Only used when maxWidth is finite.

Released under the MIT License.