@searsuite/sear-render-node
Scene graph
SceneGraph is the root of the retained render tree. A plugin contributes one or more Node values under its
own key. addPluginNode() replaces that plugin's top-level nodes; reconcilePluginNodes() retains nodes with
stable keys and updates only what changed. GenerationalDirtyTracker records the regions that need repainting.
Use this layer when implementing a renderer or a visual plugin. Content and selection still come from their domain owners; scene nodes hold the geometry and paint behavior for a view.
- classSceneGraph
-
class SceneGraph<T> extends Node<T>Root scene tree that owns top-level render nodes for each plugin.
constructor SceneGraph<T>(container: Container): SceneGraph<T>Creates a scene graph bound to one editor-local DI runtime.
property readonly symbol: symbolstaticDI token for resolving the scene graph.
method addPluginNode(pluginKeyString: string, node: Node<T> | Node<T>[], options?: { markDirty?: boolean }): voidReplaces all scene nodes owned by one plugin.
pluginKeyStringStable plugin key.
nodeNode or nodes produced by the plugin render method.
method clear(context: RenderContext): voidSceneGraph is cleared through strategy-owned dirty regions.
method drawHit(context: RenderContext): voidSceneGraph is a root container and is not drawn into the hit layer directly.
method drawScene(context: RenderContext): voidSceneGraph is a root container and is not drawn directly.
method markRemovePluginNode(pluginKeyString: string, options?: { markDirty?: boolean }): voidMarks and removes all existing top-level nodes owned by one plugin.
pluginKeyStringStable plugin key.
method reconcilePluginNodes(pluginKeyString: string, node: Node<T> | Node<T>[], options?: { markDirty?: boolean; replaceRetainedGeometryChanged?: boolean; replaceRetainedKeys?: ReadonlySet<string>; retainExisting?: boolean; updateRetainedGeometry?: boolean }): voidReconciles one plugin's top-level nodes by stable node key.
Existing nodes with keys that are still present can be retained, new keys are inserted, and keys no longer returned by the plugin are removed. This is the block-level retained path used by virtualized document rendering.
Inherited members 40
Inherited from Node.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- dispose
- draw
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classNode
-
class Node<T> extends EventListener<string>Abstract base class for all nodes in the render tree. Handles geometry, appearance, event management, and hierarchical relationships.
constructor Node<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): Node<T>Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.
propsPartial properties and position for initialization.
property readonly childKeys: string[]Keys of direct child nodes registered via add(), used for recursive cleanup.
property depth: numberRender and event ordering depth for Node.
property name: stringName of the node, defaults to the class name.
property readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
property parentKey: string | nullParent node's stable render key, used for tree relationships.
property readonly positionRect: PositionRect<string>Rectangle representing the node's position and size.
property properties: Partial<T>Visual and geometric properties of the node.
property readonly randomColorKey: templateLiteral | nullUnique random color key used for hit detection.
property sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottom bottom: unknownmemberconfigEngine configEngine: unknownmemberfill fill: unknownmemberheight height: unknownmemberhorizontalAlign horizontalAlign: unknownmemberleft left: unknownmemberlineDash lineDash: unknownmemberright right: unknownmemberstroke stroke: unknownmemberstrokeWidth strokeWidth: unknownmembertop top: unknownmemberverticalAlign verticalAlign: unknownmemberwidth width: unknownmemberx x: unknownmembery y: unknownmethodadd add(child: Node<T>): Node<T>add(children: Node<T>[]): Node<T>Implements the single-node and multiple-node add overloads.
ReturnsThe current node (for chaining).
childThe child node to add.
method addEventListener(type: string, handler: Function): voidAdds an event listener for the specified event type.
typeThe event type to listen for.
handlerThe function to handle the event.
method bindRuntime(container: Container): voidBinds this node tree to the editor-local services owned by one SceneGraph.
method clear(context: RenderContext): voidClears state owned by Node.
method dispose(): voidDisposes this node and all of its descendants recursively. Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.
method draw(sceneContext: RenderContext, hitContext: RenderContext): voidDraws the node in both the scene and hit detection contexts.
sceneContextThe context for scene rendering.
hitContextThe context for hit detection rendering.
method drawHit(context: RenderContext): voidAbstract method to draw the node's hit detection representation. Must be implemented by subclasses.
contextThe rendering context.
method drawScene(context: RenderContext, clipRegion?: ClipRegion): voidAbstract method to draw the node's scene representation. Must be implemented by subclasses.
contextThe rendering context.
clipRegionOptional clipping region: a
PositionRectfor axis-aligned rectangular clip, or aPoint[]polygon (array of[x, y]vertices) for arbitrary shape clip.
method getNodeByNodeKey(key: string): Node<T> | nullFinds a node by its stable render-node key.
ReturnsThe node if found, otherwise null.
keyThe stable render node key.
method getNodeByRandomColorKey(key: templateLiteral): Node<T> | nullFinds a node by its random color key.
ReturnsThe node if found, otherwise null.
keyThe random color key to search for.
method query(range: PositionRect<templateLiteral>): Node<T>[]Queries all nodes within a given rectangular range.
ReturnsAn array of nodes found within the range.
rangeThe rectangle to query.
method removeChild(child: Node<T>): voidRemoves a child node from this node and disposes its entire subtree.
method removeEventListener(type: string): voidRemoves an event listener for the specified event type.
typeThe event type to remove.
method setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
method toJSON(): { }Converts the node and its properties to a JSON object. Can be extended to recursively serialize children.
- classRenderNode
-
class RenderNode<T> extends Node<T>Abstract class for render nodes. Extend this for nodes that manage rendering.
constructor RenderNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): RenderNode<T>Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.
propsPartial properties and position for initialization.
Inherited members 43
Inherited from Node.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- drawScene
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classBlockManager
-
class BlockManager extends RichTextBlockLayoutProviderMeasures rich-document blocks and produces wrapped rich-text layout lines.
constructor BlockManager(textShaper: TextShaper, inlineStyleRegistry: RichTextInlineStyleRegistry, runRenderRegistry: RichTextRunRenderRegistry, lineBoxRegistry: RichTextLineBoxRegistry, baseFont?: string, paragraphLayoutDefaults?: RichTextParagraphLayoutDefaults): BlockManagerCreates a block manager from the text-shaping and rich-text services.
property maxWidth: numberMaximum measured unwrapped block width.
property readonly symbol: typeof symbolstaticDI token for resolving the rich-document block manager.
method add(node: RichDocNode): voidAdds a rich document block and records its measured size.
method calculateLayout(width: number): RichTextLine[]Calculates a flattened list of wrapped rich-text lines for all blocks.
method calculateLayoutPerParagraph(width: number): RichTextLine[][]Calculates wrapped rich-text lines per paragraph while preserving paragraph mapping.
method clear(): voidClears all measured blocks and cached size information.
method createDetached(): BlockManagerCreates an unshared measurement workspace for a read-only layout request.
method enforceCommandBoundary(isCommandExecuting: (): boolean): voidCloses direct block writes after the owning editor has assembled.
method setBaseFont(font: string): voidSelects the transient base font used for the next layout pass.
- classContainer
-
class Container extends EventListener<string>Scene node that owns, queries, and serializes an ordered child collection.
constructor Container(): Containerproperty readonly randomColorKey: templateLiteral | nullUnique random color key for hit detection.
memberchildren children: unknownmethodadd add(child: Container): thisadd(children: Container[]): thisAdds the value.
method descendants(): never[]Iterates every descendant in scene order.
method query(): voidReturns descendants whose boundaries intersect the supplied rectangle.
method remove(): voidRemoves the value.
method toJSON(): { }Serializes this scene structure into diagnostic JSON.
method updateBoundary(): voidUpdates the indexed boundary after geometry changes.
- classDirtyTree
-
DI token placeholder for the dirty-region spatial index.
constructor DirtyTree(): DirtyTreeproperty readonly symbol: symbolstaticDI token used to resolve the dirty tree implementation.
- classGenerationalDirtyTracker
-
Frame-scoped dirty-region tracker.
A scene mutation may replace several plugins before the render pass starts. Every affected region must therefore remain recorded until DirtyRenderStrategy has consumed the frame. In particular, node replacement must never clear regions recorded by an earlier replacement in that frame.
The class name is retained for DI/API compatibility; its behaviour is no longer generation-based.
constructor GenerationalDirtyTracker(tree: Tree<PositionRect<templateLiteral>>): GenerationalDirtyTrackerproperty readonly symbol: symbolstaticDI token for resolving GenerationalDirtyTracker.
method clear(): voidFrame-end full cleanup (called by DirtyRenderStrategy.render()). All items are removed regardless of generation.
method getBoundary(): PositionRect<templateLiteral>Returns the boundary.
method mark(rect: PositionRect<templateLiteral>): voidRecords a region until the current dirty render pass finishes.
method query(range: PositionRect<templateLiteral>): PositionRect<templateLiteral>[]Returns dirty nodes for the requested render generation.
- classLayoutNode
-
class LayoutNode<T> extends Node<T>Abstract class for layout nodes. Extend this for nodes that manage layout.
constructor LayoutNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): LayoutNode<T>Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.
propsPartial properties and position for initialization.
Inherited members 43
Inherited from Node.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- drawScene
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classTree
-
class Tree<T>Shared spatial-index contract. The item shape is owned by each index.
constructor Tree<T>(boundary: PositionRect<templateLiteral>, capacity: number): Tree<T>property readonly capacity: numberThe maximum number of entries retained by this spatial node.
property parent: Tree<T> | nullThe parent spatial node, or null at the root.
property readonly symbol: symbolstaticDI token for resolving Tree.
method clear(): voidClears state owned by Tree.
method getBoundary(): PositionRect<templateLiteral>Returns the boundary.
method insert(item: T): booleanInserts a bounded entry into the spatial index.
method query(range: PositionRect<templateLiteral>): T[]Returns indexed entries whose boundaries intersect the supplied rectangle.
method remove(item: T, predicate?: (rect: PositionRect<templateLiteral>): boolean): booleanRemoves the value.
method toJSON(): objectSerializes this scene structure into diagnostic JSON.
method updateBoundary(boundary: PositionRect<templateLiteral>): voidUpdates the indexed boundary after geometry changes.
- typeNodeProperties
-
type NodeProperties = unknownproperty bottom?: numberproperty contentInsetStart?: numberSpace reserved before projected text for a cell visual.
property cornerRadius?: [number, number, number, number]property depth?: numberproperty fill?: stringproperty fitNumberValue?: numberRaw General-format number fitted against the actual render width.
property hideText?: booleanSuppresses projected text while preserving its underlying value.
property horizontalAlign?: SheetHorizontalAlignmentproperty isEdit?: booleanproperty left?: numberproperty lineDash?: number[]property nodeKey?: RenderNodeKeyStable render-node key.
When omitted, Node falls back to its generated hit color key for backwards compatibility. Semantic render nodes should provide stable ids such as block ids here instead of using hit colors as identity.
property overlayClipRect?: PositionRectPropsOptional world-coordinate clip applied by OverlayRenderStrategy. Overlay nodes normally render above sticky UI; this lets a visual stay within a host-defined content region instead (for example, a sheet selection must not draw over row/column headers).
property right?: numberproperty semanticOwner?: stringStable semantic ownership exposed by retained render targets.
property semanticRole?: stringStable semantic role exposed by retained render targets.
property shouldBeClipInDirtyRender?: booleanBusiness marker: true when selection represents a whole row or whole column range. Dirty render may use this to choose a different redraw shape.
property skipHit?: booleanVisual-only nodes do not participate in hit canvas.
Background:
FixBoxNode.drawHitfills the entire rect with random color for Hit Canvas lookup. But once visual-only nodes (such as selection strokes and header highlight backgrounds) enter the Hit Canvas, they can cover underlying cell hit colors and block click-through. SettingskipHit: truein properties makesdrawHitskip directly.property stroke?: stringproperty strokeWidth?: numberproperty textColor?: stringForeground color used by text-rendering nodes.
property textFillCharacter?: stringCharacter repeated to fill the remaining inline width of formatted text.
property textOverflowWidth?: numberMaximum width available to single-line text across adjacent empty cells.
property top?: numberproperty verticalAlign?: SheetVerticalAlignment - typeRenderNodeKey
-
type RenderNodeKey = stringStable key used by SceneGraph, Tree and DataStorage to identify render nodes.
Shape nodes
- classAffixNode
-
class AffixNode<T> extends FixBoxNode<T>Sticky box node used for row/column headers and other affixed sheet regions.
constructor AffixNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): AffixNode<T>Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.
propsPartial properties and position for initialization.
property sticky: booleanAffix nodes render in the sticky strategy instead of the scrolled content layer.
Inherited members 42
Inherited from FixBoxNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- drawScene
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classAffixTextNode
-
class AffixTextNode<T> extends TextNode<T>Sticky text node used inside affixed header cells.
constructor AffixTextNode<T>(value: string | RichDocNode, positionRect: PositionRectProps | undefined, properties: Partial<T>, runtime?: Container): AffixTextNode<T>Constructs a text node and measures its width against the active render context.
valueText or rich-text value to render.
positionRectInitial node bounds.
propertiesRender properties inherited from the parent cell.
property sticky: booleanAffix text renders in the sticky strategy together with its parent.
Inherited members 43
Inherited from TextNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- value
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- drawScene
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classBoxNode
-
class BoxNode<T> extends LayoutNode<T>The BoxNode class represents a block-level node in a scene graph. It behaves similarly to an HTML element with
position: relative, where its position is determined relative to its parent or siblings.constructor BoxNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): BoxNode<T>Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.
propsPartial properties and position for initialization.
method clear(context: RenderContext): voidClears state owned by BoxNode.
method drawHit(context: RenderContext): voidDraws the hit area for this node and all its descendants. This is typically used for hit testing (e.g., detecting mouse clicks).
contextThe rendering context used to draw the hit area.
method drawScene(context: RenderContext): voidDraws the scene for this node and all its descendants. This method recursively calls
drawSceneon all child nodes.contextThe rendering context used to draw the scene.
Inherited members 40
Inherited from LayoutNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- dispose
- draw
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classDashedLineNode
-
class DashedLineNode<T> extends RenderNode<T>Scene node that renders one dashed line segment.
constructor DashedLineNode<T>(positionRect: PositionRectProps, props: Partial<T>, line: { x1: number; x2: number; y1: number; y2: number }): DashedLineNode<T>Constructs a dashed line node.
positionRectDirty/hit bounds covering the line.
propsRender properties including stroke and dash pattern.
lineExact line segment coordinates.
method clear(context: RenderContext): voidClears the line bounds with stroke padding.
contextRender context to clear.
method drawHit(): voidDashed lines are visual-only and do not participate in hit testing.
method drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws the dashed line into the render context.
contextRender context receiving draw commands.
Inherited members 40
Inherited from RenderNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- dispose
- draw
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classFixBoxNode
-
class FixBoxNode<T> extends RenderNode<T>Scene node that renders a rectangular box with optional fill, stroke, and clipping.
constructor FixBoxNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): FixBoxNode<T>Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.
propsPartial properties and position for initialization.
method clear(context: RenderContext): voidClears this node's bounds from a raster context using stroke padding.
contextRender context to clear.
method drawHit(context: RenderContext): voidDraws the node into the hit-test context unless the node is visual-only.
contextHit render context.
method drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws the box into the visible render context.
contextRender context receiving draw commands.
clipRegionOptional rectangle or polygon clipping region.
Inherited members 40
Inherited from RenderNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- dispose
- draw
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classStickyNode
-
class StickyNode<T> extends BoxNode<T>Box node specialization reserved for sticky-layer rendering.
constructor StickyNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): StickyNode<T>Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.
propsPartial properties and position for initialization.
Inherited members 43
Inherited from BoxNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- drawScene
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classTextNode
-
class TextNode<T> extends RenderNode<T>Scene node that renders plain text derived from string or rich-text content.
constructor TextNode<T>(value: string | RichDocNode, positionRect: PositionRectProps | undefined, properties: Partial<T>, runtime?: Container): TextNode<T>Constructs a text node and measures its width against the active render context.
valueText or rich-text value to render.
positionRectInitial node bounds.
propertiesRender properties inherited from the parent cell.
property depth: numberText draws above the box background by default.
property readonly value: string | RichDocNodeText value rendered by this node.
memberwidth width: unknownmethod clear(context: RenderContext): voidText nodes are cleared through their parent box dirty region.
method drawHit(context: RenderContext): voidText nodes do not draw separate hit regions; the parent box owns hit testing.
method drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws text inside the parent node using the parent's alignment and padding.
contextRender context receiving text commands.
clipRegionOptional clipping region inherited from render strategies.
Inherited members 38
Inherited from RenderNode.
- childKeys
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- x
- y
- add
- addEventListener
- bindRuntime
- dispose
- draw
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- typeClipRegion
-
type ClipRegion = PositionRect<HexColor> | Point[]Clip region passed to
drawScene.PositionRect<HexColor>— axis-aligned rectangle clip (common case).Point[]— arbitrary polygon clip; each element is an[x, y]vertex.
- functioncreateDragGuideNode
-
createDragGuideNode<T>(line: { x1: number; x2: number; y1: number; y2: number }, properties: Partial<T>): DashedLineNode<T>Creates a shared visual-only overlay guide for move and resize gestures.
- classViewportOverlayNode
-
class ViewportOverlayNode extends RichTextVisualNodeViewport overlay node that draws transient UI under an identity transform.
constructor ViewportOverlayNode(input: { depth?: number; drawOverlay: (context: RenderContext): void; nodeKey: string; rect: PositionRectProps; role?: "selection" | "caret" }): ViewportOverlayNodeCreates a viewport overlay render node.
method drawScene(context: RenderContext): voidDraws overlay content; the node owns transform isolation for viewport-space plugins.
Inherited members 42
Inherited from RichTextVisualNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
Cell visuals
- classCellVisualLayerNode
-
class CellVisualLayerNode<T> extends RenderNode<T>Draws a feature-contributed visual between a cell background and its content.
constructor CellVisualLayerNode<T>(rect: PositionRectProps, properties: Partial<T>, layer: CellVisualLayer): CellVisualLayerNode<T>method clear(context: RenderContext): voidClears state owned by Node.
method drawHit(): voidAbstract method to draw the node's hit detection representation. Must be implemented by subclasses.
method drawScene(context: RenderContext): voidAbstract method to draw the node's scene representation. Must be implemented by subclasses.
contextThe rendering context.
Inherited members 40
Inherited from RenderNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- dispose
- draw
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- interfaceCellVisualLabel
-
One text label drawn within a feature-contributed visual layer.
- interfaceCellVisualLayer
-
A visual rectangle, icon or sequence of labels within its cell bounds.
property readonly fill?: string | { end: string; start: string }property readonly height: numberproperty readonly icon?: { color: string; level?: number; shape: CellVisualIconShape; totalLevels?: number }property readonly labels?: readonly CellVisualLabel[]Ordered labels, clipped to the layer bounds without changing the cell value.
property readonly shape?: CellVisualLayerShapeproperty readonly slot: stringproperty readonly width: numberproperty readonly x: numberproperty readonly y: number - typeCellVisualIconShape
-
type CellVisualIconShape = typeof CellVisualIconShape[keyof typeof CellVisualIconShape]CellVisualIconShape: { Bar: "bar"; Check: "check"; Circle: "circle"; Cross: "cross"; Diamond: "diamond"; Down: "down"; Flag: "flag"; Right: "right"; … } - typeCellVisualLayerShape
-
type CellVisualLayerShape = typeof CellVisualLayerShape[keyof typeof CellVisualLayerShape]CellVisualLayerShape: { Rectangle: "rectangle"; TopLeftTriangle: "topLeftTriangle" }Primitive shapes available to feature-contributed cell layers.
Rich text rendering
Rich text uses block, line, run, caret, and selection nodes. RichTextRunRenderRegistry lets a feature provide
paint behavior for a run without changing the shared tree. HitColorRegistry and the spatial indexes support
finding nodes from pointer coordinates. Start with SceneGraph for ownership, then choose the node type that
represents the visual element you need to paint or hit test.
- classRichTextCaretNode
-
class RichTextCaretNode extends RichTextVisualNodeScene node that draws a rich-text caret.
constructor RichTextCaretNode(input: { caret: { height: number; pixelOffset?: number; visible: boolean; x: number; y: number }; depth?: number; nodeKey: string; rect: PositionRectProps; scroll?: { x: number; y: number }; viewportOverlay?: boolean }): RichTextCaretNodeCreates a caret overlay node.
method drawScene(context: RenderContext): voidDraws the caret when the blink state says it is visible.
Inherited members 42
Inherited from RichTextVisualNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classRichTextCompositionNode
-
class RichTextCompositionNode extends RichTextVisualNodeScene node that draws active IME composing text and underline.
constructor RichTextCompositionNode(input: { anchor: { height: number; x: number; y: number }; depth?: number; nodeKey: string; rect: PositionRectProps; scroll?: { x: number; y: number }; text: string; viewportOverlay?: boolean }): RichTextCompositionNodeCreates an IME composition overlay node.
method drawScene(context: RenderContext): voidDraws composing text in world or viewport coordinates.
Inherited members 42
Inherited from RichTextVisualNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classRichTextContentNode
-
class RichTextContentNode extends RichTextVisualNodeScene node that draws laid-out rich-text lines in world coordinates.
constructor RichTextContentNode(input: { blockIndexes?: readonly number[]; depth?: number; font?: string; lineRenderer: RichTextLineRenderer; lines: readonly RichTextRenderLine[]; nodeKey: string; origin: Pick<PositionRectProps, "x" | "y">; rect: PositionRectProps }): RichTextContentNodeCreates a rich-text content node from pre-computed layout lines.
method drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws every included layout line inside this node's clip.
Inherited members 42
Inherited from RichTextVisualNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classRichTextLineRenderer
-
Paints laid-out rich-text lines by grouping adjacent characters into runs.
constructor RichTextLineRenderer(inlineStyles: RichTextInlineStyleRegistry, runRenderer: RichTextRunRenderer): RichTextLineRendererCreates a line renderer with domain style comparison and run rendering.
property readonly symbol: typeof symbolstaticDI token for resolving the line renderer.
method paint(context: RenderContext, input: { font?: string; line: RichTextRenderLine; origin: Pick<PositionRectProps, "x" | "y"> }): voidPaints one laid-out line at the supplied world-space origin.
- classRichTextRunRenderer
-
Paints one contiguous rich-text run using the registered render contributions.
constructor RichTextRunRenderer(registry: RichTextRunRenderRegistry): RichTextRunRendererCreates a run renderer backed by the render contribution registry.
property readonly symbol: typeof symbolstaticDI token for resolving the run renderer.
method paint(context: RenderContext, input: { baselineY: number; font: string; fontAscent: number; fontDescent: number; height: number; style: Readonly<Record<string, unknown>> | undefined; text: string; width: number; … }): voidPaints one run and restores all renderer state changed by its style plugins.
- classRichTextRunRenderRegistry
-
Render-layer registry for plugin-owned rich-text run behavior.
constructor RichTextRunRenderRegistry(): RichTextRunRenderRegistryproperty readonly symbol: typeof symbolstaticDI token for resolving the rich-text run render registry.
method applyRenderState(context: RenderContext, style: Readonly<Record<string, unknown>> | undefined): voidApplies all registered render-state contributions before text painting.
method enforceWriteBoundary(assertWrite: (): void): voidmethod paintRun(input: RichTextRunPaintInput): voidPaints all registered plugin-owned run details.
method register(contribution: RichTextRunRenderContribution): (): voidRegisters one render contribution.
method resolveFont(font: string, style: Readonly<Record<string, unknown>> | undefined): stringResolves the final font descriptor after all registered contributions run.
- classRichTextSelectionNode
-
class RichTextSelectionNode extends RichTextVisualNodeScene node that draws rich-text selection rectangles.
constructor RichTextSelectionNode(input: { depth?: number; nodeKey: string; offset?: { x: number; y: number }; rect: PositionRectProps; rects: readonly RichTextSelectionRect[]; viewportOverlay?: boolean }): RichTextSelectionNodeCreates a selection overlay node.
method drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws selection rectangles in world or viewport coordinates.
method getSelectionRects(): readonly RichTextSelectionRect[]World-space regions where text should be painted above the highlight.
Inherited members 42
Inherited from RichTextVisualNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- classRichTextVisualNode
-
class RichTextVisualNode extends Node<RichTextRenderNodeProperties>Base class for rich-text nodes that only draw pixels and do not own hit state.
method clear(_context: RenderContext): voidRich-text visual node pixels are cleared by strategy-owned dirty rectangles.
method drawHit(_context: RenderContext): voidRich-text visual nodes are ignored by hit testing unless a subclass opts in.
Inherited members 41
Inherited from Node.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- dispose
- draw
- drawScene
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- interfaceRichTextRenderChar
-
Minimal rich-text character shape consumed by render nodes.
property readonly char: stringproperty readonly style?: Readonly<Record<string, unknown>>property readonly width: number - interfaceRichTextRunPaintInput
-
Geometry and render state for one contiguous rich-text run.
property readonly baselineY: numberproperty readonly context: RenderContextproperty readonly fontAscent: numberproperty readonly fontDescent: numberproperty readonly height: numberproperty readonly style: Readonly<Record<string, unknown>> | undefinedproperty readonly text: stringproperty readonly width: numberproperty readonly x: number - interfaceRichTextRunRenderContribution
-
Plugin-owned render behavior for one inline text-style concern.
property readonly key: stringStable contribution key used for duplicate detection and unregister.
method applyRenderState(input: { context: RenderContext; style: Readonly<Record<string, unknown>> | undefined }): voidApplies renderer state before the text run is painted.
method paintRun(input: RichTextRunPaintInput): voidPaints plugin-owned details for an already painted text run.
method resolveFont(input: { font: string; style: Readonly<Record<string, unknown>> | undefined }): stringResolves the font used by shaping and painting for a styled run.
- interfaceRichTextSelectionRect
-
Rectangle highlighted as part of a rich-text selection.
property readonly height: numberproperty readonly width: numberproperty readonly x: numberproperty readonly y: number - interfaceRichTextVisualNodeInput
-
Shared construction options for visual-only rich-text render nodes.
property readonly blockId?: stringproperty readonly blockIndex?: numberproperty readonly depth: numberproperty readonly isEdit?: booleanproperty readonly nodeKey: stringproperty readonly rect: PositionRectPropsproperty readonly renderRole: NonNullable<"block" | "line" | "page" | "text-run" | "selection" | "caret" | "composition" | undefined>property readonly semanticRole: string - typeRichTextBlockId
-
type RichTextBlockId = stringStable rich-text block identifier.
- functioncreateRichTextRunRect
-
createRichTextRunRect(x: number, baselineY: number, width: number, height: number, fontAscent: number): PositionRect<templateLiteral>Creates a world-space rectangle for one rich-text line/run.
- classRichTextBlockNode
-
class RichTextBlockNode extends RichTextVisualNodeScene node that indexes and draws one top-level rich-text block.
constructor RichTextBlockNode(input: { block: { id: string; index: number }; font: string; lineRenderer: RichTextLineRenderer; lines: readonly RichTextRenderLine[]; origin?: Pick<PositionRectProps, "x" | "y">; rect: PositionRectProps }): RichTextBlockNodeCreates a block-level rich-text scene node.
method drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws all visible text runs inside this block.
Inherited members 42
Inherited from RichTextVisualNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
- typeRichTextInlineStyle
-
type RichTextInlineStyle = Readonly<Record<string, unknown>>Domain-neutral inline style bag carried by measured rich-text chars.
- interfaceRichTextRenderLine
-
Minimal layout-line shape consumed by rich-text render nodes.
property readonly chars: readonly RichTextRenderChar[]property readonly charStartOffset: numberproperty readonly cursorXOffsets?: readonly number[]property readonly fontAscent: numberproperty readonly height: numberproperty readonly textNodePath: readonly number[]property readonly x: numberproperty readonly y: number - interfaceRichTextRenderNodeProperties
-
interface RichTextRenderNodeProperties extends NodePropertiesRender-node properties used by rich-text scene graphs.
property readonly blockId?: stringStable top-level rich-text block id.
property readonly blockIndex?: numberTop-level rich-text block index.
property readonly lineIndex?: numberLayout line index inside the full rich-text snapshot.
property readonly renderRole?: "block" | "line" | "page" | "text-run" | "selection" | "caret" | "composition"Semantic role for rich-text render nodes.
Inherited members 25
Inherited from NodeProperties.
- classRichTextRunNode
-
class RichTextRunNode extends RichTextVisualNodeScene node that draws one contiguous styled rich-text run in world coordinates.
constructor RichTextRunNode(input: { baselineY: number; font: string; fontAscent: number; fontDescent: number; properties: Partial<RichTextRenderNodeProperties>; rect: PositionRectProps; runRenderer: RichTextRunRenderer; style?: Readonly<Record<string, unknown>>; … }): RichTextRunNodeCreates a text-run scene node.
method drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws the text run into the active world-space transform.
Inherited members 42
Inherited from RichTextVisualNode.
- childKeys
- depth
- name
- nodeKey
- parentKey
- positionRect
- properties
- randomColorKey
- sticky
- bottom
- configEngine
- fill
- height
- horizontalAlign
- left
- lineDash
- right
- stroke
- strokeWidth
- top
- verticalAlign
- width
- x
- y
- add
- addEventListener
- bindRuntime
- clear
- dispose
- draw
- drawHit
- emit
- enforceWriteBoundary
- getNodeByNodeKey
- getNodeByRandomColorKey
- off
- on
- query
- removeChild
- removeEventListener
- setStickyTree
- toJSON
Hit testing and spatial indexes
Spatial indexes narrow the nodes considered for hit testing; hit colors connect painted regions back to nodes.
- classBVH
-
class BVH<T> extends Tree<T>Simple bounding-volume hierarchy spatial index implementation.
constructor BVH<T>(): BVH<T>Constructs a BVH with a broad default world boundary.
method clear(): voidRemoves all indexed items.
method getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
method insert(data: T): booleanInserts one item into the root child list.
method query(range: PositionRect<templateLiteral>): T[]Returns items whose rectangles intersect the query range.
method remove(data: T): booleanRemoves one item by object identity.
method toJSON(): objectSerializes debug data for this spatial index.
method updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the tree boundary and clears indexed items.
- classEventListener
-
class EventListener<CustomEventTypes>Represents an event listener system that allows adding, removing, and managing event handlers. Supports default event types and allows extension with custom event types.
constructor EventListener<CustomEventTypes>(): EventListener<CustomEventTypes>method emit(eventString: CustomEventTypes, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control: If any handler synchronously returns
false, dispatch to subsequent handlers stops. Returningtrue/undefined/voidmeans dispatch continues.This enables ordered plugin suppression for the same event (for example, a cell editor can block a selection plugin on
dblClick) without direct plugin-to-plugin state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventStringThe name of the event to trigger.
argsArguments to pass to the event handlers.
method enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
method off(eventString?: CustomEventTypes, handler?: Function): voidRemoves event handlers for a specific event or all events.
eventStringThe name of the event to remove handlers for. If not provided, all event handlers are removed.
method on(eventString: CustomEventTypes, handler: Function): EventListener<CustomEventTypes>Registers an event handler for a specific event.
ReturnsThe current instance to allow method chaining.
eventStringThe name of the event to listen for.
handlerThe function to be called when the event is triggered.
- classHilbertRTree
-
class HilbertRTree<T> extends Tree<T>Hilbert-sorted R-tree style spatial index for rectangular data.
constructor HilbertRTree<T>(boundary: PositionRect<templateLiteral>, maxChildren?: number): HilbertRTree<T>Constructs a Hilbert R-tree.
boundaryRoot spatial boundary.
maxChildrenMaximum children retained by the shared tree contract.
method clear(): voidRemoves all indexed items.
method getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
method insert(data: T): booleanInserts one item and maintains Hilbert ordering.
method query(range: PositionRect<templateLiteral>): T[]Returns items whose rectangles intersect the query range.
method remove(data: T): booleanRemoves an item by matching rectangle bounds.
method toJSON(): objectSerializes debug data for this spatial index.
method updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the boundary and clears indexed items.
- classHitColorRegistry
-
Maps hit-canvas color keys back to render nodes.
constructor HitColorRegistry(): HitColorRegistryproperty readonly symbol: symbolstaticDI token for resolving the hit-color registry.
method clear(): voidClears all registered hit-color mappings.
method delete(key: templateLiteral): voidRemoves a hit-canvas color key mapping.
method get<T>(key: templateLiteral): Node<T> | undefinedResolves the node currently associated with a hit-canvas color key.
method register<T>(key: templateLiteral, node: Node<T>): voidRegisters a node for hit-canvas color lookup.
- classKDTree
-
class KDTree<T> extends Tree<T>KD-tree spatial index for rectangular scene data.
constructor KDTree<T>(boundary?: PositionRect<templateLiteral>, capacity?: number): KDTree<T>Constructs a KD-tree.
boundaryRoot spatial boundary.
capacityRetained for the shared Tree contract.
method clear(): voidRemoves all indexed items.
method getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
method insert(data: T): booleanInserts an item by alternating x/y split axes.
method query(range: PositionRect<templateLiteral>): T[]Returns items whose rectangles intersect the query range.
method remove(data: T): booleanRemoves one item by object identity and rebuilds the experimental tree.
method toJSON(): objectSerializes debug data for this spatial index.
method updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the boundary and clears indexed items.
- classOctree
-
class Octree<T> extends Tree<T>Simple Octree-shaped spatial index for rectangular scene data.
constructor Octree<T>(): Octree<T>Constructs an Octree with a broad default world boundary.
method clear(): voidRemoves all indexed items.
method getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
method insert(data: T): booleanInserts one item into the root child list.
method query(range: PositionRect<templateLiteral>): T[]Returns items whose rectangles intersect the query range.
method remove(data: T): booleanRemoves one item by object identity.
method toJSON(): objectSerializes debug data for this spatial index.
method updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the boundary and clears indexed items.
- classQuadTree
-
class QuadTree extends Tree<PositionRect<HexColor>>QuadTree spatial index used by scene and dirty-region lookups.
constructor QuadTree(boundary: PositionRect<templateLiteral>, capacity: number): QuadTreeConstructs a QuadTree node.
boundaryNode boundary.
capacityMaximum items before subdivision.
property bottomleft: QuadTree | nullBottom-left child node.
property bottomright: QuadTree | nullBottom-right child node.
property divided: booleanWhether this node has been subdivided into children.
property rects: PositionRect<templateLiteral>[]Rectangles stored directly in this node.
property topleft: QuadTree | nullTop-left child node.
property topright: QuadTree | nullTop-right child node.
method clear(): voidClears all indexed rectangles and child quadrants.
method contains(boundary: PositionRect<templateLiteral>, rect: PositionRect<templateLiteral>): booleanReturns whether boundary fully contains rect.
method getBoundary(): PositionRect<templateLiteral>Returns the root boundary for this tree node.
method insert(data: PositionRect<templateLiteral>): booleanInserts a rectangle into the tree.
ReturnsTrue when data intersects this tree boundary.
dataRectangle to index.
method intersects(a: PositionRect<templateLiteral>, b: PositionRect<templateLiteral>): booleanReturns whether two rectangles overlap.
method query(range: PositionRect<templateLiteral>, found?: PositionRect<templateLiteral>[]): PositionRect<templateLiteral>[]Queries rectangles intersecting a range.
ReturnsMatching rectangles.
rangeSearch rectangle.
foundAccumulator used during recursion.
method remove(data: PositionRect<templateLiteral>, predicate?: (rect: PositionRect<templateLiteral>): boolean): booleanRemoves matching rectangle entries.
ReturnsTrue when an entry was removed.
dataRectangle coordinates to remove.
predicateOptional predicate for entries with matching bounds.
method subdivide(): voidSplits this node into four child quadrants and redistributes contained items.
method toJSON(): objectSerializes debug data for this tree.
method updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the boundary and reinserts existing rectangles.
boundaryNew root boundary.
- classQuadTreeFactory
-
class QuadTreeFactory<T> extends TreeFactory<PositionRect<HexColor>>Factory that creates QuadTree spatial indexes for rectangular scene data.
constructor QuadTreeFactory<T>(): QuadTreeFactory<T>method create(boundary: PositionRect<templateLiteral>, capacity: number): QuadTreeCreates a QuadTree.
boundaryRoot spatial boundary.
capacityMaximum items in a leaf before subdivision.
- classRTree
-
class RTree<T> extends Tree<T>Simple R-tree spatial index for rectangular scene data.
constructor RTree<T>(): RTree<T>Constructs an R-tree with a broad default world boundary.
method clear(): voidRemoves all indexed items.
method getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
method insert(data: T): booleanInserts one item into the root child list.
method query(range: PositionRect<templateLiteral>): T[]Returns items whose rectangles intersect the query range.
method remove(data: T): booleanRemoves one item by object identity.
method toJSON(): objectSerializes debug data for this spatial index.
method updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the boundary and clears indexed items.
- classSpatialHash
-
class SpatialHash<T> extends Tree<T>Spatial hash index that buckets rectangular items by their top-left cell.
constructor SpatialHash<T>(cellSize?: number, boundary?: PositionRect<templateLiteral>, capacity?: number): SpatialHash<T>Constructs a spatial hash index.
cellSizeLogical size of one hash bucket.
boundaryRoot spatial boundary.
capacityRetained for the shared Tree contract.
method clear(): voidRemoves all indexed items.
method getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
method insert(data: T): booleanInserts an item into the bucket containing its top-left corner.
method query(range: PositionRect<templateLiteral>): T[]Returns items in intersecting buckets whose rectangles overlap the query range.
method remove(data: T): booleanRemoves one item from its hashed bucket.
method toJSON(): objectSerializes debug data for this spatial index.
method updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the boundary and clears indexed items.
- typeHitColorKey
-
type HitColorKey = HexColorColor key used only by hit-canvas rendering and pixel-to-node lookup.
No matching API entries.