Skip to main content

Home > @jsplumb/core > Connection

Connection class#

Signature:

export declare class Connection<E = any> extends Component 

Extends: Component

Remarks#

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Connection class.

Properties#

PropertyModifiersTypeDescription
connectorAbstractConnector
costnumberConnection's cost.
defaultLabelLocationnumber
detachablebooleanWhether or not this connection is detachable
directedbooleanWhether or not the connection is directed.
endpointHoverStylePaintStyle
endpointHoverStyles[PaintStyle, PaintStyle]
endpoints[Endpoint<E>, Endpoint<E>]Source and target endpoints.
endpointSpecEndpointSpec
endpointsSpec[EndpointSpec, EndpointSpec]
endpointStylePaintStyle
endpointStyles[PaintStyle, PaintStyle]
instanceJsPlumbInstance
previousConnectionConnection
reattachbooleanWhether or not this connection should be reattached if it were detached via the mouse
scopestring
sourceEThe element that is the source of the connection
sourceIdstringThe id of the source of the connection
targetEThe element that is the target of the connection
targetIdstringThe id of the target of the connection
typestaticstring
typeIdstring
uuids[string, string]UUIDs of the endpoints. If this is not specifically provided in the constructor of the connection it will be null.

Methods#

MethodModifiersDescription
addClass(c, cascade)Adds the given class to the UI elements being used to represent this connection's connector, and optionally to the UI elements representing the connection's endpoints.
applyType(t, typeMap)
getDefaultOverlayKey()
getIdPrefix()
getTypeDescriptor()
getUuids()
getXY()
isDetachable(ep)
isReattach()
makeEndpoint(isSource, el, elId, anchor, ep)
removeClass(c, cascade)Removes the given class from the UI elements being used to represent this connection's connector, and optionally from the UI elements representing the connection's endpoints.
replaceEndpoint(idx, endpointDef)Replace the Endpoint at the given index with a new Endpoint. This is used by the Toolkit edition, if changes to an edge type cause a change in Endpoint.
setConnector(connectorSpec, doNotRepaint, doNotChangeListenerComponent, typeId)
setDetachable(detachable)
setReattach(reattach)
setVisible(v)Sets the visible state of the connection.