Extends mxGraphLayout to implement a radial tree algorithm. This layout is suitable for graphs that have no cycles (trees). Vertices that are not connected to the tree will be ignored by this layout.
let layout = new mxRadialTreeLayout(graph); layout.execute(graph.getDefaultParent());
mxRadialTreeLayout | Extends mxGraphLayout to implement a radial tree algorithm. |
Functions | |
mxRadialTreeLayout | Constructs a new radial tree layout for the specified graph |
Variables | |
angleOffset | The initial offset to compute the angle position. |
rootx | The X co-ordinate of the root cell |
rooty | The Y co-ordinate of the root cell |
levelDistance | Holds the levelDistance. |
nodeDistance | Holds the nodeDistance. |
autoRadius | Specifies if the radios should be computed automatically |
sortEdges | Specifies if edges should be sorted according to the order of their opposite terminal cell in the model. |
rowMinX | Array of leftmost x coordinate of each row |
rowMaxX | Array of rightmost x coordinate of each row |
rowMinCenX | Array of x coordinate of leftmost vertex of each row |
rowMaxCenX | Array of x coordinate of rightmost vertex of each row |
rowRadi | Array of y deltas of each row behind root vertex, also the radius in the tree |
row | Array of vertices on each row |
Functions | |
isVertexIgnored | Returns a boolean indicating if the given mxCell should be ignored as a vertex. |
execute | Implements mxGraphLayout.execute. |
calcRowDims | Recursive function to calculate the dimensions of each row |
mxRadialTreeLayout.prototype.execute = function( parent, root )
Implements mxGraphLayout.execute.
If the parent has any connected edges, then it is used as the root of the tree. Else, mxGraph.findTreeRoots will be used to find a suitable root node within the set of children of the given parent.
parent | mxCell whose children should be laid out. |
root | Optional mxCell that will be used as the root of the tree. |
Constructs a new radial tree layout for the specified graph
function mxRadialTreeLayout( graph )
The initial offset to compute the angle position.
mxRadialTreeLayout.prototype.angleOffset
The X co-ordinate of the root cell
mxRadialTreeLayout.prototype.rootx
The Y co-ordinate of the root cell
mxRadialTreeLayout.prototype.rooty
Holds the levelDistance.
mxRadialTreeLayout.prototype.levelDistance
Holds the nodeDistance.
mxRadialTreeLayout.prototype.nodeDistance
Specifies if the radios should be computed automatically
mxRadialTreeLayout.prototype.autoRadius
Specifies if edges should be sorted according to the order of their opposite terminal cell in the model.
mxRadialTreeLayout.prototype.sortEdges
Array of leftmost x coordinate of each row
mxRadialTreeLayout.prototype.rowMinX
Array of rightmost x coordinate of each row
mxRadialTreeLayout.prototype.rowMaxX
Array of x coordinate of leftmost vertex of each row
mxRadialTreeLayout.prototype.rowMinCenX
Array of x coordinate of rightmost vertex of each row
mxRadialTreeLayout.prototype.rowMaxCenX
Array of y deltas of each row behind root vertex, also the radius in the tree
mxRadialTreeLayout.prototype.rowRadi
Array of vertices on each row
mxRadialTreeLayout.prototype.row
Returns a boolean indicating if the given mxCell should be ignored as a vertex.
mxRadialTreeLayout.prototype.isVertexIgnored = function( vertex )
Implements mxGraphLayout.execute.
mxRadialTreeLayout.prototype.execute = function( parent, root )
Executes the layout algorithm for the children of the given parent.
mxGraphLayout.prototype.execute = function( parent )
Recursive function to calculate the dimensions of each row
mxRadialTreeLayout.prototype.calcRowDims = function( row, rowNum )
Returns all children in the given parent which do not have incoming edges.
mxGraph.prototype.findTreeRoots = function( parent, isolate, invert )