Documentation

@kanunilabs/datagrid-react


@kanunilabs/datagrid-react / ColumnLayout

Interface: ColumnLayout<TRow>

Type Parameters

TRow

TRow = GridRowData

Properties

center

center: ColumnRuntime<TRow>[]

Scrollable block — the only virtualized one.


centerOffsets

centerOffsets: number[]

Prefix offsets of the center columns (length = center.length + 1), relative to the start of the center block. Enables O(log n) hit-testing.


centerStickyOffsets

centerStickyOffsets: (number | null)[]

For each CENTER column, the inset it sticks at — or null when it does not stick. Parallel to center, so a renderer reads it by the same index.

A sticky column keeps its place in the scrolling order and only parks itself once it would leave the viewport, which is what separates it from a left-pinned one. The inset is measured from the scroller's start edge, so it clears the left-pinned block and any sticky column ahead of it.


centerWidth

centerWidth: number


left

left: ColumnRuntime<TRow>[]

Sticky-left block, always rendered.


leftOffsets

leftOffsets: number[]

Sticky left inset for each left-pinned column (cumulative).


leftWidth

leftWidth: number


right: ColumnRuntime<TRow>[]

Sticky-right block, always rendered.


rightOffsets

rightOffsets: number[]

Sticky right inset for each right-pinned column (cumulative from the end).


rightWidth

rightWidth: number


stickyIndices

stickyIndices: number[]

Indices into center of the sticky columns, in order.


totalWidth

totalWidth: number