# buildVisibleRanges (@salmonui/data-grid/engine/tree)

> The buildVisibleRanges function of @salmonui/data-grid/engine/tree: Visible ranges of layout where expanded[s] (by source index) opens a row with kept children. With footers, a child summary row follows the last visible descendant of every expanded parent. O(visible rows + k); O(1) when allOpen says every row is expanded (no footers).

Canonical: https://salmonui.dev/docs/reference/data-grid/engine-tree/buildVisibleRanges

```ts
import { buildVisibleRanges } from '@salmonui/data-grid/engine/tree';
```

Entry index: https://salmonui.dev/docs/reference/data-grid/engine-tree (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid/engine-tree.md).

## Reference

Kind: function

```ts
function buildVisibleRanges(layout: TreeLayout, expanded: Uint8Array, footers: boolean, allOpen?: boolean): TreeRanges;
```

Visible ranges of `layout` where `expanded[s]` (by source index) opens a
row with kept children. With `footers`, a child summary row follows the
last visible descendant of every expanded parent. O(visible rows + k);
O(1) when `allOpen` says every row is expanded (no footers).
