mxHierarchicalLayout

A hierarchical layout algorithm.

Summary
mxHierarchicalLayoutA hierarchical layout algorithm.
Functions
mxHierarchicalLayoutConstructs a new hierarchical layout algorithm.
Variables
rootsHolds the array of mxCell that this layout contains.
resizeParentSpecifies if the parent should be resized after the layout so that it contains all the child cells.
maintainParentLocationSpecifies if the parent location should be maintained, so that the top, left corner stays the same before and after execution of the layout.
moveParentSpecifies if the parent should be moved if resizeParent is enabled.
parentBorderThe border to be added around the children if the parent is to be resized using resizeParent.
intraCellSpacingThe spacing buffer added between cells on the same layer.
interRankCellSpacingThe spacing buffer added between cell on adjacent layers.
interHierarchySpacingThe spacing buffer between unconnected hierarchies.
parallelEdgeSpacingThe distance between each parallel edge on each ranks for long edges
orientationThe position of the root node(s) relative to the laid out graph in.
fineTuningWhether or not to perform local optimisations and iterate multiple times through the algorithm.
tightenToSourceWhether or not to tighten the assigned ranks of vertices up towards the source cells.
disableEdgeStyleSpecifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result.
traverseAncestorsWhether or not to drill into child cells and layout in reverse group order.
modelThe internal mxGraphHierarchyModel formed of the layout.
edgesSetA cache of edges whose source terminal is the key
edgesSetA cache of edges whose source terminal is the key
edgesSetA cache of edges whose source terminal is the key
edgeStyleThe style to apply between cell layers to edge segments
Functions
getModelReturns the internal mxGraphHierarchyModel for this layout algorithm.
executeExecutes the layout for the children of the specified parent.
findRootsReturns all visible children in the given parent which do not have incoming edges.
getEdgesReturns the connected edges for the given cell.
getVisibleTerminalHelper function to return visible terminal for edge allowing for ports
runThe API method used to exercise the layout upon the graph description and produce a separate description of the vertex position and edge routing changes made.
filterDescendantsCreates an array of descendant cells
isPortReturns true if the given cell is a “port”, that is, when connecting to it, its parent is the connecting vertex in terms of graph traversal
getEdgesBetweenReturns the edges between the given source and target.
cycleStageExecutes the cycle stage using mxMinimumCycleRemover.
layeringStageImplements first stage of a Sugiyama layout.
crossingStageExecutes the crossing stage using mxMedianHybridCrossingReduction.
placementStageExecutes the placement stage using mxCoordinateAssignment.

Functions

mxHierarchicalLayout

function mxHierarchicalLayout(graph,
orientation,
deterministic)

Constructs a new hierarchical layout algorithm.

Arguments

graphReference to the enclosing mxGraph.
orientationOptional constant that defines the orientation of this layout.
deterministicOptional boolean that specifies if this layout should be deterministic.  Default is true.

Variables

roots

mxHierarchicalLayout.prototype.roots

Holds the array of mxCell that this layout contains.

resizeParent

mxHierarchicalLayout.prototype.resizeParent

Specifies if the parent should be resized after the layout so that it contains all the child cells.  Default is false.  See also parentBorder.

maintainParentLocation

mxHierarchicalLayout.prototype.maintainParentLocation

Specifies if the parent location should be maintained, so that the top, left corner stays the same before and after execution of the layout.  Default is false for backwards compatibility.

moveParent

mxHierarchicalLayout.prototype.moveParent

Specifies if the parent should be moved if resizeParent is enabled.  Default is false.

parentBorder

mxHierarchicalLayout.prototype.parentBorder

The border to be added around the children if the parent is to be resized using resizeParent.  Default is 0.

intraCellSpacing

mxHierarchicalLayout.prototype.intraCellSpacing

The spacing buffer added between cells on the same layer.  Default is 30.

interRankCellSpacing

mxHierarchicalLayout.prototype.interRankCellSpacing

The spacing buffer added between cell on adjacent layers.  Default is 50.

