mxHierarchicalLayout

A hierarchical layout algorithm.

Summary
mxHierarchicalLayoutA hierarchical layout algorithm.
Functions
mxHierarchicalLayoutConstructs a new hierarchical layout algorithm.
Variables
rootsHolds the array of mxGraphLayouts that this layout contains.
resizeParentSpecifies if the parent should be resized after the layout so that it contains all the child cells.
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.
deterministicWhether or not cells are ordered according to the order in the graph model.
fixRootsWhether or not to fix the position of the root cells.
layoutFromSinksWhether or not the initial scan of the graph to determine the layer assigned to each vertex starts from the sinks or source (the sinks being vertices with the fewest, preferable zero, outgoing edges and sources same with incoming edges).
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.
promoteEdgesWhether or not to promote edges that terminate on vertices with different but common ancestry to appear connected to the highest siblings in the ancestry chains
traverseAncestorsWhether or not to navigate edges whose terminal vertices have different parents but are in the same ancestry chain
modelThe internal mxGraphHierarchyModel formed of the layout.
Functions
getModelReturns the internal mxGraphHierarchyModel for this layout algorithm.
executeExecutes the layout for the children of the specified parent.
findTreeRootsReturns all children in the given parent which do not have incoming edges.
getEdgesReturns the connected edges for the given cell.
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.
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 mxGraphLayouts 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.

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.

deterministic

mxHierarchicalLayout.prototype.deterministic

Whether or not cells are ordered according to the order in the graph model.  Defaults to false since sorting usually produces quadratic performance.  Note that since mxGraph returns edges in a deterministic order, it might be that this layout is always deterministic using that JGraph regardless of this flag setting (i.e. leave it false in that case).  Default is true.

fixRoots

mxHierarchicalLayout.prototype.fixRoots

Whether or not to fix the position of the root cells.  Keep in mind to turn off features such as move to origin when fixing the roots, move to origin usually overrides this flag (in JGraph it does).  Default is false.

layoutFromSinks

mxHierarchicalLayout.prototype.layoutFromSinks

Whether or not the initial scan of the graph to determine the layer assigned to each vertex starts from the sinks or source (the sinks being vertices with the fewest, preferable zero, outgoing edges and sources same with incoming edges).  Starting from either direction can tight the layout up and also produce better results for certain types of graphs.  If the result for the default is not good enough try a few sample layouts with the value false to see if they improve

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.

promoteEdges

mxHierarchicalLayout.prototype.promoteEdges

Whether or not to promote edges that terminate on vertices with different but common ancestry to appear connected to the highest siblings in the ancestry chains

traverseAncestors

mxHierarchicalLayout.prototype.traverseAncestors

Whether or not 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.

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.

findTreeRoots

mxHierarchicalLayout.prototype.findTreeRoots = function(parent)

Returns all children in the given parent which do not have incoming edges.  If the result is empty then the with the greatest difference between incoming and outgoing edges is returned.

Parameters

parentmxCell whose children should be checked.

getEdges

mxHierarchicalLayout.prototype.getEdges = function(cell)

Returns the connected edges for the given cell.

Parameters

cellmxCell whose edges should 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.

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 mxGraphLayouts that this layout contains.
Base class for all layout algorithms in mxGraph.
mxHierarchicalLayout.prototype.resizeParent
Specifies if the parent should be resized after the layout so that it contains all the child cells.
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.deterministic
Whether or not cells are ordered according to the order in the graph model.
mxHierarchicalLayout.prototype.fixRoots
Whether or not to fix the position of the root cells.
mxHierarchicalLayout.prototype.layoutFromSinks
Whether or not the initial scan of the graph to determine the layer assigned to each vertex starts from the sinks or source (the sinks being vertices with the fewest, preferable zero, outgoing edges and sources same with incoming edges).
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.promoteEdges
Whether or not to promote edges that terminate on vertices with different but common ancestry to appear connected to the highest siblings in the ancestry chains
mxHierarchicalLayout.prototype.traverseAncestors
Whether or not to navigate edges whose terminal vertices have different parents but are in the same ancestry chain
mxHierarchicalLayout.prototype.model
The internal mxGraphHierarchyModel formed of the layout.
Internal model of a hierarchical graph.
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.findTreeRoots = function(parent)
Returns all 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.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.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.
Constant for direction north.
Cells are the elements of the graph model.
Close