Members
Constructors
Properties
Gets or sets the mapping of edges to LayoutAnchoringPolicy values, specifying which part of the edge should be used to calculate the anchor point.
- The default policy for an edge is NONE, indicating the edge is not used.
- If a single edge is used, it retains its exact coordinates, while the surrounding graph adjusts during layout.
- If multiple items are used, an initial anchor point between them is calculated. After the coreLayout algorithm returns, the graph is moved as a whole, to where an anchor point calculated in the same way coincides with the initial anchor point.
Examples
The most common use case is to anchor the graph at a specific edge. In this case, using mapper is appropriate:
layoutData.edgeAnchoringPolicies.mapper.set(
anchorEdge,
LayoutAnchoringPolicy.UPPER_LEFT,
)However, if you need the properties of the edges or their user data to determine if they should be declared as anchor edges, it is often better to use mapperFunction. This option is also particularly good when all edges of a specific set should be used as anchor edges:
layoutData.edgeAnchoringPolicies = (edge) =>
graphComponent.selection.includes(edge)
? LayoutAnchoringPolicy.CENTER
: LayoutAnchoringPolicy.NONEIf you want to anchor the graph as a whole, using mapperFunction is the best choice:
layoutData.edgeAnchoringPolicies = LayoutAnchoringPolicy.UPPER_LEFTSee Also
Gets or sets the mapping of edge labels to LayoutAnchoringPolicy values, specifying which part of the edge label should be used to calculate the anchor point.
- The default policy for an edge label is NONE, indicating the label is not used.
- If a single edge label is used, it retains its exact coordinates, while the surrounding graph adjusts during layout.
- If multiple items are used, an initial anchor point between them is calculated. After the coreLayout algorithm returns, the graph is moved as a whole, to where an anchor point calculated in the same way coincides with the initial anchor point.
Examples
The most common use case is to anchor the graph at a specific edge label. In this case, using mapper is appropriate:
layoutData.edgeLabelAnchoringPolicies.mapper.set(
anchorLabel,
LayoutAnchoringPolicy.UPPER_LEFT,
)However, if you need the properties of the edge labels or their user data to determine if they should be declared as anchor labels, it is often better to use mapperFunction. This option is also particularly good when all edge labels of a specific set should be anchor labels:
layoutData.edgeLabelAnchoringPolicies = (label) =>
graphComponent.selection.includes(label)
? LayoutAnchoringPolicy.CENTER
: LayoutAnchoringPolicy.NONEIf you want to anchor the graph as a whole, using mapperFunction is the best choice:
layoutData.edgeLabelAnchoringPolicies = LayoutAnchoringPolicy.UPPER_LEFTSee Also
Gets or sets the mapping of nodes to LayoutAnchoringPolicy values, specifying which part of the node should be used to calculate the anchor point.
- The default policy for a node is NONE, indicating the node is not used.
- If a single node is used, it retains its exact coordinates, while the surrounding graph adjusts during layout.
- If multiple items are used, an initial anchor point between them is calculated. After the coreLayout algorithm returns, the graph is moved as a whole, to where an anchor point calculated in the same way coincides with the initial anchor point.
Examples
The most common use case is to anchor the graph at a specific node. In this case, using mapper is appropriate:
layoutData.nodeAnchoringPolicies.mapper.set(
anchorNode,
LayoutAnchoringPolicy.UPPER_LEFT,
)However, if you need the properties of the nodes or their user data to determine if they should be declared as anchor nodes, it is often better to use mapperFunction. This option is also particularly good when all nodes of a specific set should be used as anchor nodes:
layoutData.nodeAnchoringPolicies = (node) =>
graphComponent.selection.includes(node)
? LayoutAnchoringPolicy.CENTER
: LayoutAnchoringPolicy.NONEIf you want to anchor the graph as a whole, using mapperFunction is the best choice:
layoutData.nodeAnchoringPolicies = LayoutAnchoringPolicy.UPPER_LEFTSample Graphs
See Also
Gets or sets the mapping of node labels to LayoutAnchoringPolicy values, specifying which part of the node label should be used to calculate the anchor point.
- The default policy for a node label is NONE, indicating the label is not used.
- If a single node label is used, it retains its exact coordinates, while the surrounding graph adjusts during layout.
- If multiple items are used, an initial anchor point between them is calculated. After the coreLayout algorithm returns, the graph is moved as a whole, to where an anchor point calculated in the same way coincides with the initial anchor point.
Examples
The most common use case is to anchor the graph at a specific node label. In this case, using mapper is appropriate:
layoutData.nodeLabelAnchoringPolicies.mapper.set(
anchorLabel,
LayoutAnchoringPolicy.UPPER_LEFT,
)However, if you need the properties of the node labels or their user data to determine if they should be declared as anchor labels, it is often better to use mapperFunction. This option is also particularly good when all node labels of a specific set should be anchor labels:
layoutData.nodeLabelAnchoringPolicies = (label) =>
graphComponent.selection.includes(label)
? LayoutAnchoringPolicy.CENTER
: LayoutAnchoringPolicy.NONEIf you want to anchor the graph as a whole, using mapperFunction is the best choice:
layoutData.nodeLabelAnchoringPolicies = LayoutAnchoringPolicy.UPPER_LEFTSee Also
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