# movePort

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

@shumoku/core · 0.4.0 · function

# movePort

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

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

Move a port to the nearest edge of its node based on cursor position. Changes the port's side and redistributes all ports. Returns null if the side didn't change.

```
movePort(portId: string, svgX: number, svgY: number, nodes: Map<string, Node>, ports: Map<string, ResolvedPort>): { nodes: Map<string, Node>; ports: Map<string, ResolvedPort> } | null
```

## パラメーター

| 名前 | 型 | 説明 | 既定値 |
| --- | --- | --- | --- |
| `portId` | `string` | 追加説明はありません。 | `—` |
| `svgX` | `number` | 追加説明はありません。 | `—` |
| `svgY` | `number` | 追加説明はありません。 | `—` |
| `nodes` | `Map<string, Node>` | 追加説明はありません。 | `—` |
| `ports` | `Map<string, ResolvedPort>` | 追加説明はありません。 | `—` |

## 戻り値

```
{ nodes: Map<string, Node>; ports: Map<string, ResolvedPort> } | null
```

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