Home > @jsplumbtoolkit/core > JsPlumbToolkit > addFactoryNode
JsPlumbToolkit.addFactoryNode() method
Adds a Node by type, running the data generation for the node through the current NodeFactory. This is different from addNode
in that with addNode
you are supplying the final data and your NodeFactory is not called. This method can be called with one, two or three arguments. A single argument is considered to be the new Node's type
, and a backing data object will be created with this set, and no callback will occur. If you provide two arguments the second argument may be either the new Node's backing data OR a callback to hit with the newly created Node. With three arguments the second argument is the Node's backing data and the third is a callback to hit with the newly created Node.
Signature:
addFactoryNode(type: string, data?: ObjectData, continueCallback?: Function, abortCallback?: Function): void;
Parameters
Parameter | Type | Description |
---|---|---|
type | string | Required. Type of the object to create. type will be passed as the first argument to your node factory. |
data | ObjectData | Optional backing data for the Node. |
continueCallback | Function | Optional function to call with the newly created Node. |
abortCallback | Function | Optional function to call if the factory aborted the node add. |
Returns:
void