← All packages

@searsuite/sear-render

Public rendering facade that composes contexts, nodes, strategies, and registries.

Grid and labels

classSheetCellMergeRender
class SheetCellMergeRender extends Plugin<SearCoreSheet, CellProperties, Record<string, never>>

Renders merged ranges owned by SheetCellMergePlugin.

constructorSheetCellMergeRender(cellVisualReaders: SheetCellVisualReaderRegistry): SheetCellMergeRender
propertyreadonly depth: 1

Draw and event ordering hint; lower values run earlier.

propertyreadonly interestedIn: MatrixOTActionName[]

Declares which Sheet OT action names this plugin is interested in. The engine will only call apply when a transaction contains at least one operation matching these action names, unless the transaction is owned by this plugin.

  • [&#39;uc&#39;, &#39;rr&#39;, &#39;rc&#39;] — only called for UpdateCell, ResizeRow, ResizeCol
  • [&#39;*&#39;] — called for any transaction (wildcard)
  • [] — only called for this plugin's own transactions
propertyreadonly pluginKey: PluginKeystatic
propertyreadonly symbol: typeof symbolstatic
methodapply(): Record<string, never>

Applies a transaction to plugin-owned state and returns the next state.

methodgetPluginConfig(searCore: SearCoreSheet): { defaultBorderColor: string }

Returns this plugin's runtime configuration view for the current core.

methodonMouseDown(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): void

Handles the start of a pointer press sequence.

methodonMouseMove(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): void

Handles pointer movement over the host surface.

methodonMouseUp(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): void

Handles the end of a pointer press sequence.

methodregisterConfig(): { config: ConfigUnit<{ defaultBorderColor: string }>; key: PluginKey }[]

Registers default configuration values owned by this plugin.

methodregisterState(): { key: PluginKey; state: Record<string, never> }

Registers one or more plugin-owned state records with the host manager.

methodrender(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]

Produces scene nodes owned by this plugin for the current core state.

Inherited members 23

Inherited from Plugin.

classSheetColumnLabelPlugin
class SheetColumnLabelPlugin extends Plugin<SearCoreSheet, CellProperties, ISheetColumnLabel>

Renders sticky column header cells for the visible viewport range.

constructorSheetColumnLabelPlugin(): SheetColumnLabelPlugin

Constructs the column header plugin.

propertyreadonly defaultConfig: { defaultBackgroundColor: string; defaultBorderColor: string; defaultHeight: number }static

Default visual configuration for column headers.

propertyreadonly symbol: symbolstatic

DI token for resolving the column header plugin.

methodapply(operations: Operation[]): ISheetColumnLabel

Returns unchanged plugin state for every transaction.

methodgetPluginConfig(searCore: SearCoreSheet): { defaultBackgroundColor: string; defaultBorderColor: string; defaultHeight: number }

Reads the column header render configuration from ConfigEngine.

methodinitialize(): void

Initializes column header runtime state.

methodonResize(): void

Column header dimensions are recomputed during render after resize.

methodonScroll(_scrollManagerState: ScrollManagerState): void

Column header positions are recomputed during render from scroll state.

methodregisterConfig(): { config: ConfigUnit<{ defaultBackgroundColor: string; defaultBorderColor: string; defaultHeight: number }>; key: PluginKey }[]

Registers default column header configuration.

methodregisterState(): { key: PluginKey; state: ISheetColumnLabel }

Registers the stateless column header plugin with PluginManager.

methodrender(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]

Renders visible column header cells.

ReturnsRender nodes for visible column headers.

searCore

Sheet core containing data and render services.

offset

World offset applied by sticky rendering.

Inherited members 27

Inherited from Plugin.

classSheetCornerPlugin
class SheetCornerPlugin extends Plugin<SearCoreSheet, CellProperties, ISheetCorner>

Renders the sticky sheet corner cell where row and column headers meet.

constructorSheetCornerPlugin(): SheetCornerPlugin

Constructs the sheet corner plugin.

propertyreadonly symbol: symbolstatic

DI token for resolving the sheet corner plugin.

methodapply(operations: Operation[]): ISheetCorner

Returns unchanged plugin state for every transaction.

methodgetPluginConfig(searCore: SearCoreSheet): { backgroundColor: string; borderColor: string; height: number; width: number }

Reads the sheet corner render configuration from ConfigEngine.

methodinitialize(): void

Initializes sheet corner runtime state.

methodonResize(): void

Sheet corner dimensions are recomputed during render after resize.

methodonScroll(_scrollManagerState: ScrollManagerState): void

Sheet corner position is recomputed during render from scroll state.

methodregisterConfig(): { config: ConfigUnit<{ backgroundColor: string; borderColor: string; height: number; width: number }>; key: PluginKey }[]

Registers default sheet corner configuration.

methodregisterState(): { key: PluginKey; state: ISheetCorner }

Registers the stateless sheet corner plugin with PluginManager.

methodrender(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]

Renders the sheet corner cell.

ReturnsRender nodes for the sheet corner.

searCore

Sheet core containing render services.

offset

World offset applied by sticky rendering.

Inherited members 27

Inherited from Plugin.

classSheetGridPlugin
class SheetGridPlugin extends Plugin<SearCoreSheet, CellProperties, SheetGridState>

Composite plugin that assembles sheet chrome, body grid, and merged-cell nodes.

constructorSheetGridPlugin(sheetCornerPlugin: SheetCornerPlugin, sheetColumnLabelPlugin: SheetColumnLabelPlugin, sheetRowNumberPlugin: SheetRowNumberPlugin, sheetGridRender: SheetGridRender): SheetGridPlugin

Constructs the grid plugin from its child sheet render plugins.

propertyinterestedIn: string[]

Rebuilds grid geometry when sheet data or dimensions change.

propertyreadonly symbol: symbolstatic

DI token for resolving the composite sheet grid plugin.

methodapply(pluginState: SheetGridState, transaction: Transaction): SheetGridState | null

Keeps composite state unchanged when data transactions cause a re-render.

methodgetPluginConfig(searCore: SearCoreSheet): null

Composite grid configuration is delegated to child render plugins.

methodonDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): void

Forwards double-click handling to the body grid renderer.

methodregisterConfig(): { config: ConfigUnit<{ backgroundColor: string; borderColor: string; height: number; width: number }>; key: PluginKey }[]

Registers configuration contributed by every child sheet render plugin.

methodregisterState(): { key: PluginKey; state: SheetGridState }

Registers only the composite grid state; merged ranges have their own plugin owner.

methodrender(searCore: SearCoreSheet): Node<CellProperties>[]

Renders sheet chrome and body layers in the order expected by the scene graph.

ReturnsRender nodes for corner, headers, merged cells, and grid cells.

searCore

Sheet core containing data and render services.

Inherited members 27

Inherited from Plugin.

classSheetGridRender
class SheetGridRender extends Plugin<SearCoreSheet, CellProperties, ISheetGridRender>

Renders visible sheet body cells.

constructorSheetGridRender(cellVisualReaders: SheetCellVisualReaderRegistry): SheetGridRender

Constructs the body grid renderer.

propertyreadonly symbol: symbolstatic

DI token for resolving the body grid renderer.

methodapply(operations: Operation[]): ISheetGridRender

Returns unchanged renderer state for every operation list.

methodgetPluginConfig(searCore: SearCoreSheet): { defaultBorderColor: string }

Reads the body grid render configuration from ConfigEngine.

methodonDblClick(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): void

Handles double-click interactions on grid cells.

methodregisterConfig(): { config: ConfigUnit<{ defaultBorderColor: string }>; key: PluginKey }[]

Registers default body grid configuration.

methodregisterState(): { key: PluginKey; state: ISheetGridRender }

Registers the stateless body grid renderer with PluginManager.

methodrender(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]

Renders visible grid cells, skipping cells covered by merged ranges.

ReturnsRender nodes for visible body cells.

searCore

Sheet core containing data and render services.

offset

Offset after accounting for row/column headers.

Inherited members 28

Inherited from Plugin.

classSheetRowNumberPlugin
class SheetRowNumberPlugin extends Plugin<SearCoreSheet, CellProperties, ISheetRowNumber>

Renders sticky row header cells for the visible viewport range.

constructorSheetRowNumberPlugin(): SheetRowNumberPlugin

Constructs the row header plugin.

propertyreadonly defaultConfig: { defaultBackgroundColor: string; defaultBorderColor: string; defaultWidth: number }static

Default visual configuration for row headers.

propertyreadonly symbol: symbolstatic

DI token for resolving the row header plugin.

methodapply(operations: Operation[]): ISheetRowNumber

Returns unchanged plugin state for every transaction.

methodgetPluginConfig(searCore: SearCoreSheet): { defaultBackgroundColor: string; defaultBorderColor: string; defaultWidth: number }

Reads the row header render configuration from ConfigEngine.

methodinitialize(): void

Initializes row header runtime state.

methodonResize(): void

Row header dimensions are recomputed during render after resize.

methodonScroll(_scrollManagerState: ScrollManagerState): void

Row header positions are recomputed during render from scroll state.

methodregisterConfig(): { config: ConfigUnit<{ defaultBackgroundColor: string; defaultBorderColor: string; defaultWidth: number }>; key: PluginKey }[]

Registers default row header configuration.

methodregisterState(): { key: PluginKey; state: ISheetRowNumber }

Registers the stateless row header plugin with PluginManager.

methodrender(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]

Renders visible row header cells.

ReturnsRender nodes for visible row headers.

searCore

Sheet core containing data and render services.

offset

World offset applied by sticky rendering.

Inherited members 27

Inherited from Plugin.

Viewport geometry

interfaceSheetRangePositionContext

Explicit layout inputs required to convert a sheet range to canvas coordinates.

interfaceViewportRange

Computed visible row/column range within the current viewport. Used as a cross-cutting concern by render plugins to avoid iterating the entire sheet when only a small portion is visible.

Example: 10,000 rows × 100 cols → only ~40 rows × ~20 cols are visible at once. Computing the range costs O(log n) via binary search in DimensionsCSRMatrix, then the render loop iterates only the visible slice — O(visible) instead of O(total).

functionactiveFixedRowOffsets
activeFixedRowOffsets(fixedRows: FixedRowMatrix | null, rowSizes: DimensionsCSRMatrix, scrollY: number, frozenRows: number, offsetY: number): Map<number, number>

Fixed rows join the top stack only after the scrolling viewport passes their original position.

functioncomputeViewportRange
computeViewportRange(scrollManager: ScrollManager, rowSizes: DimensionsCSRMatrix, columnSizes: DimensionsCSRMatrix, offset?: { x: number; y: number }): ViewportRange

Compute the visible row/column range from the current scroll state and the dimension matrices (row heights / column widths).

Includes a 1-cell buffer on each side to avoid pop-in artifacts at the edges when scrolling quickly.

scrollManager

The scroll manager that holds viewport + scroll position

rowSizes

Row dimension matrix (heights with cumulative boundary lookups)

columnSizes

Column dimension matrix (widths with cumulative boundary lookups)

offset

Render offset (e.g. frozen header offsets), added to viewport origin

functiongetSheetRangePositionRect
getSheetRangePositionRect(start: Point, end: Point, context: SheetRangePositionContext): PositionRect<undefined> | null

Converts an inclusive sheet cell range into a world-space canvas rectangle. Returns null when the range is invalid or outside the current sheet bounds.