Members
Constructors
Properties
See Also
Developer's Guide
API
- fromSketchMode
Gets or sets the roots of collapsed subtrees in the hierarchy.
Examples
The items property can be used to easily define several 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:
layoutData.collapsedSubtreeRoots = (node: INode) =>
node.tag.isCollapsedSubtreeRootSample Graphs
falseSee 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.
See Also
Gets or sets the mapping from nodes to their margins.
Examples
The easiest option is to reserve the same space around all nodes, by setting a constant value:
layoutData.nodeMargins = new Insets(20)Handling only certain nodes differently can be done easily by using the mapper property:
// 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 spaceIn 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:
// 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.
0.2.[0, 1].Examples
The overlap ratio can be changed globally for all nodes by using a constant as follows:
layoutData.parentOverlapRatios = 0.5Handling only certain nodes differently can be done by using the mapper property:
layoutData.parentOverlapRatios.mapper.set(child1, 1.0)
layoutData.parentOverlapRatios.mapper.set(child2, 0.5)Sample Graphs
0.0See 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.
Methods
combineWith
(data: LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>): LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>Combines this instance with the given layout data.
combineWith
(data: LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>): LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>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