interHierarchySpacing

mxHierarchicalLayout.prototype.interHierarchySpacing

The spacing buffer between unconnected hierarchies.  Default is 60.

parallelEdgeSpacing

mxHierarchicalLayout.prototype.parallelEdgeSpacing

The distance between each parallel edge on each ranks for long edges

orientation

mxHierarchicalLayout.prototype.orientation

The position of the root node(s) relative to the laid out graph in.  Default is mxConstants.DIRECTION_NORTH.

fineTuning

mxHierarchicalLayout.prototype.fineTuning

Whether or not to perform local optimisations and iterate multiple times through the algorithm.  Default is true.

tightenToSource

mxHierarchicalLayout.prototype.tightenToSource

Whether or not to tighten the assigned ranks of vertices up towards the source cells.

disableEdgeStyle

mxHierarchicalLayout.prototype.disableEdgeStyle

Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result.  Default is true.

traverseAncestors

mxHierarchicalLayout.prototype.traverseAncestors

Whether or not to drill into child cells and layout in reverse group order.  This also cause the layout to navigate edges whose terminal vertices have different parents but are in the same ancestry chain

model

mxHierarchicalLayout.prototype.model

The internal mxGraphHierarchyModel formed of the layout.

edgesSet

A cache of edges whose source terminal is the key

edgesSet

A cache of edges whose source terminal is the key

edgesSet

A cache of edges whose source terminal is the key

edgeStyle

mxHierarchicalLayout.prototype.edgeStyle

The style to apply between cell layers to edge segments

Functions

getModel

mxHierarchicalLayout.prototype.getModel = function()

Returns the internal mxGraphHierarchyModel for this layout algorithm.

execute

mxHierarchicalLayout.prototype.execute = function(parent,
roots)

Executes the layout for the children of the specified parent.

Parameters

parentParent mxCell that contains the children to be laid out.
rootsOptional starting roots of the layout.

findRoots

mxHierarchicalLayout.prototype.findRoots = function(parent,
vertices)

Returns all visible children in the given parent which do not have incoming edges.  If the result is empty then the children with the maximum difference between incoming and outgoing edges are returned.  This takes into account edges that are being promoted to the given root due to invisible children or collapsed cells.

Parameters

parentmxCell whose children should be checked.
verticesarray of vertices to limit search to

getEdges

mxHierarchicalLayout.prototype.getEdges = function(cell)

Returns the connected edges for the given cell.

Parameters

cellmxCell whose edges should be returned.

getVisibleTerminal

mxHierarchicalLayout.prototype.getVisibleTerminal = function(edge,
source)

Helper function to return visible terminal for edge allowing for ports

Parameters

edgemxCell whose edges should be returned.
sourceBoolean that specifies whether the source or target terminal is to be returned

run

mxHierarchicalLayout.prototype.run = function(parent)

The API method used to exercise the layout upon the graph description and produce a separate description of the vertex position and edge routing changes made.  It runs each stage of the layout that has been created.

filterDescendants

mxHierarchicalLayout.prototype.filterDescendants = function(cell,
result)

Creates an array of descendant cells

isPort

mxHierarchicalLayout.prototype.isPort = function(cell)

Returns true if the given cell is a “port”, that is, when connecting to it, its parent is the connecting vertex in terms of graph traversal

Parameters

cellmxCell that represents the port.

getEdgesBetween

mxHierarchicalLayout.prototype.getEdgesBetween = function(source,
target,
directed)

Returns the edges between the given source and target.  This takes into account collapsed and invisible cells and ports.

Parameters

source - target - directed -

cycleStage

mxHierarchicalLayout.prototype.cycleStage = function(parent)

Executes the cycle stage using mxMinimumCycleRemover.

layeringStage

mxHierarchicalLayout.prototype.layeringStage = function()

Implements first stage of a Sugiyama layout.

crossingStage

mxHierarchicalLayout.prototype.crossingStage = function(parent)

Executes the crossing stage using mxMedianHybridCrossingReduction.

placementStage

