DEMOS
DOCS
FEATURES
DOWNLOAD
PURCHASE
CONTACT
BLOG
Show:

jsPlumbToolkit.Model Class

A Model describes the appearance and behaviour of a set of Nodes, Edges, Ports and Groups. You do not create one of these directly; instead you pass a definition to a jsPlumbToolkit.render or jsPlumbToolkit.newInstance() call. Although the Model has the same syntax in each context, you are encouraged to configure model-specific things in the Model you pass to the newInstance method (such as, which Nodes/Ports can be connected to which others, what is the maximum number of connections, etc), and view-specific things (such as css classes, paint styles, connector appearance etc) to the model you pass to the render method. The render method automatically merges in a Node/Port/Edge definition from a Model defined on the associated Toolkit, if there is one.

Constructor

jsPlumbToolkit.Model

(
  • params
  • [_jsPlumb]
)

Parameters:

  • params Object

    Model parameters

    • [nodes] Object optional

      Node definitions.

    • [edges] Object optional

      Edge definitions.

    • [ports] Object optional

      Port definitions.

    • [groups] Object optional

      Group definitions.

  • [_jsPlumb] JsPlumbInstance optional

    An instance of jsPlumb on which to register associated Connection and Endpoint types. Only the Surface widget provides this. The Toolkit instance creates a Model but it is headless.

Item Index