Skip to content

LabelBox

Defined in: labels/cull.ts:5

A label positioned in SCREEN pixels (after the view transform is applied).

[key: string]: unknown

Carried through untouched (e.g. text, datum).

optional height?: number

Defined in: labels/cull.ts:13


id: string | number

Defined in: labels/cull.ts:6


optional keepUpright?: boolean

Defined in: labels/cull.ts:28

Oriented labels only: flip 180° (and the text side) when the rotation would render the text upside down — the standard radial-tree readability flip.


optional priority?: number

Defined in: labels/cull.ts:15

Higher wins collisions; defaults to 0.


optional rotation?: number

Defined in: labels/cull.ts:23

Reading-direction angle in radians (CSS-clockwise, i.e. rotate(rotation·180/π deg)). Setting it switches the label to the ORIENTED model: text runs along the rotated axis, vertically centred on the anchor, and both the collision box and the rendered CSS transform are derived from it — so the two can never disagree. Leave undefined for a plain axis-aligned, top-left box (the caller then owns any CSS transform).


optional textAnchor?: TextAnchor

Defined in: labels/cull.ts:25

Oriented labels only: which way the text runs from the anchor. Defaults to “start”.


optional width?: number

Defined in: labels/cull.ts:12

Box size in pixels; used for collision. Defaults to a small box if omitted.


x: number

Defined in: labels/cull.ts:9

Screen-space anchor. For a plain label this is the box’s top-left; for an oriented label (see rotation) it is the rotation/transform origin the text radiates from.


y: number

Defined in: labels/cull.ts:10