mxHierarchicalLayout.prototype.placementStage = function(initialX,
parent)

Executes the placement stage using mxCoordinateAssignment.

function mxHierarchicalLayout(graph,
orientation,
deterministic)
Constructs a new hierarchical layout algorithm.
mxHierarchicalLayout.prototype.roots
Holds the array of mxCell that this layout contains.
Cells are the elements of the graph model.
mxHierarchicalLayout.prototype.resizeParent
Specifies if the parent should be resized after the layout so that it contains all the child cells.
mxHierarchicalLayout.prototype.maintainParentLocation
Specifies if the parent location should be maintained, so that the top, left corner stays the same before and after execution of the layout.
mxHierarchicalLayout.prototype.moveParent
Specifies if the parent should be moved if resizeParent is enabled.
mxHierarchicalLayout.prototype.parentBorder
The border to be added around the children if the parent is to be resized using resizeParent.
mxHierarchicalLayout.prototype.intraCellSpacing
The spacing buffer added between cells on the same layer.
mxHierarchicalLayout.prototype.interRankCellSpacing
The spacing buffer added between cell on adjacent layers.
mxHierarchicalLayout.prototype.interHierarchySpacing
The spacing buffer between unconnected hierarchies.
mxHierarchicalLayout.prototype.parallelEdgeSpacing
The distance between each parallel edge on each ranks for long edges
mxHierarchicalLayout.prototype.orientation
The position of the root node(s) relative to the laid out graph in.
mxHierarchicalLayout.prototype.fineTuning
Whether or not to perform local optimisations and iterate multiple times through the algorithm.
mxHierarchicalLayout.prototype.tightenToSource
Whether or not to tighten the assigned ranks of vertices up towards the source cells.
mxHierarchicalLayout.prototype.disableEdgeStyle
Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result.
mxHierarchicalLayout.prototype.traverseAncestors
Whether or not to drill into child cells and layout in reverse group order.
mxHierarchicalLayout.prototype.model
The internal mxGraphHierarchyModel formed of the layout.
Internal model of a hierarchical graph.
mxHierarchicalLayout.prototype.edgeStyle
The style to apply between cell layers to edge segments
mxHierarchicalLayout.prototype.getModel = function()
Returns the internal mxGraphHierarchyModel for this layout algorithm.
mxHierarchicalLayout.prototype.execute = function(parent,
roots)
Executes the layout for the children of the specified parent.
mxHierarchicalLayout.prototype.findRoots = function(parent,
vertices)
Returns all visible children in the given parent which do not have incoming edges.
mxHierarchicalLayout.prototype.getEdges = function(cell)
Returns the connected edges for the given cell.
mxHierarchicalLayout.prototype.getVisibleTerminal = function(edge,
source)
Helper function to return visible terminal for edge allowing for ports
mxHierarchicalLayout.prototype.run = function(parent)
The API method used to exercise the layout upon the graph description and produce a separate description of the vertex position and edge routing changes made.
mxHierarchicalLayout.prototype.filterDescendants = function(cell,
result)
Creates an array of descendant cells
mxHierarchicalLayout.prototype.isPort = function(cell)
Returns true if the given cell is a “port”, that is, when connecting to it, its parent is the connecting vertex in terms of graph traversal
mxHierarchicalLayout.prototype.getEdgesBetween = function(source,
target,
directed)
Returns the edges between the given source and target.
mxHierarchicalLayout.prototype.cycleStage = function(parent)
Executes the cycle stage using mxMinimumCycleRemover.
mxHierarchicalLayout.prototype.layeringStage = function()
Implements first stage of a Sugiyama layout.
mxHierarchicalLayout.prototype.crossingStage = function(parent)
Executes the crossing stage using mxMedianHybridCrossingReduction.
mxHierarchicalLayout.prototype.placementStage = function(initialX,
parent)
Executes the placement stage using mxCoordinateAssignment.
Extends mxEventSource to implement a graph component for the browser.
DIRECTION_NORTH: 'north'
Constant for direction north.
Close