Specifies custom data for the ClearAreaLayout.
Type Parameters
- TNode
- TEdge
- TNodeLabel
- TEdgeLabel
Type Details
- yFiles module
- algorithms
See Also
Constructors
Parameters
A map of options to pass to the method.
- expandedNode - ItemCollection<TNode>
- The node that was expanded and, thus, defines the area that must be cleared. This option either sets the value directly or recursively sets properties to the instance of the expandedNode property on the created object.
- expandedNodeOriginalBounds - IRectangle
- The original, non-expanded bounds of the expandedNode. This option sets the expandedNodeOriginalBounds property on the created object.
- expandedNodeOriginalEdgePaths - ItemMapping<TEdge,IEnumerable<IPoint>>
- The mapping from edges adjacent to the expandedNode to their original edge paths, that is, their paths before the node was expanded. This option either sets the value directly or recursively sets properties to the instance of the expandedNodeOriginalEdgePaths property on the created object.
- areaNodes - ItemCollection<TNode>
- The collection of nodes that define the area which must be cleared. This option either sets the value directly or recursively sets properties to the instance of the areaNodes property on the created object.
- areaGroupNode - ItemCollection<TNode>
- The group node inside which the cleared area should be located. This option either sets the value directly or recursively sets properties to the instance of the areaGroupNode 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.
- ports - BasicPortData<TNode,TEdge,TNodeLabel,TEdgeLabel>
- The sub-data that provides a way of influencing the placement of the ports. This option either sets the value directly or recursively sets properties to the instance of the ports 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.
- sourceGroupIds - ItemMapping<TEdge,any>
- A mapping from edges to an object representing their source edge group. This option either sets the value directly or recursively sets properties to the instance of the sourceGroupIds property on the created object.
- targetGroupIds - ItemMapping<TEdge,any>
- A mapping from edges to an object representing their target edge group. This option either sets the value directly or recursively sets properties to the instance of the targetGroupIds property on the created object.
Properties
Gets or sets the group node inside which the cleared area should be located.
Remarks
The area that is cleared of elements can be associated to one specific group node. This means that this group can grow because the free space must be created inside it. In consequence, all ancestor nodes of the group may grow, too. Other groups are treated as fixed and must be moved in order to avoid an overlap with the specified area.
If no group is specified, the free space will be created in the top-level hierarchy.
If multiple group nodes are provided, the first valid group is used. This can be useful when multiple components of the graph are handled independently, using e.g. ComponentLayout.
See Also
Sample Graphs
Gets or sets the collection of nodes that define the area which must be cleared.
Remarks
These nodes define a sort of component from which the area that must be cleared is derived by calling method createAreaOutline This means that the area will exactly be defined by the current locations of these nodes (including the edges among them) such that after the algorithm execution there will not be any other elements intersecting with them.
Carefully observe that if group nodes are marked, all their descendants are treated as area nodes too. For example, if a folder node was expanded (and became a group node) then it suffices to only mark the group to get the effect that the area covered by it and all its descendants is cleared.
The areaGroupNode can not be defined manually, but the nearest common ancestor of all area nodes will become the area group node. For group nodes other than the area group either all their descendants including the group itself must be area nodes or all their descendants including the group must not be area nodes. If the input is not complete in this matter, the required nodes are internally automatically treated as area nodes too.
See Also
Sample Graphs
Gets or sets the mapping from nodes to an object defining their component id.
Remarks
See Also
Gets or sets the node that was expanded and, thus, defines the area that must be cleared.
Remarks
When an expanded node is provided, the area that must be cleared is directly derived from the size of the expanded node. Defining an expanded node is intended for the case that a node's size increased such that it might now overlap with other graph elements. This includes the use case of expanding a folder node.
It is strongly recommended to additionally provide the original (smaller) bounds of the expanded node via property expandedNodeOriginalBounds. If the node has incident edges, it is also recommended to provide the original paths of these edges via expandedNodeOriginalEdgePaths. The original paths are the edge paths before the size of the node was changed (for example, before expanding a folder node). This includes paths of edges that were only incident to the non-expanded node and are now incident to descendants of it. Using this knowledge the algorithm clears the area occupied by the expanded node but also considers how the layout looked before the change. This way the mental map may be preserved to a higher degree.
If multiple nodes are provided, the first valid node is used. This can be useful when multiple components of the graph are handled independently, using e.g. ComponentLayout.
See Also
Gets or sets the original, non-expanded bounds of the expandedNode.
Remarks
See Also
Gets or sets the mapping from edges adjacent to the expandedNode to their original edge paths, that is, their paths before the node was expanded.
Remarks
When an expanded node is provided, the area that must be cleared is directly derived from the bounds of the expanded node. The original paths together with the original, non-expanded (smaller) bounds (expandedNodeOriginalBounds) of the expanded node are helpful to preserve the mental map of the overall drawing by providing knowledge about the previous layout state. Note, however, that only strategies PRESERVE_SHAPES, PRESERVE_SHAPES_UNIFORM and GLOBAL will significantly profit from it.
Carefully observe that the original paths must correspond to the ones that were valid when the expanded node still had its original, non-expanded bounds. Thus, they should only be provided when the original bounds are provided too. Also note that it is recommended that this mapping includes edges that are not adjacent to the expanded node anymore but were adjacent when it was in non-expanded state.
See Also
Gets or sets the LayoutGrid layout data.
Gets or sets the mapping from nodes to their margins.
Remarks
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
Gets or sets the sub-data that provides a way of influencing the placement of the ports.
Remarks
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.
If both EdgePortCandidates and NodePortCandidates are specified, the layout algorithm tries to match them. The exact procedure depends on the specified edgeRouter.
In addition, it is possible to specify that ports should be grouped at the source or target.
The ClearAreaLayout considers port grouping information only during the rerouting of edges using the specified edgeRouter. The applied routing algorithm must support port grouping for port group IDs to have an effect. Furthermore, if edges are not altered by the ClearAreaLayout and not port-grouped in the input layout, then they will not be changed only to satisfy the port grouping.
See Also
Gets or sets a mapping from edges to an object representing their source edge group.
Remarks
Edges sharing a source group identifier share a common bus near the source or at a common source node.
The ClearAreaLayout considers edge grouping information only during the rerouting of edges using the specified edgeRouter. The applied routing algorithm must support edge grouping for this property to have an effect. Furthermore, if edges are not altered by ClearAreaLayout and not grouped in the input layout, then they will not be changed only to satisfy the edge grouping.
See Also
Gets or sets a mapping from edges to an object representing their target edge group.
Remarks
Edges sharing a target group identifier share a common bus near the target or at a common target node.
The ClearAreaLayout considers edge grouping information only during the rerouting of edges using the specified edgeRouter. The applied routing algorithm must support edge grouping for this property to have an effect. Furthermore, if edges are not altered by ClearAreaLayout and not grouped in the input layout, then they will not be changed only to satisfy the edge grouping.
See Also
Methods
combineWith
(data: LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>…) : LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>Combines this instance with the given layout data.
Remarks
Parameters
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.