Shumoku Docs

ドキュメントを検索

共通文書と現行公開版

検索を読み込み中…

English

@shumoku/core · 0.4.0 · function

bezierEdgePath

ソース

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

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

パラメーター

名前 説明 既定値
from { absolutePosition: { x: number; y: number }; lateralOffset?: number; side?: PortSide } 追加説明はありません。
to { absolutePosition: { x: number; y: number }; lateralOffset?: number; side?: PortSide } 追加説明はありません。

戻り値

string

libs/@shumoku/core/src/layout/bezier-path.ts:61