Skip to main content

Home > @jsplumbtoolkit/browser-ui > BrowserUIModel

BrowserUIModel 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 jsPlumbToolkitBrowserUI.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. Only the Surface widget provides this. The Toolkit instance creates a Model but it is headless.

Signature:

export declare class BrowserUIModel 

Constructors

ConstructorModifiersDescription
(constructor)(toolkit, dataModel, viewOptions, _jsPlumb)Constructs a new instance of the BrowserUIModel class

Properties

PropertyModifiersTypeDescription
defMapModelDefinitionMap
viewOptionsSurfaceViewOptions

Methods

MethodModifiersDescription
getEdgeDefinition(typeId)
getGroupDefinition(typeId)
getNodeDefinition(typeId)
getPortDefinition(typeId)
getTypeDefinition(obj)