# autoLayoutFlatTree

Canonical: https://docs.shumoku.dev/en/library/api/autoLayoutFlatTree
Language: en

@shumoku/core · 0.4.0 · function

# autoLayoutFlatTree

[Source](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/auto-placement/flat-tree/auto-layout.ts#L222)

Lay out a network graph using the flat-tree algorithm, using the supplied \`LayoutEngine\` for rules (sizes, gaps, label widths). Equivalent to the legacy \`layoutNetwork(graph, options)\`, but the engine is now a first-class concept. The same engine instance can also serve manual placement (\`engine.tryPlace\`) so layout and drag-snap stay consistent.

```
autoLayoutFlatTree(graph: NetworkGraph, engine: LayoutEngine, options?: AutoLayoutOptions): AutoLayoutResult
```

## Parameters

| Parameter | Type | Description | Default |
| --- | --- | --- | --- |
| `graph` | `NetworkGraph` | No additional description. | `—` |
| `engine` | `LayoutEngine` | No additional description. | `—` |
| `options` | `AutoLayoutOptions` | No additional description. | `{}` |

## Returns

```
AutoLayoutResult
```

[`libs/@shumoku/core/src/layout/auto-placement/flat-tree/auto-layout.ts:222`](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/auto-placement/flat-tree/auto-layout.ts#L222)
