HierarchyContributor
Since v3.9.0
A plugin that contributes structure to the hierarchy.
Contributors never call each other: the HierarchyPlugin runs every attached
contributor on each natural sibling list — structure contributors first
(discover children, order siblings), then transform contributors
(re-shape the list, e.g. insert group nodes).
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
hierarchyStage | structure | transform | structure contributors run before transform contributors on every list. |
Methods
Section titled “Methods”beginHierarchy()
Section titled “beginHierarchy()”Called once per row-model rebuild with the root rows. Return false to sit
out this rebuild (e.g. the data is not a tree).
beginHierarchy(rows: readonly unknown[]): booleanParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
rows | readonly unknown[] |
processSiblings()
Section titled “processSiblings()”Re-shape one natural sibling list. Return the input array when nothing changes.
processSiblings(nodes: HierarchyNode[], context: HierarchySiblingContext): HierarchyNode[]Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
nodes | HierarchyNode[] | |
context | HierarchySiblingContext |
endHierarchy()
Section titled “endHierarchy()”Called once per rebuild (only if beginHierarchy returned true) with the flattened
rows. positionOf returns a row’s final position — its depth can exceed the
context.depth seen in processSiblings when a transform inserted levels above it.
Return false when this rebuild produced no structure from this contributor (e.g. no
list was grouped). When every contributor returns false, the rows are announced as a
flat grid — no treegrid role, no aria-level / aria-setsize / aria-posinset.
endHierarchy(rows: readonly unknown[], positionOf: (row: unknown) => HierarchyRowMeta | undefined): booleanParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
rows | readonly unknown[] | |
positionOf | (row: unknown) => HierarchyRowMeta | undefined |