C

ContextModificationStage

Temporarily modifies the LayoutGraphContext for the following layout algorithms.

Remarks

The ContextModificationStage can be used to temporarily hide, replace, or transfer data registered with the LayoutGraphContext using data keys. Common applications for this stage include applying multiple instances of the same ILayoutAlgorithm with e.g. different affected graph elements.

Context data can be hidden by this stage, in which case the coreLayout has no access to the data and resorts to the specified default behavior. Alternatively, the data can be replaced, in which case the coreLayout accesses the specified replacement data instead. In either case, all modifications to the context made by this stage are reversed after the coreLayout has returned.

The modifications to the context are applied in the same order in which they are added to this ContextModificationStage, so it is possible to, for example, transfer the data registered with one key to another and then hide the data on the original key afterward.

Default Values of Properties

NameDefault
coreLayoutnull

Members

Show:

Constructors

Creates a new ContextModificationStage with the given algorithm as coreLayout or null if no core layout is specified.

Parameters

coreLayout?: ILayoutAlgorithm
the core layout algorithm

Properties

Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
final

Property Value

the core layout routine

Default Value

The default value is: null
Gets or sets a value that determines whether this stage should do anything but execute the coreLayout.

By default, when constructed, stages should be enabled. Users may disable a stage's functionality by setting this property to false.

Stages that can guarantee that the graph will not change can choose to not even execute the coreLayout when disabled.

final

Methods

Adds the specified keys as a pair of keys whose associated data should be transferred.
final

Parameters

sourceKey: NodeDataKey<T>
The key whose associated data should temporarily be transferred
targetKey: NodeDataKey<T>
The key to which the data should temporarily be transferred
Adds the specified keys as a pair of keys whose associated data should be transferred.
final

Parameters

sourceKey: EdgeDataKey<T>
The key whose associated data should temporarily be transferred
targetKey: EdgeDataKey<T>
The key to which the data should temporarily be transferred
Adds the specified keys as a pair of keys whose associated data should be transferred.
final

Parameters

sourceKey: NodeLabelDataKey<T>
The key whose associated data should temporarily be transferred
targetKey: NodeLabelDataKey<T>
The key to which the data should temporarily be transferred
Adds the specified keys as a pair of keys whose associated data should be transferred.
final

Parameters

sourceKey: EdgeLabelDataKey<T>
The key whose associated data should temporarily be transferred
targetKey: EdgeLabelDataKey<T>
The key to which the data should temporarily be transferred
Adds the specified key to the data keys whose associated data is temporarily hidden by this stage.
final

Parameters

key: NodeDataKey<T>
the key whose associated data should temporarily be hidden

Throws

Exception ({ name: 'ArgumentError' })
if the specified key is null
Adds the specified key to the data keys whose associated data is temporarily hidden by this stage.
final

Parameters

key: EdgeDataKey<T>
the key whose associated data should temporarily be hidden

Throws

Exception ({ name: 'ArgumentError' })
if the specified key is null
Adds the specified key to the data keys whose associated data is temporarily hidden by this stage.
final

Parameters

key: NodeLabelDataKey<T>
the key whose associated data should temporarily be hidden

Throws

Exception ({ name: 'ArgumentError' })
if the specified key is null
Adds the specified key to the data keys whose associated data is temporarily hidden by this stage.
final

Parameters

key: EdgeLabelDataKey<T>
the key whose associated data should temporarily be hidden

Throws

Exception ({ name: 'ArgumentError' })
if the specified key is null
Adds the specified layout data to be temporarily applied by this stage.
final

Parameters

data: LayoutData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>
the layout data to be temporarily applied
Adds the specified key to the data keys whose associated data is temporarily replaced by this stage.
final

Parameters

key: NodeDataKey<T>
The key whose associated data should temporarily be replaced
mapper: IMapper<LayoutNode, T>
The mapper that should replace the data registered with the specified key

Throws

Exception ({ name: 'ArgumentError' })
If the specified key is null
Adds the specified key to the data keys whose associated data is temporarily replaced by this stage.
final

Parameters

key: EdgeDataKey<T>
The key whose associated data should temporarily be replaced
mapper: IMapper<LayoutEdge, T>
The mapper that should replace the data registered with the specified key

Throws

Exception ({ name: 'ArgumentError' })
If the specified key is null
Adds the specified key to the data keys whose associated data is temporarily replaced by this stage.
final

Parameters

key: NodeLabelDataKey<T>
The key whose associated data should temporarily be replaced
mapper: IMapper<LayoutNodeLabel, T>
The mapper that should replace the data registered with the specified key

Throws

Exception ({ name: 'ArgumentError' })
If the specified key is null
Adds the specified key to the data keys whose associated data is temporarily replaced by this stage.
final

Parameters

key: EdgeLabelDataKey<T>
The key whose associated data should temporarily be replaced
mapper: IMapper<LayoutEdgeLabel, T>
The mapper that should replace the data registered with the specified key

Throws

Exception ({ name: 'ArgumentError' })
If the specified key is null
Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
This implementation checks the enabled state and when it's not enabled, will delegate to the coreLayout, directly. When the stage is enabled, all the work will be delegated to applyLayoutImpl, instead.
final

Parameters

graph: LayoutGraph
The graph to apply the layout to.
Temporarily modifies the LayoutGraphContext for the coreLayout run.
protected

Parameters

graph: LayoutGraph
the input graph