Specifies custom data for the FillAreaLayout.
Inheritance Hierarchy
LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>
FillAreaLayoutData
Type Parameters
- TNode
- TEdge
- TNodeLabel
- TEdgeLabel
Type Details
- yFiles module
- algorithms
Constructors
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- fixedNodes - ItemCollection<TNode>
- The collection of nodes that are fixed and must not be moved. This option either sets the value directly or recursively sets properties to the instance of the fixedNodes property on the created object.
- componentIds - ItemMapping<TNode,any>
- The mapping from nodes to an object defining their component id. This option either sets the value directly or recursively sets properties to the instance of the componentIds property on the created object.
- nodeMargins - ItemMapping<TNode,Insets>
- The mapping from nodes to their margins. This option either sets the value directly or recursively sets properties to the instance of the nodeMargins property on the created object.
- layoutGridData - LayoutGridData<TNode,TEdge,TNodeLabel,TEdgeLabel>
- The LayoutGrid layout data. This option either sets the value directly or recursively sets properties to the instance of the layoutGridData property on the created object.
Properties
Gets or sets the mapping from nodes to an object defining their component id.
Remarks
Nodes of the same component should preferably not be separated. While the algorithm may move a whole component, it should try to not move only a subset of its elements. This means that the algorithm tries to move all elements of a component by the same offset (if at all). In order to achieve good results with this feature, the different components should not overlap in the initial drawing.
See Also
If custom components are specified, the componentAssignmentStrategy will be ignored.
If the input graph contains group nodes or a LayoutGrid structure, maintaining the specified components is not always possible. Furthermore, a custom component can never pass the border of a group node or layout grid cell, i.e., all nodes of a custom component have to be associated with the same group or grid cell.
Gets or sets the collection of nodes that are fixed and must not be moved.
See Also
The algorithm tries to preserve the mental map and, thus, non-fixed nodes cannot simply pass/jump over the fixed nodes (i.e. fixed nodes restrict the possible movement of non-fixed nodes).
Gets or sets the LayoutGrid layout data.
Gets or sets the mapping from nodes to their margins.
Remarks
Node margins allow to reserve space around nodes.
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 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:
// Retrieve the space around the node from its tag property
layoutData.nodeMargins = (node: INode): Insets =>
new Insets(parseFloat(node.tag))
See Also
Methods
combineWith
(data: LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>…) : LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>Combines this instance with the given layout data.
Remarks
This keeps the current instance unmodified and instead returns a new instance that dynamically combines the contents of all involved instances.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- data - LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>
- The LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> to combine this instance with.
Returns
- ↪LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>
- The combined layout data.
See Also
CompositeLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>,
GenericLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>