@shumoku/core · 0.4.0 · function
movePort
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 Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
portId | string | No additional description. | — |
svgX | number | No additional description. | — |
svgY | number | No additional description. | — |
nodes | Map<string, Node> | No additional description. | — |
ports | Map<string, ResolvedPort> | No additional description. | — |
Returns
{ nodes: Map<string, Node>; ports: Map<string, ResolvedPort> } | null