# computeTilingLayout
Source: https://docs.maelstrom-ai.co/dev/reference/client/functions/computetilinglayout/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **computeTilingLayout**(`tree`, `containerRect`, `padding`): readonly [`ComputedTile`](https://docs.maelstrom-ai.co/dev/reference/client/interfaces/computedtile/)\[\]

Defined in: [packages/client/src/lib/chart-manager/tiling.ts:258](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/client/src/lib/chart-manager/tiling.ts#L258)

Assigns every leaf a rectangle inside `containerRect`.

A split divides its region along its axis in proportion to its weights, so the children tile it exactly: the cut positions are computed as cumulative edges and the last edge is the region’s own far side, leaving no gap or overlap for any weighting. `padding` is then inset per leaf, never per split, so it never accumulates with depth. Empty trees and empty leaves produce no tile, and padding never yields negative size.

One tile per Instance leaf, with no post-pass. A tree naming the same Instance twice is refused by the seed validator and by the command processor, and heal blanks the repeat before it reaches the store, so a duplicate arriving here means the public API was bypassed.

## Parameters

### tree

[`TilingTreeNode`](https://docs.maelstrom-ai.co/dev/reference/client/type-aliases/tilingtreenode/) | `null`

### containerRect

[`Rect`](https://docs.maelstrom-ai.co/dev/reference/client/interfaces/rect/)

### padding

`number`

## Returns

readonly [`ComputedTile`](https://docs.maelstrom-ai.co/dev/reference/client/interfaces/computedtile/)\[\]
