C

RadialGroupLayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>

Specifies custom data for the RadialGroupLayout.
Inheritance Hierarchy

Members

Show:

Constructors

Parameters

Properties

Gets or sets a comparison function used to sort the child nodes of parent nodes.
If no comparison function is specified, the child nodes are sorted according to the number of leaves they contain, placing the largest subtrees in the center and smaller subtrees towards the beginning and end of the order.
The specified comparison function is ignored if fromSketchMode is enabled.
final

See Also

Developer's Guide
API
fromSketchMode
Gets or sets the roots of collapsed subtrees in the hierarchy.
By default, all children of a group node are placed on its border and their respective descendants are arranged recursively. If a group node is part of the collapsedSubtreeRoots, all descendants of the node are placed depending on whether they are inner nodes or leaves. Inner nodes are positioned at the center of the node whereas leaves are placed on its border in place of child nodes. The entries of leaf nodes in the hierarchy have no effect.
conversionfinal

Examples

The items property can be used to easily define several nodes as roots of collapsed subtrees:

Defining two specific nodes as roots of collapsed subtrees
layoutData.collapsedSubtreeRoots.items.add(subtreeRoot1)
layoutData.collapsedSubtreeRoots.items.add(subtreeRoot2)

Alternatively, a delegate can be used to decide which nodes are roots of collapsed subtrees based on custom user data:

Defining roots of collapsed subtrees by using a custom data tag
layoutData.collapsedSubtreeRoots = (node: INode) =>
  node.tag.isCollapsedSubtreeRoot

Sample Graphs

ShownSetting: false

See Also

Developer's Guide
API
COLLAPSED_SUBTREE_ROOTS_DATA_KEY
Gets or sets the mapping of edges to their EdgeBundleDescriptor when using edgeBundling.

Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the source and target point, the edges are again clearly split.

If an edge is mapped to null, the default descriptor is used.

conversionfinal

See Also

API
EdgeBundleDescriptor, edgeBundling
Gets or sets the mapping from nodes to their margins.
Node margins allow to reserve space around nodes.
conversionfinal

Examples

The easiest option is to reserve the same space around all nodes, by setting a constant value:

Using constant space around all nodes
layoutData.nodeMargins = new Insets(20)

Handling only certain nodes differently can be done easily by using the mapper property:

Using a mapper to set margins for certain nodes
// node1 only reserves space above and below
layoutData.nodeMargins.mapper.set(node1, new Insets(20, 10, 0, 0))
// node2 has space all around
layoutData.nodeMargins.mapper.set(node2, new Insets(25))
// all other nodes don't get extra space

In cases where the nodeMargins for each node can be determined by looking at the node itself it's often easier to just set a mapperFunction instead of preparing a mapper:

Using a delegate to determine margins for all nodes
// Retrieve the space around the node from its tag property
layoutData.nodeMargins = (node: INode): Insets =>
  new Insets(parseFloat(node.tag))

See Also

Developer's Guide
API
NODE_MARGIN_DATA_KEY
Gets or sets the mapping from nodes to the overlap they have with their parent in the hierarchy.
Generally, the RadialGroupLayout places all child nodes in the hierarchy such that they are touching their respective parent node. However, an overlap can be specified as a fraction of the child's radius, by which the node will be moved towards the parent node's center.
If this property is not specified, the algorithm assumes that all nodes have the value 0.2.
The overlap ratios must be within the range [0, 1].
conversionfinal

Examples

The overlap ratio can be changed globally for all nodes by using a constant as follows:

Globally set the overlap ratio to 0.5
layoutData.parentOverlapRatios = 0.5

Handling only certain nodes differently can be done by using the mapper property:

Defining a different overlap ratio for two specific child nodes
layoutData.parentOverlapRatios.mapper.set(child1, 1.0)
layoutData.parentOverlapRatios.mapper.set(child2, 0.5)

Sample Graphs

ShownSetting: 0.0

See Also

Developer's Guide
API
PARENT_OVERLAP_RATIO_DATA_KEY
Gets or sets the sub-data that provides a way of influencing the placement of the ports.

The port placement can be influenced by specifying EdgePortCandidates for the source and target of an edge, as well as by specifying NodePortCandidates at the nodes.

In addition, it is possible to specify that ports should be grouped at the source or target.

If both EdgePortCandidates and NodePortCandidates are specified, the layout algorithm tries to match them. An edge port candidate matches a node port candidate if

  • Their matchingIds are equal or one type is null,
  • They belong to a common side or one side is ANY, and
  • If both candidates are fixed, they describe the same positions.

The position of a port candidate is defined by offset or the actual offset of the edge endpoint for fixed-from-sketch candidates. When there is no match, the port candidate with the lowest costs specified for the edge is chosen.

The RadialGroupLayout does not natively support port placement constraints. Support is provided through additional pre- and postprocessing by the PortPlacementStage, which is added to the layoutStages and enabled by default.
final

Methods

Combines this instance with the given layout data.
This keeps the current instance unmodified and instead returns a new instance that dynamically combines the contents of all involved instances.
final

Parameters

data: LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>
The LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> to combine this instance with.

Return Value

LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>
The combined layout data.

See Also

Developer's Guide
API
CompositeLayoutData, GenericLayoutData