Skip to main content

Home > @jsplumbtoolkit/browser-ui-vanilla-2 > ingest

ingest() function#

Ingests an existing jsPlumb instance into a new Toolkit instance, and turns the instance's Container into a Surface. Every element that is the source or target of a Connection is added to the Toolkit instance as a Node, and every Connection is added as an Edge. You can provide your own functions for determining the id and type of Nodes and Edges, if you need to. This method will throw an error if your jsPlumb instance does not have a Container set; it is a requirement for the Surface widget.

When you ingest an existing jsPlumb instance, its Container is configured to be a Surface widget, which makes it pannable and zoomable, and the set of Nodes and Edges it is managing are loaded into the Toolkit's data model.

Signature:

export declare function ingest(params: IngestOptions): Ingester;

Parameters#

ParameterTypeDescription
paramsIngestOptionsMethod parameters.

Returns:

Ingester

Surface A Surface instance whose underlying Toolkit has been loaded with the contents of the jsPlumb instance (you can access the Toolkit itself via surface.getToolkit()), or, if render was set to false, a jsPlumbToolkitInstance..