C

EdgeScopeData<TNode, TEdge, TNodeLabel, TEdgeLabel, TEdgeScope>

This custom data provides two item collections to specify the scope of layout algorithms with regard to edges.
Inheritance Hierarchy

Remarks

The two collections can be used in combination with each other. In this case they are combined permissively, that is if e.g. an edge is not contained in the collection edges but one of its incident nodes is contained in the collection incidentNodes, the edge is considered to be in scope.

This class cannot be instantiated

Type Parameters

TNode

TEdge

TNodeLabel

TEdgeLabel

TEdgeScope

Members

Show:

Properties

A collection of edges that should be considered to be in scope by layout algorithms that allow restricting the edges affected by them.
conversionfinal

Examples

The affected edges can be specified using the items property when only a few known edges should be affected:

Setting edges as affected individually
scopeData.edges.items.add(edge1)
scopeData.edges.items.add(edge2)

It's also possible to pass an existing collection of affected edges:

Setting a collection of affected edges
scopeData.edges = graphComponent.selection.edges

In cases where looking at the edge itself is sufficient to determine whether an edge is in scope, it's often easier to just set a delegate instead:

Using a delegate to set edges as affected
// We assume here that all edges have a CustomData instance as their tag,
// which then has a boolean property 'IncludeInLayout'.
scopeData.edges = (edge) => (edge.tag as CustomData).includeInLayout
A collection of nodes whose incident edges should be considered to be in scope by layout algorithms that allow restricting the edges affected by them.
conversionfinal

Examples

The incident nodes can be specified using the items property when only the edges of a few known nodes should be affected:

Setting incident nodes as affected individually
scopeData.incidentNodes.items.add(node1)
scopeData.incidentNodes.items.add(node2)

It's also possible to pass an existing collection of incident nodes:

Setting a collection of incident nodes
scopeData.incidentNodes = graphComponent.selection.nodes

In cases where looking at the node itself is sufficient to determine whether its incident edges are in scope, it's often easier to just set a delegate instead:

Using a delegate to set incident nodes as affected
// We assume here that all nodes have a CustomData instance as their tag,
// which then has a boolean property 'IncludeInLayout'.
scopeData.incidentNodes = (node) =>
  (node.tag as CustomData).includeInLayout

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