# collectObstacles

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

@shumoku/core · 0.4.0 · function

# collectObstacles

[Source](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/interaction.ts#L61)

Collect all obstacles as centre-based rects, excluding entities related to \`excludeId\`. Both nodes and subgraphs are treated as rectangles.

```
collectObstacles(excludeId: string, excludeParent: string | undefined, nodes: Map<string, Node>, subgraphs?: Map<string, Subgraph>): { h: number; w: number; x: number; y: number }[]
```

## Parameters

| Parameter | Type | Description | Default |
| --- | --- | --- | --- |
| `excludeId` | `string` | No additional description. | `—` |
| `excludeParent` | `string | undefined` | No additional description. | `—` |
| `nodes` | `Map<string, Node>` | No additional description. | `—` |
| `subgraphs` | `Map<string, Subgraph>` | No additional description. | `—` |

## Returns

```
{ h: number; w: number; x: number; y: number }[]
```

[`libs/@shumoku/core/src/layout/interaction.ts:61`](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/interaction.ts#L61)
