Skip to main content

Home > @jsplumbtoolkit/core > Node > addPort

Node.addPort() method

Adds a Port to the Node.

Signature:

addPort(data: any, idFunction?: IdFunction): Port;

Parameters

ParameterTypeDescription
dataanyOptional data backing the Port. This object can be of any type you like.
idFunctionIdFunctionOptional function that can take a Port's data and return its ID. By default this looks for an id member in the backing data.

Returns:

Port