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.
var 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 | |
invert | Specifies if edge directions should be inverted. |
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 |
minradiusx | The minimum radius of each level in x axis |
minradiusy | The minimum radius of each level in y axis |
maxradiusy | The maximum radius of each level in x axis |
maxradiusy | The maximum radius of each level in y axis |
radiusx | x-axis radius of each circle |
radiusy | y-axis radius of each circle |
sortEdges | Specifies if edges should be sorted according to the order of their opposite terminal cell in the model. |
Functions | |
isVertexIgnored | Returns a boolean indicating if the given mxCell should be ignored as a vertex. |
execute | Implements mxGraphLayout.execute. |
moveNode | Moves the specified node and all of its children by the given amount. |
sortOutgoingEdges | Called if sortEdges is true to sort the array of outgoing edges in place. |
dfs | Does a depth first search starting at the specified cell. |
layout | Starts the actual compact tree layout algorithm at the given node. |
createNode | |
localEdgeProcessing | Moves the specified node and all of its children by the given amount. |
localEdgeProcessing | Separates the x position of edges as they connect to vertices |
apply | |
WeightedCellSorter | A utility class used to track cells whilst sorting occurs on the weighted sum of their connected edges. |
Functions | |
WeightedCellSorter | Constructs a new weighted cell sorted for the given cell and weight. |
Variables | |
weightedValue | The weighted value of the cell stored. |
nudge | Whether or not to flip equal weight values. |
visited | Whether or not this cell has been visited in the current assignment. |
rankIndex | The index this cell is in the model rank. |
cell | The cell whose median value is being calculated. |
Functions | |
compare | Compares two WeightedCellSorters. |
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. |
mxRadialTreeLayout.prototype.sortOutgoingEdges = function( source, edges )
Called if sortEdges is true to sort the array of outgoing edges in place.
A utility class used to track cells whilst sorting occurs on the weighted sum of their connected edges. Does not violate (x.compareTo(y)==0) == (x.equals(y))
Functions | |
WeightedCellSorter | Constructs a new weighted cell sorted for the given cell and weight. |
Variables | |
weightedValue | The weighted value of the cell stored. |
nudge | Whether or not to flip equal weight values. |
visited | Whether or not this cell has been visited in the current assignment. |
rankIndex | The index this cell is in the model rank. |
cell | The cell whose median value is being calculated. |
Functions | |
compare | Compares two WeightedCellSorters. |
Constructs a new radial tree layout for the specified graph
function mxRadialTreeLayout( graph, invert )
Specifies if edge directions should be inverted.
mxRadialTreeLayout.prototype.invert
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
The minimum radius of each level in x axis
mxRadialTreeLayout.prototype.minradiusx
The minimum radius of each level in y axis
mxRadialTreeLayout.prototype.minradiusy
The maximum radius of each level in y axis
mxRadialTreeLayout.prototype.maxradiusy
x-axis radius of each circle
mxRadialTreeLayout.prototype.radiusx
y-axis radius of each circle
mxRadialTreeLayout.prototype.radiusy
Specifies if edges should be sorted according to the order of their opposite terminal cell in the model.
mxRadialTreeLayout.prototype.sortEdges
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 )
Moves the specified node and all of its children by the given amount.
mxRadialTreeLayout.prototype.moveNode = function( node, dx, dy )
Called if sortEdges is true to sort the array of outgoing edges in place.
mxRadialTreeLayout.prototype.sortOutgoingEdges = function( source, edges )
Does a depth first search starting at the specified cell.
mxRadialTreeLayout.prototype.dfs = function( cell, level, treeParent, graphParent, visited )
Starts the actual compact tree layout algorithm at the given node.
mxRadialTreeLayout.prototype.layout = function( level, nodes )
mxRadialTreeLayout.prototype.createNode = function( cell, treeParent )
Moves the specified node and all of its children by the given amount.
mxRadialTreeLayout.prototype.localEdgeProcessing = function( node )
mxRadialTreeLayout.prototype.apply = function( node )
Constructs a new weighted cell sorted for the given cell and weight.
function WeightedCellSorter( cell, weightedValue )
The weighted value of the cell stored.
WeightedCellSorter.prototype.weightedValue
Whether or not to flip equal weight values.
WeightedCellSorter.prototype.nudge
Whether or not this cell has been visited in the current assignment.
WeightedCellSorter.prototype.visited
The index this cell is in the model rank.
WeightedCellSorter.prototype.rankIndex
The cell whose median value is being calculated.
WeightedCellSorter.prototype.cell
Compares two WeightedCellSorters.
WeightedCellSorter.prototype.compare = function( a, b )
Returns all children in the given parent which do not have incoming edges.
mxGraph.prototype.findTreeRoots = function( parent, isolate, invert )