View as Markdown

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.

TreeLayout members (11)
NameSignatureDescription
sourceCountreadonly sourceCount: number;

Source rows the layout was built over.

countreadonly count: number;

Kept rows (slots).

orderreadonly order: Int32Array;

By slot: source index.

slotreadonly slot: Int32Array;

Source index -> slot, or -1 when the row is not kept.

nextreadonly next: Int32Array;

By slot: first slot after the subtree.

parentreadonly parent: Int32Array;

Effective parent (nearest kept ancestor) source index, or -1 for a root.

depthreadonly depth: Uint16Array;
childCountreadonly childCount: Int32Array;

Kept children.

posinsetreadonly posinset: Int32Array;

1-based ordinal among kept siblings (aria-posinset; 0: not kept). Built on first read.

setsizereadonly setsize: Int32Array;

Kept siblings including the row (aria-setsize; 0: not kept). Built on first read.

rootsreadonly roots: Int32Array;

Slots of the root rows, ascending.