Skip to content
  1. API
  2. Types

NodeGroupingOptions

Type: object

Properties

  • duration(optional) number Animation time in milliseconds. The animation will be played once after the creation of the group. Ignored if enabled is false.
  • edgeGenerator(optional) function(edges: EdgeList, groupId: string, transformation: Transformation): EdgeDataAndAttributes|null If groupEdges is true, indicates the function used to generate the new edges from the sub-edges. Ignored if groupEdges is false. If null is returned, the meta edge will not be created
  • enabled(optional) boolean Indicates if the grouping must be enabled.
  • groupEdges(optional) boolean Indicates if parallel edges that end up having at least one meta-node extremity should be grouped together (to reduce cluttering).
  • groupIdFunction(optional) function(node: Node): string|undefined Given a node, must return a string identifying a group. All nodes for which the function returns the same value will be grouped together. By default group all the nodes that were selected together. Returning undefined means that the node should not be grouped.
  • groupSelfLoopEdges(optional) boolean If true, edges for which the two extremities end up being grouped into the same node will be displayed as a self-loop edge, instead of not being displayed at all.
  • nodeGenerator(optional) function(nodes: NodeList, groupId: string, transformation: Transformation): NodeDataAndAttributes|null Given a list of nodes that should be grouped together, must return the new node (meta-node) to be added. If attributes.x and attributes.y are not specified, the meta-node will be put at the center of the nodes. If null is returned, the meta-node will not be created.
  • onCreated(optional) function(metaNode: Node, showContents: boolean, subNodes: NodeList, subEdges: EdgeList): Promise<any>|undefined This is a callback called after a new group is created. See {@link ./tutorials/grouping/index.html | here} for more details.
  • padding(optional) number|function(metaNode: Node): number Padding applied to groups showing their content. If a function is passed, each MetaNode will get a padding depending on that function.
  • restorePositions(optional) boolean When the grouping is disabled/destroyed, indicates if the nodes should be positioned back around the meta-node position
  • selector(optional) function(node: Node): boolean Only nodes that match this criteria will be grouped with other nodes. By default, all the nodes will be assigned a group.
  • separateEdgesByDirection(optional) boolean By default, edges that have opposite source and target are grouped together (resulting source and target not deterministic). If this option is true, they will not be grouped together.
  • showContents(optional) function(metaNode: Node): boolean | boolean Function that would define if the contents of the group node should be hidden or not. This is called on every transformation update.