# placePorts

Canonical: https://docs.shumoku.dev/ja/library/api/placePorts
Language: ja

@shumoku/core · 0.4.0 · function

# placePorts

[ソース](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/auto-placement/flat-tree/port-placement.ts#L405)

APIの説明は英語のcanonical sourceを表示しています。

Compose the three phases: decide sides → order each side → compute absolute coordinates → emit \`ResolvedPort\`s keyed by \`nodeId:portId\`. Port sides are re-seated from final geometry (see reseatPortsByGeometry) so wires exit toward their peer regardless of how the upstream/downstream tree was inferred. Ports are positioned along each side by distributePortsAlongSide (peer-aligned), with computePortPosition's even spread as the fallback.

```
placePorts(nodes: Map<string, Node>, links: Link[], direction?: Direction): Map<string, ResolvedPort>
```

## パラメーター

| 名前 | 型 | 説明 | 既定値 |
| --- | --- | --- | --- |
| `nodes` | `Map<string, Node>` | 追加説明はありません。 | `—` |
| `links` | `Link[]` | 追加説明はありません。 | `—` |
| `direction` | `Direction` | 追加説明はありません。 | `'TB'` |

## 戻り値

```
Map<string, ResolvedPort>
```

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