The data object passed to each draw call.
OptionalalwaysWhen true, the layer is always drawn regardless of the visibility map. Useful for layers that must never be hidden (e.g. base grid).
OptionaldefaultWhether the layer is shown when no explicit visibility entry exists.
Defaults to true when absent.
Emit a DrawCommand tree for the GL backend to dispatch.
For world-space layers (the default), emit commands in WORLD COORDS —
drawLayers automatically wraps them in { kind: 'group', transform: viewToMat3(view), ... } before handing them to the renderer. Do NOT
apply the view transform yourself.
For screen-space layers (space: 'screen'), emit commands in CSS-pixel
coords directly; drawLayers passes them through unchanged. If part
of a screen-space layer's output needs to track the view, wrap that
subset manually with viewToMat3(view).
OptionalhitOptional hit-test for consumer-attached layers.
Only layers registered through CanvasExtensionApi.registerLayer are
hit-tested: hitTestExtras walks them last-registered-first on
pointerdown, and <SceneCanvas> folds the result into its affordanceAt
thunk ahead of the kit's own selection chrome. First non-null result
wins; null means "I don't claim this hit, try the next layer."
Layers that reach the draw stack some other way — a Tool.overlay, an
entry in the layers map — are painted but never hit-tested, so defining
hitTest on one has no effect. (The kit's own chrome doesn't need it: it
goes through buildAffordanceAt.)
Coordinates are world-space. The data arg is the layer's
configured data slot (same as draw); view and dims mirror
draw's arguments.
Unique identifier used in visibility maps and ordering arrays.
Human-readable name for UI toggles.
OptionalonCalled when the cursor leaves the canvas element. Lets layers clear any hover state they're holding.
OptionalonCalled on every pointermove when no gesture is currently captured. Lets layers (e.g. HUD widgets) track hover state without participating in the drag pipeline. Coords are world-space; the layer is responsible for any further conversion (e.g. world→screen for screen-space layers) and for its own throttling.
OptionalspaceCoordinate space the layer draws in.
'world' (default): the layer's draw returns world-space commands;
drawLayers wraps them in a kind: 'group' with viewToMat3(view)
automatically.'screen': the layer's draw returns screen-space (CSS-pixel)
commands; drawLayers passes them through unchanged. World-anchored
chrome inside a screen-space layer must call worldToScreen or wrap
the relevant subset with viewToMat3(view) manually.
A single named render sub-layer within a canvas renderer.