Skip to main content

DiagramGroupMapping

A group mapping in a Diagram. Intended for advanced use cases where you need fine-grained controls over groups, and the config options available in cells are not granular enough.

Extends

Properties

allowLoopback?

optional allowLoopback: 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?

optional allowVertexLoopback: 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?

optional anchor: AnchorSpec

Spec for the anchor to use for connections to children of the group when they are transferred to the group in its collapsed state.

Inherited from

GroupMapping.anchor


anchorPositionFinder?

optional anchorPositionFinder: 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

VertexMapping.anchorPositionFinder


anchorPositions?

optional anchorPositions: ObjectAnchorSpec[]

Optional array of anchor positions to use.

Inherited from

VertexMapping.anchorPositions


autoGrow?

optional autoGrow: boolean

Defaults to false, meaning that the group will not be resized if an item addition/removal or drag causes the bounds of the child members to change and the new size is greater than the previous size.

Inherited from

GroupMapping.autoGrow


autoShrink?

optional autoShrink: boolean

False by default. If true indicates that if a child member is dragged/added/removed and the group's size is recalculated to be smaller than the previous size, the new size should be applied. This also works if the group needs to shrink from its left and/or top edge. If you don't want that behaviour, set allowShrinkFromOrigin to false.

Inherited from

GroupMapping.autoShrink


autoSize?

optional autoSize: boolean

False by default. This flag switches on both autoShrink and autoGrow and also enables support for shrinking a group from its left or top edge

Inherited from

GroupMapping.autoSize


canDrop()?

optional canDrop: (v) => boolean

Optional interceptor that will be invoked to test whether a given node/group may be dropped onto this group.

Parameters

v

Node | Group

Returns

boolean

Inherited from

Omit.canDrop


collapsedSize?

optional collapsedSize: Size

The size to use for this group type when it is collapsed.

Inherited from

GroupMapping.collapsedSize


constrain?

optional constrain: boolean

False by default - nodes/groups may be dragged outside of the bounds of the group.

Inherited from

GroupMapping.constrain


defaultSize?

optional defaultSize: Size

Optional default size to use for the vertex. This is not used to set the size in the DOM for a vertex - it is used to insert width and height values into the backing data for any vertex of this type that does not have them set.

Inherited from

Omit.defaultSize


edgeType?

optional edgeType: string

Type to assign to edges connected to this vertex as a source.

Inherited from

VertexMapping.edgeType


elastic?

optional elastic: boolean

Similar to autoGrow, but the UI shows a visual prompt when a group will be resized as a result of dragging a child.

Inherited from

GroupMapping.elastic


elementsDraggable?

optional elementsDraggable: boolean

True by default - indicates that child members may be dragged around inside the group.

Inherited from

GroupMapping.elementsDraggable


events?

optional events: GroupEventOptions<EL>

Optional map of event bindings.

Inherited from

Omit.events


fitToGrid?

optional fitToGrid: boolean

When sizing the group, ensure it fits the underlying grid, if there is one.

Inherited from

GroupMapping.fitToGrid


layout?

optional layout: object

Options for the group's layout.

options?

optional options: LayoutParameters

type

type: string

Inherited from

Omit.layout


locked?

optional locked: boolean

Whether or not the group is locked.

Inherited from

GroupMapping.locked


maxConnections?

optional maxConnections: number

Maximum number of connections this vertex supports. Default is 1. A value of -1 means no limit.

Inherited from

VertexMapping.maxConnections


maxSize?

optional maxSize: Size

Maximum size the group can grow to. If not specified the group can grow to an arbitrary size. Note that this behaviour can also be enforced via CSS.

Inherited from

GroupMapping.maxSize


mergeStrategy?

optional mergeStrategy: 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

BaseViewObjectMapping.mergeStrategy


minSize?

optional minSize: Size

Minimum size the group can be.

Inherited from

GroupMapping.minSize


padding?

optional padding: number

Optional padding to set inside a group when computing an auto size.

Inherited from

GroupMapping.padding


parameters?

optional parameters: Record<string, any>

A map of parameters that the template engine will merge with the backing data when rendering the vertex.

Inherited from

NodeOrPortMapping.parameters


parent?

optional parent: 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

BaseViewObjectMapping.parent


templateIdResolver()?

optional templateIdResolver: (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

ObjectData

ui

UICore<BrowserElement>

model

VisuallyJsModel

object

Vertex

Returns

string

Inherited from

Omit.templateIdResolver