C

WeightedLayerAssigner

This class implements the layering phase of the HierarchicalLayout (i.e., the assignment of the nodes to layers).
ImplementsInheritance Hierarchy

Remarks

It first makes the directed graph acyclic. Then, it assigns the layers such that edge weights are respected. A weight defines a minimum distance between the two end points of an edge.

Default Values of Properties

NameDefaultDescription
stopDurationTimeSpan.MAX_VALUE
The layout algorithm runs unrestricted.
weightedCycleRemovalfalse
The DFS-based approach is used.

See Also

Developer's Guide

Members

Show:

Constructors

Creates an instance of WeightedLayerAssigner with unlimited stop duration and the given key that provides access to the IMapper<K, V> that holds the edge weights.

Parameters

key?: EdgeDataKey<number>
The key to access the IMapper<K, V> that holds the edge weights. If omitted, edge weights are considered to be uniform.

Properties

Gets or sets the time limit set for the layout algorithm.
Values have to be greater than or equal to ZERO.
Restricting the stop duration may result in a lower layout quality. Furthermore, the real runtime may exceed the specified duration since the layout algorithm still has to find a valid solution.
conversionfinal

Property Value

a non-negative value that specifies the time limit

Throws

Exception ({ name: 'ArgumentError' })
if the stop duration is negative

Default Value

The default value is: TimeSpan.MAX_VALUE
The layout algorithm runs unrestricted.
Gets or sets whether or not the edges that need to be reversed are determined using an edge weight-based heuristic or using a depth-first search-based approach.
The weight-based approach may result in fewer reversed edges (especially for cases with many multi-edges) whereas the DFS-based approach is likely to be faster.
final

Property Value

true if an edge weight-based heuristic is used; false if a DFS-based approach is used

Default Value

The default value is: false
The DFS-based approach is used.

Methods

Assigns all nodes of the graph to layers and adds them to the layers in the given layoutContext.
final

Parameters

graph: LayoutGraph
The input graph
layoutContext: HierarchicalLayoutContext
The HierarchicalLayoutContext used for querying information about the nodes and edges
Returns the edge weight of the given edge using the weight based cycle removal heuristic.

By default, all edges are considered to have weight 1.0.

It may be overridden if non-uniform weights are desired.

protected

Parameters

edge: LayoutEdge
given edge

Return Value

number
the edge weight of the specified edge

See Also

API
weightedCycleRemoval, weightedCycleRemoval