API reference: @salmonui/data-grid/engine/tree
TreeLayoutinterface
import type { TreeLayout } from '@salmonui/data-grid/engine/tree';interface TreeLayout {
readonly sourceCount: number;
readonly count: number;
readonly order: Int32Array;
readonly slot: Int32Array;
readonly next: Int32Array;
readonly parent: Int32Array;
readonly depth: Uint16Array;
readonly childCount: Int32Array;
readonly posinset: Int32Array;
readonly setsize: Int32Array;
readonly roots: Int32Array;
}
Pre-order layout of the kept rows of a tree. Arrays named by slot are indexed by pre-order slot, the others by source index.
| Name | Signature | Description |
|---|---|---|
sourceCount | readonly sourceCount: number; | Source rows the layout was built over. |
count | readonly count: number; | Kept rows (slots). |
order | readonly order: Int32Array; | By slot: source index. |
slot | readonly slot: Int32Array; | Source index -> slot, or -1 when the row is not kept. |
next | readonly next: Int32Array; | By slot: first slot after the subtree. |
parent | readonly parent: Int32Array; | Effective parent (nearest kept ancestor) source index, or -1 for a root. |
depth | readonly depth: Uint16Array; | |
childCount | readonly childCount: Int32Array; | Kept children. |
posinset | readonly posinset: Int32Array; | 1-based ordinal among kept siblings ( |
setsize | readonly setsize: Int32Array; | Kept siblings including the row ( |
roots | readonly roots: Int32Array; | Slots of the root rows, ascending. |