# moveSubgraph

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

@shumoku/core · 0.4.0 · function

# moveSubgraph

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

Move an entire subgraph (bounds + all contents) by delta from its current position. Resolves sibling collisions after the move.

```
moveSubgraph(sgId: string, x: number, y: number, layout: { nodes: Map<string, Node>; ports: Map<string, ResolvedPort>; subgraphs: Map<string, Subgraph> }, links: Link[], routeFn?: object): Promise<{ edges: Map<string, ResolvedEdge>; nodes: Map<string, Node>; ports: Map<string, ResolvedPort>; subgraphs: Map<string, Subgraph> } | null>
```

## Parameters

| Parameter | Type | Description | Default |
| --- | --- | --- | --- |
| `sgId` | `string` | No additional description. | `—` |
| `x` | `number` | No additional description. | `—` |
| `y` | `number` | No additional description. | `—` |
| `layout` | `{ nodes: Map<string, Node>; ports: Map<string, ResolvedPort>; subgraphs: Map<string, Subgraph> }` | No additional description. | `—` |
| `links` | `Link[]` | No additional description. | `—` |
| `routeFn` | `object` | No additional description. | `routeEdges` |

## Returns

```
Promise<{ edges: Map<string, ResolvedEdge>; nodes: Map<string, Node>; ports: Map<string, ResolvedPort>; subgraphs: Map<string, Subgraph> } | null>
```

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