Class LayeredDigraphLayout

This arranges nodes into layers. The method uses a hierarchical approach for creating drawings of digraphs with nodes arranged in layers. The layout algorithm consists of four-major steps: Cycle Removal, Layer Assignment, Crossing Reduction, and Straightening and Packing.

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): LayeredDigraphLayout

Constructs a LayeredDigraphLayout with no Layout#network and with no owning Layout#diagram.

Returns

LayeredDigraphLayout

Properties

public static AggressiveLess: EnumValue

The faster, less aggressive, crossing reduction algorithm; a valid value for LayeredDigraphLayout#aggressiveOption.

public static AggressiveMore: EnumValue

The slower, more aggressive, crossing reduction algorithm, a valid value for LayeredDigraphLayout#aggressiveOption.

public static AggressiveNone: EnumValue

The fastest, but poorest, crossing reduction algorithm; a valid value for LayeredDigraphLayout#aggressiveOption.

public static CycleDepthFirst: EnumValue

Remove cycles using depth first cycle removal; a valid value of LayeredDigraphLayout#cycleRemoveOption.

public static CycleGreedy: EnumValue

Remove cycles using greedy cycle removal; a valid value of LayeredDigraphLayout#cycleRemoveOption.

public static InitDepthFirstIn: EnumValue

Initialize using depth first in initialization; a valid value for LayeredDigraphLayout#initializeOption.

public static InitDepthFirstOut: EnumValue

Initialize using depth first out initialization; a valid value for LayeredDigraphLayout#initializeOption.

public static InitNaive: EnumValue

Initialize using naive initialization; a valid value for LayeredDigraphLayout#initializeOption.

public static LayerLongestPathSink: EnumValue

Assign layers using longest path sink layering; a valid value for LayeredDigraphLayout#layeringOption.

public static LayerLongestPathSource: EnumValue

Assign layers using longest path source layering; a valid value for LayeredDigraphLayout#layeringOption.

public static LayerOptimalLinkLength: EnumValue

Assign layers using optimal link length layering; A valid value for LayeredDigraphLayout#layeringOption.

public static PackAll: number

Enable all options for the LayeredDigraphLayout#packOption property; See also LayeredDigraphLayout#PackExpand, LayeredDigraphLayout#PackStraighten, and LayeredDigraphLayout#PackMedian.

public static PackExpand: number

This option gives more chances for the packing algorithm to improve the network, but is very expensive in time for large networks; a valid value for LayeredDigraphLayout#packOption.

public static PackMedian: number

This option tries to have the packing algorithm center groups of nodes based on their relationships with nodes in other layers, a valid value for LayeredDigraphLayout#packOption.

public static PackNone: number

Does minimal work in packing the nodes; a valid value for LayeredDigraphLayout#packOption.

public static PackStraighten: number

This option tries to have the packing algorithm straighten many of the links that cross layers, a valid value for LayeredDigraphLayout#packOption.

public aggressiveOption: EnumValue

Gets or sets which aggressive option is being used to look for link crossings.

public arrangementOrigin: Point

Gets or sets the top-left point for where the graph should be positioned when laid out.

public columnSpacing: number

Gets or sets the size of each column.

public cycleRemoveOption: EnumValue

Gets or set which cycle removal option is used.

public diagram: Diagram

Gets the Diagram that owns this layout, if it is the value of Diagram#layout.

public direction: number

Gets or sets the direction the graph grows towards.

public group: Group

Gets the Group that uses this layout, if it is the value of a group's Group#layout.

public initializeOption: EnumValue

Gets or sets which indices initialization option is being used.

public isInitial: boolean

Gets or sets whether this layout is performed on an initial layout.

public isOngoing: boolean

Gets or sets whether this layout can be invalidated by #invalidateLayout.

public isRealtime: boolean

Gets or sets whether this layout be performed in real-time, before the end of a transaction.

public isRouting: boolean

Gets or sets whether this layout routes Links.

public isValidLayout: boolean

Gets or sets whether this layout needs to be performed again.

public isViewportSized: boolean

Gets or sets whether this layout depends on the Diagram#viewportBounds's size.

public iterations: number

Gets or sets the number of iterations to be done.

public layerSpacing: number

Gets or sets the size of each layer.

public layeringOption: EnumValue

Gets or sets which layering option is being used.

public maxColumn: number

Gets the largest column value.

public maxIndex: number

Gets the largest index value.

public maxIndexLayer: number

Gets the larges index layer.

public maxLayer: number

Gets the largest layer value.

public minIndexLayer: number

Gets the smallest index layer.

public newtork: LayoutNetwork

Gets or sets the LayoutNetwork used by this Layout, if any.

public packOption: number

Gets or sets the options used by the straighten and pack function, The default value is LayeredDigraphLayout#PackAll.

public setsPortSpots: boolean

Gets or sets whether the FromSpot and ToSpot of each link should be set to values appropriate for the given value of LayeredDigraphLayout#direction.

Methods

public assignLayers(): any

Assigns every vertex in the input network to a layer.

Returns

any

public commitLayout(): any

Updates the physical location of "real" nodes and links to reflect the layout.

Returns

any

public commitLinks(): any

Routes the links.

Returns

any

public commitNodes(): any

Lays out the nodes.

Returns

any

public copy(): Layout

Creates a copy of this Layout and returns it.

Returns

Layout

public createNetwork(): LayoutNetwork

Create a new LayoutNetwork of LayeredDigraphVertexes and LayeredDigraphEdges.

Returns

LayoutNetwork

public doLayout(coll: Diagram): any

Assign the positions of the vertexes in the network.

Parameters

  • coll: Diagram

    A Diagram or a Group or a collection of Parts.

Returns

any

public doLayout(coll: Group): any

Parameters

Returns

any

public doLayout(coll: Iterable): any

Parameters

Returns

any

public invalidateLayout(): any

If #isOngoing is true and if an initial layout has not yet been performed, set the #isValidLayout property to false, and ask to perform another layout in the near future.

Returns

any

public makeNetwork(coll: Diagram): LayoutNetwork

Create and initialize a LayoutNetwork with the given nodes and links.

Parameters

  • coll: Diagram

    A Diagram or a Group or a collection of Parts.

Returns

LayoutNetwork

public makeNetwork(coll: Group): LayoutNetwork

Parameters

Returns

LayoutNetwork

public makeNetwork(coll: Iterable): LayoutNetwork

Parameters

Returns

LayoutNetwork

public updateParts(): any

When using a LayoutNetwork, update the "physical" node positionings and link routings.

Returns

any