Home > @jsplumbtoolkit/browser-ui > BehaviouralTypeDescriptor
BehaviouralTypeDescriptor interface
Extends EndpointTypeDescriptor to add the options supported by an addSourceSelector
or addTargetSelector
call.
Signature:
export interface BehaviouralTypeDescriptor<T = any> extends EndpointTypeDescriptor
Extends: EndpointTypeDescriptor
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
allowLoopback? | boolean | (Optional) Defaults to true. If false, the user will not be permitted to drag a connection from the current node to itself. | |
anchorPositionFinder? | (el: Element, elxy: PointXY, def: BehaviouralTypeDescriptor, e: Event) => AnchorSpec | null | (Optional) This function offers a means for you to provide the anchor to use for a new drag, or a drop. You're given the source/target element, the proportional location on the element that the drag started/drop occurred, the associated type descriptor, and the originating event. Return null if you don't wish to provide a value, and any other return value will be treated as an AnchorSpec. | |
canAcceptNewConnection? | (el: Element, e: Event) => boolean | (Optional) Optional function that is used to determine whether at the start of a drag, a given element is able to accept new connections. For a source element returning false from here aborts the connection drag. For a target element returning false from here means the target element is not active as a drop target. | |
edgeType? | string | (Optional) Optional type for connections dragged from a source selector. This option is ignored for target selectors. | |
extract? | Record<string, string> | (Optional) Optional set of values to extract from an element when a drag starts from that element. For target selectors this option is ignored. | |
onMaxConnections? | (value: any, event?: any) => any | (Optional) Optional function to call if the user begins a new connection drag when the associated element is full. | |
parameterExtractor? | (el: T, eventTarget: T, event: Event) => Record<string, any> | (Optional) A function that can be used to extract a set of parameters pertinent to the connection that is being dragged from a given source or dropped on a given target. | |
parentSelector? | string | (Optional) Optional selector identifying the ancestor of the event target that could be the element to which connections are added. By default this is the internal attribute jsPlumb uses to mark managed elements (data-jtk-managed) | |
portId? | string | (Optional) Optional logical id for the endpoint associated with a source or target selector. | |
rank? | number | (Optional) Optional rank for a given source or target selector. When selecting a selector from a list of candidates, rank can be used to prioritise them. Higher values take precedence. | |
redrop? | RedropPolicy | (Optional) Optional policy for dropping existing connections that have been detached by their source/target. - 'strict' ( - 'any' ( - 'anySource' ( - 'anyTarget' ( - 'anySourceOrTarget' ( | |
source? | boolean | (Optional) Whether or not an endpoint created from this definition should subsequently behave as a source for dragging connections with the mouse. | |
target? | boolean | (Optional) Whether or not an endpoint created from this definition should subsequently behave as a target for dragging connections with the mouse. | |
uniqueEndpoint? | boolean | (Optional) If true, only one endpoint will be created on any given element for this type descriptor, and subsequent connections will all attach to that endpoint. Defaults to false. |