AbstractOptionaldefaults: JsPlumbDefaults<T["E"]>Readonly_ReadonlyconnectionsReadonlygroupReadonlyrouterReadonlyviewportAbstract_Abstract_Abstract_Abstract_AbstractaddAdd an Endpoint to the given element.
Element to add the endpoint to.
Optionalparams: EndpointOptions<T["E"]>OptionalreferenceParams: EndpointOptions<T["E"]>AbstractaddAdd a set of Endpoints to an element
Element to add the Endpoints to.
Array of endpoint options.
OptionalreferenceParams: EndpointOptions<T["E"]>Adds an overlay to the given component, repainting the UI as necessary.
A Connection or Endpoint to add the overlay to
Spec for the overlay
OptionaldoNotRevalidate: booleanDefaults to true. If false, a repaint won't occur after adding the overlay. This flag can be used when adding several overlays in a loop.
AbstractaddRegisters a selector for connection drag on the instance. This is a newer version of the makeSource functionality
that had been in jsPlumb since the early days (and which, in 5.x, has been removed). With this approach, rather than calling makeSource on every element, you
can register a CSS selector on the instance that identifies something that is common to your elements. This will only respond to
mouse/touch events on elements that are managed by the instance.
CSS3 selector identifying child element(s) of some managed element that should act as a connection source.
Optionalparams: BehaviouralTypeDescriptor<any>Options for the source: connector type, behaviour, etc.
Optionalexclude: booleanIf true, the selector defines an 'exclusion': anything except elements that match this.
Registers a selector for connection drag on the instance. This is a newer version of the makeTarget functionality
that has been in jsPlumb since the early days. With this approach, rather than calling makeTarget on every element, you
can register a CSS selector on the instance that identifies something that is common to your elements. This will only respond to
mouse events on elements that are managed by the instance.
CSS3 selector identifying child element(s) of some managed element that should act as a connection target.
Optionalparams: BehaviouralTypeDescriptor<any>Options for the target
Optionalexclude: booleanIf true, the selector defines an 'exclusion': anything except elements that match this.
AbstractapplyAbstractapplySuspend drawing, run the given function, and then re-enable drawing, optionally repainting everything.
Function to run while drawing is suspended.
OptionaldoNotRepaintAfterwards: booleanWhether or not to repaint everything after drawing is re-enabled.
Bind an event listener. This method can be used with a type parameter by call sites; although it's not necessary it can be helpful to use this to ensure you've thought about what the payload to your event handler is going to be.
Connect one element to another.
At the very least you need to supply a source and target.
OptionalreferenceParams: ConnectParams<T["E"]>Optional extra parameters. This can be useful when you're creating multiple connections that have some things in common.
Delete the given connection.
Connection to delete.
Optionalparams: DeleteConnectionOptionsOptional extra parameters.
Delete all connections attached to the given element.
Optionalparams: DeleteConnectionOptionsDelete the given endpoint.
Either an Endpoint, or the UUID of an Endpoint.
Optionalparams: DeleteConnectionOptionsClears the instance and unbinds any listeners on the instance. After you call this method you cannot use this instance of jsPlumb again.
AbstractdestroyAbstractdestroyAbstractdrawOptionalabsolutePosition: PointXYOptionalparams: ConnectionMovedParams<any>Optionalevt: EventAbstractgetAbstractgetOptionaloptions: SelectOptions<T["E"]>Optionalflat: booleanAbstractgetAbstractgetAbstractgetOptionaluuid: stringGets all listeners for the given named event.
Gets the element with the given ID from the list managed elements, null if not currently managed.
Gets all of the elements managed by this instance.
AbstractgetAbstractgetAbstractgetAbstractgetAbstractgetRetrieve an endpoint or connection type by its id.
AbstracthasOptionalchangeEndpoints: booleanImport the given set of defaults to the instance.
Returns whether or not hover is currently suspended.
Returns whether not event firing is currently suspended
Manage an element. Adds the element to the viewport and sets up tracking for endpoints/connections for the element, as well as enabling dragging for the
element. This method is called internally by various methods of the jsPlumb instance, such as connect, addEndpoint, makeSource and makeTarget,
so if you use those methods to setup your UI then you may not need to call this. However, if you use the addSourceSelector and addTargetSelector methods
to configure your UI then you will need to register elements using this method, or they will not be draggable.
Element to manage. This method does not accept a DOM element ID as argument. If you wish to manage elements via their DOM element ID,
you should use manageAll and pass in an appropriate CSS selector that represents your element, eg #myElementId.
OptionalinternalId: stringOptional ID for jsPlumb to use internally. If this is not supplied, one will be created.
Optional_recalc: booleanMaybe recalculate offsets for the element also. It is not recommended that clients of the API use this parameter; it's used in certain scenarios internally
Manage a group of elements.
AbstractoffAbstractonAbstractreattachRegister a connection type: a set of connection attributes grouped together with an ID.
Register a set of connection types
Set of types to register.
Register an endpoint type: a set of endpoint attributes grouped together with an ID.
Register a set of endpoint types
Set of types to register.
Remove every endpoint registered to the given element.
Element to remove endpoints for.
Optionalrecurse: booleanIf true, also remove endpoints for elements that are descendants of this element.
Remove all groups from this instance of jsPlumb
OptionaldeleteMembers: booleanOptional_manipulateView: booleanNot for public usage. Used internally.
AbstractremoveAbstractremoveAbstractremoveAbstractremoveRemove a group from this instance of jsPlumb.
Group to remove
OptionaldeleteMembers: booleanWhether or not to also delete any members of the group. If this is false (the default) then group members will be removed before the group is deleted.
Optional_manipulateView: booleanNot for public usage. Used internally.
Optional_doNotFireEvent: booleanNot recommended for public usage, used internally.
Remove the overlay with the given id from the given component.
Component to remove the overlay from.
ID of the overlay to remove.
AbstractremoveAbstractrenderRepaints all connections and endpoints associated with the given element, without recomputing the element
size and position. If you want to first recompute element size and position you should call revalidate(el) instead,
Element to repaint.
Optionaltimestamp: stringOptional parameter used internally to avoid recalculating offsets multiple times in one paint.
OptionaloffsetsWereJustCalculated: booleanIf true, we don't recalculate the offsets of child elements of the element we're repainting.
Repaint every connection and endpoint in the instance.
Clears all endpoints and connections from the instance of jsplumb. Does not also clear out event listeners, selectors, or
connection/endpoint types - for that, use destroy().
Reset the instance defaults to the defaults computed by the constructor.
Updates position/size information for the given element and redraws its Endpoints and their Connections. Use this method when you've made a change to some element that may have caused the element to change its position or size and you want to ensure the connections are in the right place.
Element to revalidate.
Optionaltimestamp: stringOptional, used internally to avoid recomputing position/size information if it has already been computed.
Sets rotation for the element to the given number of degrees (not radians). A value of null is treated as a rotation of 0 degrees.
Element to rotate
Amount to totate
Optional_doNotRepaint: booleanFor internal use.
Optionalparams: SelectOptions<T["E"]>Optionalparams: SelectEndpointOptions<T["E"]>AbstractsetAbstractsetSets the type of a connection and then repaints it.
Optionalparams: anyAbstractsetSets the position of the given element to be [x,y].
Element to set the position for
Position in X axis
Position in Y axis
The result of the redraw operation that follows the update of the viewport.
AbstractsetSet an endpoint's uuid, updating the internal map
AbstractsetAbstractsetAbstractsetSets color, outline color, line width and outline width. Any values for which the key is present will not be set, but if the key is present and the value is null, the corresponding value in the connection's paint style will be set to null.
AbstractsetAbstractsetAbstractsetChange the source of the given connection to be the given endpoint or element.
Sets whether or not drawing is suspended.
Optionalval: booleanTrue to suspend, false to enable.
OptionalrepaintAfterwards: booleanIf true, repaint everything afterwards.
Sets whether not event firing is currently suspended
Change the target of the given connection to be the given endpoint or element.
OptionalrepaintEverything: booleanOptionalchangeEndpoints: booleanAbstracttoggleprivate method to do the business of toggling hiding/showing.
OptionalchangeEndpoints: booleanAbstracttriggerUnbind the given event listener, or all listeners. If you call this method with no arguments then all event listeners are unbound.
Stops managing the given element, removing it from internal tracking and clearing the custom attribute that is added by jsPlumb to mark it as managed. This method fires an 'element:unmanage' event containing the unmanaged element and its managed id.
Element, or ID of the element to stop managing.
OptionalremoveElement: booleanIf true, also remove the element from the renderer.
AbstractupdateUpdate the cached offset information for some element.
Optionalparams: UpdateOffsetOptionsan UpdateOffsetResult containing the offset information for the given element.
Base class for classes that wish to support binding and firing of events.
Remarks
You need to implement the
shouldFireEventmethod in your concrete subclasses of this class, or you can instead extend fromOptimisticEventGenerator, which has a default implementation ofshouldFireEventthat returns true.