C

LayoutGraphSequenceConstraints

This low-level helper class helps with the reading and writing sequence constraints for elements in a graph.
Inheritance Hierarchy

Remarks

Sequence constraints affect the sequence of nodes and edges within a layer.

Instead of using this class, it is recommended to define sequence constraints more conveniently via the layout data property sequenceConstraints.

This class cannot be instantiated

See Also

Developer's Guide

Members

No filters for this type

Properties

Returns whether any constraints are defined.

readonlyfinal

Methods

Gets all the currently registered constraints as a tuple consisting of the source item, the constraint and the target item (can be null).
final

Return Value

IEnumerable<any[]>
A collection of tuples representing all registered constraints. The first item is the item for which the constraint is defined, the second item is the constraint itself and the third item is the relational other item. The other item can be null if the constraint is one that does not need such an item.

Returns whether any constraints are defined for the given item.

final

Parameters

item: LayoutGraphItem

The item to check for

Return Value

boolean

true if constraints are defined for the given item, false otherwise

Adds a constraint that places the given item at the start of the sequence.
For edges, this constraint applies to each layer that the edge spans including the edge's source and target.
If there are groups or swimlanes, there are implicit constraints on the edges, e.g., the edge path never leaves the bounds of the group that is the common ancestor of the edge's endpoints. Furthermore, if both endpoints of an edge are associated with the same swimlane, the route does never leave this lane. Such constraints cannot be affected by sequence constraints.
final

Parameters

item: any
the node or edge that should be placed at the start
Adds a constraint that places the given item at the end of the sequence.
For edges, this constraint applies to each layer that the edge spans including the edge's source and target.
If there are groups or swimlanes, there are implicit constraints on the edges, e.g., the edge path never leaves the bounds of the group that is the common ancestor of the edge's endpoints. Furthermore, if both endpoints of an edge are associated with the same swimlane, the route does never leave this lane. Such constraints cannot be affected by sequence constraints.
final

Parameters

item: any
the node or edge that should be placed at the end
Adds a constraint that forces the firstItem to lie before the secondItem.
A constraint is only considered if both elements share at least one layer.
final

Parameters

firstItem: any
the first item
secondItem: any
the second item, which should be placed after the first item

Removes the constraint defined for the given source item, ordering constraint, and target item.

This method does nothing if there is no constraint defined for the given combination of source item, target item, and ordering constraint.

final

Parameters

sourceItem: LayoutGraphItem

the source item

orderingConstraint: OrderingConstraint

the ordering constraint

targetItem: LayoutGraphItem

the target item or null if there is none for this constraint

Return Value

void
Disposes of all constraints modified via this instance (if it was created using createEmpty or createWritableCopy) and restores the state of the constraints before creation of this instance.

Restore should always be called at some point where constraints were modified.

If this instance is a read-only one created via createReadonlyView, then this method has no effect.

final

Static Methods

Creates an empty, modifiable constraints instance and registers the constraints with the given graph.
static

Parameters

graph: LayoutGraph
The graph for which the newly created empty constraints instance is registered.

Return Value

LayoutGraphSequenceConstraints
An empty, modifiable instance.
Factory that reads the current state from the given graph's context.
If no information is associated with the graph, the returned instance will be empty. Note that you should not modify this instance - it is considered read-only.
static

Parameters

graph: LayoutGraph
The graph to read the data from.

Return Value

LayoutGraphSequenceConstraints
A read-only, potentially empty instance that contains the constraints associated with this graph.
Factory that reads the current state from the given graph's context and copies it to a mutable instance.

Newly created constraints on the writable copy are automatically registered for the given graph without destroying the old constraints (if some existed).

If no information was associated with the graph, the returned instance will be empty.

static

Parameters

graph: LayoutGraph
The graph to read and copy the initial data from.

Return Value

LayoutGraphSequenceConstraints
A writable, potentially empty instance that contains the constraints associated with this graph.

See Also

API
createReadonlyView