A hierarchical layout algorithm.
mxHierarchicalLayout | A hierarchical layout algorithm. |
Functions | |
mxHierarchicalLayout | Constructs a new hierarchical layout algorithm. |
Variables | |
roots | Holds the array of mxGraphLayouts that this layout contains. |
resizeParent | Specifies if the parent should be resized after the layout so that it contains all the child cells. |
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. |
deterministic | Whether or not cells are ordered according to the order in the graph model. |
fixRoots | Whether or not to fix the position of the root cells. |
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). |
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. |
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 | Whether or not to navigate edges whose terminal vertices have different parents but are in the same ancestry chain |
model | The internal mxGraphHierarchyModel formed of the layout. |
Functions | |
getModel | Returns the internal mxGraphHierarchyModel for this layout algorithm. |
execute | Executes the layout for the children of the specified parent. |
findTreeRoots | Returns all children in the given parent which do not have incoming edges. |
getEdges | Returns the connected edges for the given cell. |
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. |
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 mxGraphLayouts 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.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.
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
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.findTreeRoots = function( isolate, invert )
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.
parent | mxCell whose children should be checked. |
isolate | Optional boolean that specifies if edges should be ignored if the opposite end is not a child of the given parent cell. Default is false. |
invert | Optional boolean that specifies if outgoing or incoming edges should be counted for a tree root. If false then outgoing edges will be counted. Default is false. |
mxHierarchicalLayout.prototype.getEdges = function( cell )
Returns the connected edges for the given cell.
cell | mxCell whose edges should be returned. |
Constructs a new hierarchical layout algorithm.
function mxHierarchicalLayout( graph, orientation, deterministic )
Holds the array of mxGraphLayouts 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 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 cells are ordered according to the order in the graph model.
mxHierarchicalLayout.prototype.deterministic
Whether or not to fix the position of the root cells.
mxHierarchicalLayout.prototype.fixRoots
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.layoutFromSinks
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 promote edges that terminate on vertices with different but common ancestry to appear connected to the highest siblings in the ancestry chains
mxHierarchicalLayout.prototype.promoteEdges
Whether or not to navigate edges whose terminal vertices have different parents but are in the same ancestry chain
mxHierarchicalLayout.prototype.traverseAncestors
The internal mxGraphHierarchyModel formed of the layout.
mxHierarchicalLayout.prototype.model
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 children in the given parent which do not have incoming edges.
mxHierarchicalLayout.prototype.findTreeRoots = function( isolate, invert )
Returns the connected edges for the given cell.
mxHierarchicalLayout.prototype.getEdges = function( cell )
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 )
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 )