Skip to content

LabelLayer

Defined in: labels/label-layer.ts:47

An HTML overlay of absolutely-positioned label elements. On each update it maps reference anchors through the view transform to screen pixels, culls to the viewport with collision resolution, and reconciles the DOM (reusing nodes by id). Geometry stays on the GPU; only the surviving labels are in the DOM.

The container should be positioned (e.g. position: relative) and overlay the canvas; label nodes are position: absolute.

new LabelLayer(container, text): LabelLayer

Defined in: labels/label-layer.ts:50

HTMLElement

(anchor) => string

LabelLayer

destroy(): void

Defined in: labels/label-layer.ts:114

void


update(anchors, transform, viewport): void

Defined in: labels/label-layer.ts:55

readonly LabelAnchor[]

ViewTransform

number

number

void