Skip to main content

Home > @jsplumbtoolkit/core > JsPlumbToolkit > setType

JsPlumbToolkit.setType() method

Sets the type of the given object. This will do two things: 1. update the appropriate property in the object's data to this new value. You can set what properties define types, but by default each of Node, Edge and Port use type as the property that indicates their type. 2. attempt to apply a type definition for the new type, if one is found. NB this only applies to Edge objects, as at version 1.1.0. Support for Nodes (including switching node templates) is a possible future enhancement.

Signature:

setType(obj: Base, type: any): void;

Parameters

ParameterTypeDescription
objBaseObject to set the type for.
typeanyType to set on the object.

Returns:

void