Specifies custom data for the SubgraphLayout.
Examples
The following example shows how to create a new instance of this class and use it in conjunction with a MultiStageLayout that has a SubgraphLayout already in its pipeline:
The SubgraphLayout and its SubgraphLayoutData can be used as a stage with any other layout algorithm:
Type Details
- yfiles module
- view-layout-bridge
- yfiles-umd modules
- view-layout-bridge
- Legacy UMD name
- yfiles.layout.SubgraphLayoutData
Constructors
Creates a new instance of SubgraphLayoutData which helps configuring SubgraphLayout.
Parameters
A map of options to pass to the method.
- subgraphNodes - DpKeyItemCollection<INode>
The collection of subgraph nodes that are included in the graph, thus, are visible for the core layout algorithm of the SubgraphLayout. This option sets the subgraphNodes property on the created object.
- subgraphEdges - DpKeyItemCollection<IEdge>
The collection of subgraph edges that are included in the graph, thus, are visible for the core layout algorithm of the SubgraphLayout. This option sets the subgraphEdges property on the created object.
Properties
Gets or sets the collection of subgraph edges that are included in the graph, thus, are visible for the core layout algorithm of the SubgraphLayout.
Remarks
If nothing is set, all edges of the graph will be included in the subgraph.
If only the excludes are set all edges in the graph except those provided in the excludes are part of the subgraph.
Note that edges which start or end at nodes which are not in the subgraphNodes are automatically excluded.
Examples
Defining the subgraph edges can be done in various ways, mostly depending on which option is more convenient for a particular use case. You can use the ItemCollection<TItem>'s source property to use any .NET collection or IEnumerable<T>:
Alternatively, ItemCollection<TItem> also has an items property, which is a collection that already exists, in case the items may have to be added one by one. This can be more convenient than defining an own list and setting it to source:
A powerful option that doesn't use a collection is to use the delegate to set a custom delegate that returns for every edge whether it is contained in the subgraph or not:
To only exclude specific edges, the excludes property can be used:
See Also
Gets or sets the collection of subgraph nodes that are included in the graph, thus, are visible for the core layout algorithm of the SubgraphLayout.
Remarks
If nothing is set, all nodes of the graph will be included in the subgraph.
If only the excludes are set all nodes in the graph except those provided in the excludes are part of the subgraph.
Examples
Defining the subgraph nodes can be done in various ways, mostly depending on which option is more convenient for a particular use case. You can use the ItemCollection<TItem>'s source property to use any .NET collection or IEnumerable<T>:
Alternatively, ItemCollection<TItem> also has an items property, which is a collection that already exists, in case the items may have to be added one by one. This can be more convenient than defining an own list and setting it to source:
A powerful option that doesn't use a collection is to use the delegate to set a custom delegate that returns for every node whether it is contained in the subgraph or not:
To only exclude specific nodes, the excludes property can be used:
See Also
Methods
Combines this instance with the given layout data.
Remarks
Parameters
A map of options to pass to the method.
- data - LayoutData
- The LayoutData to combine this instance with.
Returns
- ↪LayoutData
- The combined layout data.