# bezierEdgePath

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

@shumoku/core · 0.4.0 · function

# bezierEdgePath

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

Build a cubic-Bezier SVG path \`d\` string from one port to another. Each port is described by its absolute (x, y) position and which side of the node it sits on. The path leaves \`from\` along that side's outward normal, sweeps through two symmetric control points, and enters \`to\` along its own side's inward normal. \`lateralOffset\` (optional, on either endpoint) shifts that endpoint \*\*and\*\* its control point perpendicular to the port's outward normal, so the curve still leaves / arrives straight along the normal but starts (or ends) sideways from the port centre. Used by the router to fan multiple edges sharing one port apart visually without rerouting through orthogonal segments. Positive = right of the outward normal in screen coords (y-down). The endpoint \*visibly detaches from the port centre\* by the offset — fine for fan-out decoration but not for tight-tolerance hit testing on the port itself.

```
bezierEdgePath(from: { absolutePosition: { x: number; y: number }; lateralOffset?: number; side?: PortSide }, to: { absolutePosition: { x: number; y: number }; lateralOffset?: number; side?: PortSide }): string
```

## Parameters

| Parameter | Type | Description | Default |
| --- | --- | --- | --- |
| `from` | `{ absolutePosition: { x: number; y: number }; lateralOffset?: number; side?: PortSide }` | No additional description. | `—` |
| `to` | `{ absolutePosition: { x: number; y: number }; lateralOffset?: number; side?: PortSide }` | No additional description. | `—` |

## Returns

```
string
```

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