C

SubgraphLayoutStageData<TNode, TEdge, TNodeLabel, TEdgeLabel>

Specifies custom data for the SubgraphLayoutStage.
Inheritance Hierarchy

Members

Show:

Constructors

Parameters

Properties

Gets or sets the collection of subgraph edge labels that are included in the graph, thus, are visible for the coreLayout of the SubgraphLayoutStage.

If nothing is set, all edge labels of the graph will be included in the subgraph.

If only the excludes are set, all edge labels in the graph except those provided in the excludes are part of the subgraph.

Note that edge labels are automatically excluded if the associated edge is not in the subgraphEdges.

conversionfinal

See Also

API
subgraphEdges, SUBGRAPH_EDGE_LABELS_DATA_KEY
Gets or sets the collection of subgraph edges that are included in the graph, thus, are visible for the coreLayout of the SubgraphLayoutStage.

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.

conversionfinal

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>:

Setting a collection of subgraph edges
layoutData.subgraphEdges = graphComponent.selection.edges

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:

Adding individual subgraph edges
layoutData.subgraphEdges.items.add(edge1)
layoutData.subgraphEdges.items.add(edge2)

A powerful option that doesn't use a collection is to use the predicate to set a custom delegate that returns for every edge whether it is contained in the subgraph or not:

Using a delegate to determine whether an edge is in the subgraph or not
// We assume here that all edges have a data instance as their tag,
// which then has a boolean property 'includeInSubgraph'.
layoutData.subgraphEdges = (edge) => edge.tag.includeInSubgraph

To only exclude specific edges, the excludes property can be used:

Excluding two specific edges using a delegate
// In this example two specific edges are excluded
layoutData.subgraphEdges.excludes = (edge) =>
  excludedEdge1 === edge || excludedEdge2 === edge

See Also

API
SUBGRAPH_EDGES_DATA_KEY
Gets or sets the collection of subgraph node labels that are included in the graph, thus, are visible for the coreLayout of the SubgraphLayoutStage.

If nothing is set, all node labels of the graph will be included in the subgraph.

If only the excludes are set, all node labels in the graph except those provided in the excludes are part of the subgraph.

Note that node labels are automatically excluded if the associated node is not in the subgraphNodes.

conversionfinal

See Also

API
subgraphNodes, SUBGRAPH_NODE_LABELS_DATA_KEY
Gets or sets the collection of subgraph nodes that are included in the graph, thus, are visible for the coreLayout of the SubgraphLayoutStage.

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.

conversionfinal

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>:

Setting a collection of subgraph nodes
layoutData.subgraphNodes = graphComponent.selection.nodes

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:

Adding individual subgraph nodes
layoutData.subgraphNodes.items.add(node1)
layoutData.subgraphNodes.items.add(node2)

A powerful option that doesn't use a collection is to use the predicate to set a custom delegate that returns for every node whether it is contained in the subgraph or not:

Using a delegate to determine whether a node is in the subgraph or not
// We assume here that all nodes have a data instance as their tag,
// which then has a boolean property 'includeInSubgraph'.
layoutData.subgraphNodes = (node) => node.tag.includeInSubgraph

To only exclude specific nodes, the excludes property can be used:

Excluding two specific nodes using a delegate
// In this example two specific nodes are excluded
layoutData.subgraphNodes.excludes = (node) =>
  excludedNode1 === node || excludedNode2 === node

See Also

API
SUBGRAPH_NODES_DATA_KEY

Methods

Combines this instance with the given layout data.
This keeps the current instance unmodified and instead returns a new instance that dynamically combines the contents of all involved instances.
final

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