Skip to main content

Home > @jsplumbtoolkit/browser-ui > ViewNodeOrPortOptions

ViewNodeOrPortOptions interface

Base view definition options for nodes and ports (and groups, since they extend nodes)

Signature:

export interface ViewNodeOrPortOptions extends ViewOptionsCommon 

Extends: ViewOptionsCommon

Properties

PropertyModifiersTypeDescription
allowLoopback?boolean(Optional) Whether or not to allow edges from this vertex back to itself. Defaults to true. This flag will not prevent an edge from a port back to the node/group to which it belongs - for that, see allowVertexLoopback.
allowVertexLoopback?boolean(Optional) Whether or not to allow edges from a port back to the vertex it belongs to. Defaults to true.
anchorPositionFinder?(el: Element, pos: PointXY, vertex: Node | Group, def: ViewNodeOptions, evt: Event) => ArrayAnchorSpec | null(Optional) Optional function to call on connection drop, to determine the location for the target anchor for the new connection. Returning null from this indicates no preference, and the Toolkit will use its own computed value. Note that the return value from this method is ArrayAnchorSpec, meaning an array in the format [ x, y, orientationX, orientationY, offsetX, offsetY ]. Note also that offsetX and offsetY are optional, and will be defaulted to 0.
maxConnections?number(Optional) Maximum number of connections this vertex supports. Default is 1. A value of -1 means no limit.
parameters?Record<string, any>(Optional) A map of parameters that the template engine will merge with the backing data when rendering the vertex.
template?string(Optional) Template to use for a vertex of this type. This is only for 'vanilla' Toolkit: if you are using an integration such as React/Angular/Vue/Svelte, you will not need to provide this. If you provide this and also templateId, this will take precedence.
templateId?string(Optional) ID of the template to use for a vertex of this type. This is only for 'vanilla' Toolkit: if you are using an integration such as React/Angular/Vue, you will not need to provide this. This parameter is distinct from template in that when you provide templateId you are expecting the Toolkit to resolve the template for you, either from a templates block in a render call, or by looking for a script element in the DOM with the appropriate ID. If you provide this and also template, template will take precedence.