Shumoku Docs

Search documentation

Shared docs and current release

Loading search…

日本語

@shumoku/core · 0.4.0 · function

addLink

Source

Add a link between two ports (existing or new). If fromPortId/toPortId refer to existing ports, use them. If toTarget is a nodeId (no port), create a new port on that node. Returns the updated graph with the new link, or null if invalid.

addLink(graph: NetworkGraph, fromPortId: string, toPortId: string): NetworkGraph | null

Parameters

Parameter Type Description Default
graph NetworkGraph No additional description.
fromPortId string No additional description.
toPortId string No additional description.

Returns

NetworkGraph | null

libs/@shumoku/core/src/layout/interaction.ts:595