DEMOS
DOCS
FEATURES
DOWNLOAD
PURCHASE
CONTACT
BLOG
Show:

jsPlumbToolkit directive. Class

Provides an angular directive to create an instance of the Toolkit. Params discussed here are provided as attributes to the element, for instance:

Note that of course since they are attributes then their real types are String, but the types discussed here are the required types of objects resolved through Angular's DI.

Methods

addComponent

(
  • surfaceId
  • params
  • type
)

Add a component to the Surface with the given id. If the Surface already exists and has been initialised the component will be added immediately; otherwise it will be enqueued for later processing.

Parameters:

  • surfaceId String

    ID of the Surface to add the component to.

  • params Object

    Constructor parameters for the component.

  • type String

    Type of component to add.

addMiniview

(
  • surfaceId
  • params
)

Add a Miniview to the Surface with the given id. If the Surface already exists and has been initialised the Miniview will be added immediately; otherwise it will be enqueued for later processing. This is just a wrapper around addComponent.

Parameters:

  • surfaceId String

    ID of the Surface to add the Miniview to.

  • params Object

    Constructor parameters for the Miniview.

addPalette

(
  • surfaceId
  • params
)

Add a Palette to the Surface with the given id. If the Surface already exists and has been initialised the Palette will be added immediately; otherwise it will be enqueued for later processing. This is really just a wrapper around addComponent.

Parameters:

  • surfaceId String

    ID of the Surface to add the Palette to.

  • params Object

    Constructor parameters for the Palette.

addSurface

(
  • id
  • surface
)

Registers a Surface. If any extra components have been registered for this Surface they will be initialised now.

Parameters:

  • id String

    ID to register the Surface with.

  • surface Surface

    Surface instance.

bind

(
  • event
  • toolkitId
  • callback
)

Binds to some event related to the toolkit with the given id, which may or may not yet exist, and in fact for the case for which this functionality was added - a ready event - it most likely does not.

Parameters:

  • event String

    ID of the event to bind to. Currently we support ready only.

  • toolkitId String

    ID of the Toolkit to bind the event to.

  • callback Function

    Function to call when the event fires. The function is passed (toolkit, toolkitId, eventId) as args.

getSurface

(
  • id
)

Retrieve a Surface by id. You will have set the id of the Surface via the surface-id attribute on the directive element.

Parameters:

  • id String

    ID of the Surface to retrieve.

getToolkit

(
  • id
  • [params]
)
JsPlumbToolkitInstance

Gets an instance of the jsPlumb Toolkit by the ID used to create it.

Parameters:

  • id String

    ID used to create the Toolkit instance you want to retrieve.

  • [params] Object optional

    Optional parameters for the Toolkit instance's constructor.

Returns:

JsPlumbToolkitInstance:

An instance of the jsPlumb Toolkit; null if not found.

instance

(
  • params
)

Create an instance of the jsPlumb Toolkit.

Parameters:

  • params Object

miniview

() Object

Generate a Miniview directive.

Returns:

Object:

A Miniview directive definition.

resetToolkit

(
  • id
)

Resets the toolkit with the given id - which is to say, deletes it, so that the next request for it returns null and it gets recreated.

Parameters:

  • id String

    ID of the toolkit to reset.