A hierarchical layout algorithm.
mxHierarchicalLayout | A hierarchical layout algorithm. |
Functions | |
mxHierarchicalLayout | Constructs a new hierarchical layout algorithm. |
Variables | |
roots | Holds the array of mxCell that this layout contains. |
resizeParent | Specifies if the parent should be resized after the layout so that it contains all the child cells. |
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. |
moveParent | Specifies if the parent should be moved if resizeParent is enabled. |
parentBorder | The border to be added around the children if the parent is to be resized using resizeParent. |
intraCellSpacing | The spacing buffer added between cells on the same layer. |
interRankCellSpacing | The spacing buffer added between cell on adjacent layers. |
interHierarchySpacing | The spacing buffer between unconnected hierarchies. |
parallelEdgeSpacing | The distance between each parallel edge on each ranks for long edges. |
orientation | The position of the root node(s) relative to the laid out graph in. |
fineTuning | Whether or not to perform local optimisations and iterate multiple times through the algorithm. |
tightenToSource | Whether or not to tighten the assigned ranks of vertices up towards the source cells. |
disableEdgeStyle | Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result. |
traverseAncestors | Whether or not to drill into child cells and layout in reverse group order. |
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 | The style to apply between cell layers to edge segments. |
Functions | |
getModel | Returns the internal mxGraphHierarchyModel for this layout algorithm. |
execute | Executes the layout for the children of the specified parent. |
findRoots | Returns all visible children in the given parent which do not have incoming edges. |
getEdges | Returns the connected edges for the given cell. |
getVisibleTerminal | Helper function to return visible terminal for edge allowing for ports |
run | 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. |
filterDescendants | Creates an array of descendant cells |
isPort | 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 |
getEdgesBetween | Returns the edges between the given source and target. |
cycleStage | Executes the cycle stage using mxMinimumCycleRemover. |
layeringStage | Implements first stage of a Sugiyama layout. |
crossingStage | Executes the crossing stage using mxMedianHybridCrossingReduction. |
placementStage | Executes the placement stage using mxCoordinateAssignment. |
function mxHierarchicalLayout( graph, orientation, deterministic )
Constructs a new hierarchical layout algorithm.
graph | Reference to the enclosing mxGraph. |
orientation | Optional constant that defines the orientation of this layout. |
deterministic | Optional boolean that specifies if this layout should be deterministic. Default is true. |
mxHierarchicalLayout.prototype.roots
Holds the array of mxCell that this layout contains.
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.
mxHierarchicalLayout.prototype.moveParent
Specifies if the parent should be moved if resizeParent is enabled. Default is false.
mxHierarchicalLayout.prototype.parentBorder
The border to be added around the children if the parent is to be resized using resizeParent. Default is 0.
mxHierarchicalLayout.prototype.orientation
The position of the root node(s) relative to the laid out graph in. Default is mxConstants.DIRECTION_NORTH.
mxHierarchicalLayout.prototype.model
The internal mxGraphHierarchyModel formed of the layout.
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.
parent | Parent mxCell that contains the children to be laid out. |
roots | Optional starting roots of the layout. |
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.
parent | mxCell whose children should be checked. |
vertices | array of vertices to limit search to |
mxHierarchicalLayout.prototype.getEdges = function( cell )
Returns the connected edges for the given cell.
cell | mxCell whose edges should be returned. |
mxHierarchicalLayout.prototype.getVisibleTerminal = function( edge, source )
Helper function to return visible terminal for edge allowing for ports
edge | mxCell whose edges should be returned. |
source | Boolean that specifies whether the source or target terminal is to be returned |
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
cell | mxCell that represents the port. |
Constructs a new hierarchical layout algorithm.
function mxHierarchicalLayout( graph, orientation, deterministic )
Holds the array of mxCell that this layout contains.
mxHierarchicalLayout.prototype.roots
Specifies if the parent should be resized after the layout so that it contains all the child cells.
mxHierarchicalLayout.prototype.resizeParent
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.maintainParentLocation
Specifies if the parent should be moved if resizeParent is enabled.
mxHierarchicalLayout.prototype.moveParent
The border to be added around the children if the parent is to be resized using resizeParent.
mxHierarchicalLayout.prototype.parentBorder
The spacing buffer added between cells on the same layer.
mxHierarchicalLayout.prototype.intraCellSpacing
The spacing buffer added between cell on adjacent layers.
mxHierarchicalLayout.prototype.interRankCellSpacing
The spacing buffer between unconnected hierarchies.
mxHierarchicalLayout.prototype.interHierarchySpacing
The distance between each parallel edge on each ranks for long edges.
mxHierarchicalLayout.prototype.parallelEdgeSpacing
The position of the root node(s) relative to the laid out graph in.
mxHierarchicalLayout.prototype.orientation
Whether or not to perform local optimisations and iterate multiple times through the algorithm.
mxHierarchicalLayout.prototype.fineTuning
Whether or not to tighten the assigned ranks of vertices up towards the source cells.
mxHierarchicalLayout.prototype.tightenToSource
Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result.
mxHierarchicalLayout.prototype.disableEdgeStyle
Whether or not to drill into child cells and layout in reverse group order.
mxHierarchicalLayout.prototype.traverseAncestors
The internal mxGraphHierarchyModel formed of the layout.
mxHierarchicalLayout.prototype.model
The style to apply between cell layers to edge segments.
mxHierarchicalLayout.prototype.edgeStyle
Returns the internal mxGraphHierarchyModel for this layout algorithm.
mxHierarchicalLayout.prototype.getModel = function()
Executes the layout for the children of the specified parent.
mxHierarchicalLayout.prototype.execute = function( parent, roots )
Returns all visible children in the given parent which do not have incoming edges.
mxHierarchicalLayout.prototype.findRoots = function( parent, vertices )
Returns the connected edges for the given cell.
mxHierarchicalLayout.prototype.getEdges = function( cell )
Helper function to return visible terminal for edge allowing for ports
mxHierarchicalLayout.prototype.getVisibleTerminal = function( edge, source )
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.run = function( parent )
Creates an array of descendant cells
mxHierarchicalLayout.prototype.filterDescendants = function( cell, result )
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.isPort = function( cell )
Returns the edges between the given source and target.
mxHierarchicalLayout.prototype.getEdgesBetween = function( source, target, directed )
Executes the cycle stage using mxMinimumCycleRemover.
mxHierarchicalLayout.prototype.cycleStage = function( parent )
Implements first stage of a Sugiyama layout.
mxHierarchicalLayout.prototype.layeringStage = function()
Executes the crossing stage using mxMedianHybridCrossingReduction.
mxHierarchicalLayout.prototype.crossingStage = function( parent )
Executes the placement stage using mxCoordinateAssignment.
mxHierarchicalLayout.prototype.placementStage = function( initialX, parent )
Constant for direction north.
DIRECTION_NORTH: 'north'