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.
  • easing(optional) EasingFunction[="quadraticOut"] Grouping animation easing function.
  • edgeGenerator(optional) function(edges: EdgeList, groupId: string, transformation: Transformation): EdgeDataAndAttributes If groupEdges is true, indicates the function used to generate the new edges from the sub-edges. Ignored if groupEdges is false.
  • 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 Given a list of nodes that should be grouped together, must return the new node (meta-node) to be added. GeoClustering will compute automatically the coordinate of the clusters.
  • onGroupUpdate(optional) function(metaNode: Node, subNodes: NodeList, isOpen: boolean): Promise<any> This is a callback allowing you to layout the content of an open group. It should return a promise that resolves when the layout is done, or a Promise containing an array of positions for each node in the group.
  • 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.