PortMapping
Definition of a port inside a view.
Extends
NodeOrPortMapping<E,Port,PortEventOptions<E>>
Type Parameters
E
E
Properties
allowLoopback?
optionalallowLoopback:boolean
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.
Inherited from
NodeOrPortMapping.allowLoopback
allowVertexLoopback?
optionalallowVertexLoopback:boolean
Whether or not to allow edges from a port back to the vertex it belongs to. Defaults to true.
Inherited from
NodeOrPortMapping.allowVertexLoopback
anchor?
optionalanchor:AnchorSpec
Spec for anchors connected to this port
anchorOffsetX?
optionalanchorOffsetX:number
Offset, in pixels, to apply to the position in the x axis after the anchorX value has been used to compute its default position.
anchorOffsetY?
optionalanchorOffsetY:number
Offset, in pixels, to apply to the position in the y axis after the anchorY value has been used to compute its default position.
anchorOrientationX?
optionalanchorOrientationX:number
The orientation in the x axis for connections attached to an anchor created for this port.
anchorOrientationY?
optionalanchorOrientationY:number
The orientation in the y axis for connections attached to an anchor created for this port.
anchorPositionFinder?
optionalanchorPositionFinder:AnchorPositionFinder<any>
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 VisuallyJs will use its own computed value.
Inherited from
NodeOrPortMapping.anchorPositionFinder
anchorPositions?
optionalanchorPositions:ObjectAnchorSpec[]
Optional array of anchor positions to use.
Inherited from
NodeOrPortMapping.anchorPositions
anchorX?
optionalanchorX:number
The x location of any anchors created for this port. Allows you to specify where, in proportional values, the anchor should be located in the x axis. For a full discussion of how to use this (and the other anchor properties in this interface), see the documentation for anchors.
anchorY?
optionalanchorY:number
The y location of any anchors created for this port. Allows you to specify where, in proportional values, the anchor should be located in the y axis.
edgeType?
optionaledgeType:string
Type of edges generated by this port.
Overrides
events?
optionalevents:EVT
Optional map of event bindings.
Inherited from
isSource?
optionalisSource:boolean
Whether or not the port can act as a source for dragged connections. Defaults to false.
isTarget?
optionalisTarget:boolean
Whether or not the port can act as a target for dragged connections. Defaults to false.
maxConnections?
optionalmaxConnections:number
Maximum number of connections this vertex supports. Default is 1. A value of -1 means no limit.
Inherited from
NodeOrPortMapping.maxConnections
mergeStrategy?
optionalmergeStrategy:string
When merging a type description into its parent(s), values in the child for connector, anchor and anchors will always overwrite any such values in the parent. But other values, such as overlays, will be merged with their parent's entry for that key. You can force a child's type to override every corresponding value in its parent by setting mergeStrategy:'override'.
Inherited from
NodeOrPortMapping.mergeStrategy
parameters?
optionalparameters:Record<string,any>
A map of parameters that the template engine will merge with the backing data when rendering the vertex.
Inherited from
parent?
optionalparent:string|string[]
Optional ID of one or more edge definitions to include in this definition. The child definition is merged on top of the parent definition(s). Circular references are not allowed and will throw an error.
Inherited from
template?
optionaltemplate:string
Template to use for a vertex of this type. This is only for 'vanilla' VisuallyJs: 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.
Inherited from
templateId?
optionaltemplateId:string
ID of the template to use for a vertex of this type. This is only for 'vanilla' VisuallyJs: 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 VisuallyJs 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.
Inherited from
templateIdResolver()?
optionaltemplateIdResolver: (data,ui,model,object) =>string
A function that can resolve the ID of the template to use for the given vertex. This is an advanced configuration that is not often needed, and is only for 'vanilla' VisuallyJs. This function will take precedence over both template and templateId.
Parameters
data
ui
UICore<E>
model
object
Returns
string