Interface ConnectParams<E>

Options for the connect call on a JsPlumbInstance

interface ConnectParams<E> {
    anchor?: AnchorSpec;
    anchors?: [AnchorSpec, AnchorSpec];
    connector?: ConnectorSpec;
    cost?: number;
    deleteEndpointsOnDetach?: boolean;
    deleteEndpointsOnEmpty?: boolean;
    detachable?: boolean;
    directed?: boolean;
    endpoint?: EndpointSpec;
    endpointHoverStyle?: EndpointStyle;
    endpointHoverStyles?: [EndpointStyle, EndpointStyle];
    endpointStyle?: EndpointStyle;
    endpointStyles?: [EndpointStyle, EndpointStyle];
    endpoints?: [EndpointSpec, EndpointSpec];
    hoverPaintStyle?: PaintStyle;
    label?: string;
    overlays?: OverlaySpec[];
    paintStyle?: PaintStyle;
    parameters?: Record<string, any>;
    ports?: [string, string];
    reattach?: boolean;
    source?: E | Endpoint<E>;
    target?: E | Endpoint<E>;
    type?: string;
}

Type Parameters

  • E

Hierarchy (view full)

Properties

anchor?: AnchorSpec

Spec for the anchor to use for both source and target endpoints.

anchors?: [AnchorSpec, AnchorSpec]

Individual anchor specs for the source/target endpoints.

connector?: ConnectorSpec

Spec for the connector used to paint the connection.

cost?: number

Cost of the connection. Defaults to 1.

deleteEndpointsOnDetach?: boolean

Whether or not to delete the connection's endpoints when this connection is detached. Defaults to false. Does not delete endpoints if they have other connections.

deleteEndpointsOnEmpty?: boolean

Whether or not to delete any endpoints that were created by this connect call if at some point in the future the endpoint has no remaining connections. Defaults to false.

detachable?: boolean

Whether or not the connection is detachable. Defaults to true.

directed?: boolean

Whether or not the connection is considered to be 'directed'

endpoint?: EndpointSpec

Spec for the endpoint to use for both source and target endpoints.

endpointHoverStyle?: EndpointStyle

Spec for the styles to use on both source and target endpoints when they are in hover state

endpointHoverStyles?: [EndpointStyle, EndpointStyle]

Individual specs for the source/target endpoint styles when they are in hover state.

endpointStyle?: EndpointStyle

Spec for the styles to use on both source and target endpoints

endpointStyles?: [EndpointStyle, EndpointStyle]

Individual specs for the source/target endpoint styles.

endpoints?: [EndpointSpec, EndpointSpec]

Individual endpoint specs for the source/target endpoints.

hoverPaintStyle?: PaintStyle

Paint style for the connector when in hover mode.

label?: string

Optional label to set on the connection. In the default browser UI implementation this is rendered as a label attribute on the SVG element representing the connection.

overlays?: OverlaySpec[]

Optional list of overlays to attach to the connection.

paintStyle?: PaintStyle

Paint style for the connector.

parameters?: Record<string, any>

Optional extra parameters to associate with the connection

ports?: [string, string]

Optional port IDs for the source and target endpoints

reattach?: boolean

Whether or not to reattach this connection automatically should it be detached via user intervention. Defaults to false.

source?: E | Endpoint<E>

Source for the connection - an Endpoint, or an element

target?: E | Endpoint<E>

Source for the connection - an Endpoint, or an element

type?: string

Type of the connection. Used in conjunction with the registerConnectionType method.