Support functionality for working with existing jsPlumb instances in the Toolkit. Using the
ingest method in this
class, you can ingest an existing jsPlumb instance into a new instance of the Toolkit; this for many people may
prove to be a logical upgrade path from their existing jsPlumb code.
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.
- ingest static
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
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.
The instance of jsPlumb to ingest. If null, it uses the static jsPlumb window instance.
Optional selector to identify elements that may not yet be managed by jsPlumb but which you would like to have imported as Nodes.
A function to use to extract the id from elements that are being loaded as Nodes. If null, the default behaviour is to ask the jsPlumb instance for the element's
A function to use to extract the type from elements that are being loaded as Nodes. If null, the default behaviour is to use
defaultas the Node type.
A function to use to extract the id from Connections that are being loaded as Edges. If null, the default behaviour is to use the Connection's
A function to use to extract the type from Connections that are being loaded as Edges. If null, the default behaviour is to use
defaultas the Edge type.
Parameters to pass to the Surface constructor.
If false, this method returns only a Toolkit instance with data loaded, and doesn't create a Surface renderer for it.
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