Shumoku Docs

Search documentation

Shared docs and current release

Loading search…

日本語

@shumoku/core · 0.4.0 · function

addPort

Source

Add an unnamed port to a node on the specified side. The port is appended to `Node.ports` (the data model) and to the resolved-port map (layout). Label stays empty — the renderer hides labelless ports' label rectangle, and the user can name it later from the detail panel.

addPort(nodeId: string, side: Side, nodes: Map<string, Node>, ports: Map<string, ResolvedPort>, _existingLinks: Link[]): { nodes: Map<string, Node>; portId: string; ports: Map<string, ResolvedPort> } | null

Parameters

Parameter Type Description Default
nodeId string No additional description.
side Side No additional description.
nodes Map<string, Node> No additional description.
ports Map<string, ResolvedPort> No additional description.
_existingLinks Link[] No additional description.

Returns

{ nodes: Map<string, Node>; portId: string; ports: Map<string, ResolvedPort> } | null

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