mxRadialTreeLayout

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.

Example

var layout = new mxRadialTreeLayout(graph);
layout.execute(graph.getDefaultParent());
Summary
mxRadialTreeLayoutExtends mxGraphLayout to implement a radial tree algorithm.
Functions
mxRadialTreeLayoutConstructs a new radial tree layout for the specified graph
Variables
invertSpecifies if edge directions should be inverted.
angleOffsetThe initial offset to compute the angle position.
rootxThe X co-ordinate of the root cell
rootyThe Y co-ordinate of the root cell
levelDistanceHolds the levelDistance.
nodeDistanceHolds the nodeDistance.
autoRadiusSpecifies if the radios should be computed automatically
minradiusxThe minimum radius of each level in x axis
minradiusyThe minimum radius of each level in y axis
maxradiusyThe maximum radius of each level in x axis
maxradiusyThe maximum radius of each level in y axis
radiusxx-axis radius of each circle
radiusyy-axis radius of each circle
sortEdgesSpecifies if edges should be sorted according to the order of their opposite terminal cell in the model.
Functions
isVertexIgnoredReturns a boolean indicating if the given mxCell should be ignored as a vertex.
executeImplements mxGraphLayout.execute.
moveNodeMoves the specified node and all of its children by the given amount.
sortOutgoingEdgesCalled if sortEdges is true to sort the array of outgoing edges in place.
dfsDoes a depth first search starting at the specified cell.
layoutStarts the actual compact tree layout algorithm at the given node.
createNode
localEdgeProcessingMoves the specified node and all of its children by the given amount.
localEdgeProcessingSeparates the x position of edges as they connect to vertices
apply
WeightedCellSorterA utility class used to track cells whilst sorting occurs on the weighted sum of their connected edges.
Functions
WeightedCellSorterConstructs a new weighted cell sorted for the given cell and weight.
Variables
weightedValueThe weighted value of the cell stored.
nudgeWhether or not to flip equal weight values.
visitedWhether or not this cell has been visited in the current assignment.
rankIndexThe index this cell is in the model rank.
cellThe cell whose median value is being calculated.
Functions
compareCompares two WeightedCellSorters.

Functions

mxRadialTreeLayout

function mxRadialTreeLayout(graph,
invert)

Constructs a new radial tree layout for the specified graph

Variables

invert

mxRadialTreeLayout.prototype.invert

Specifies if edge directions should be inverted.  Default is false.

angleOffset

mxRadialTreeLayout.prototype.angleOffset

The initial offset to compute the angle position.

rootx

mxRadialTreeLayout.prototype.rootx

The X co-ordinate of the root cell

rooty

mxRadialTreeLayout.prototype.rooty

The Y co-ordinate of the root cell

levelDistance

mxRadialTreeLayout.prototype.levelDistance

Holds the levelDistance.  Default is 10.

nodeDistance

mxRadialTreeLayout.prototype.nodeDistance

Holds the nodeDistance.  Default is 20.

autoRadius

mxRadialTreeLayout.prototype.autoRadius

Specifies if the radios should be computed automatically

minradiusx

mxRadialTreeLayout.prototype.minradiusx

The minimum radius of each level in x axis

minradiusy

mxRadialTreeLayout.prototype.minradiusy

The minimum radius of each level in y axis

maxradiusy

The maximum radius of each level in x axis

maxradiusy

mxRadialTreeLayout.prototype.maxradiusy

The maximum radius of each level in y axis

radiusx

mxRadialTreeLayout.prototype.radiusx

x-axis radius of each circle

radiusy

mxRadialTreeLayout.prototype.radiusy

y-axis radius of each circle

sortEdges

mxRadialTreeLayout.prototype.sortEdges

Specifies if edges should be sorted according to the order of their opposite terminal cell in the model.

Functions

isVertexIgnored

mxRadialTreeLayout.prototype.isVertexIgnored = function(vertex)

Returns a boolean indicating if the given mxCell should be ignored as a vertex.  This returns true if the cell has no connections.

Parameters

vertexmxCell whose ignored state should be returned.

execute

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.

Parameters

parentmxCell whose children should be laid out.
rootOptional mxCell that will be used as the root of the tree.

moveNode

mxRadialTreeLayout.prototype.moveNode = function(node,
dx,
dy)

Moves the specified node and all of its children by the given amount.

sortOutgoingEdges

mxRadialTreeLayout.prototype.sortOutgoingEdges = function(source,
edges)

Called if sortEdges is true to sort the array of outgoing edges in place.

dfs

mxRadialTreeLayout.prototype.dfs = function(cell,
level,
treeParent,
graphParent,
visited)

Does a depth first search starting at the specified cell.  Makes sure the specified parent is never left by the algorithm.

layout

mxRadialTreeLayout.prototype.layout = function(level,
nodes)

Starts the actual compact tree layout algorithm at the given node.

createNode

mxRadialTreeLayout.prototype.createNode = function(cell,
treeParent)

localEdgeProcessing

mxRadialTreeLayout.prototype.localEdgeProcessing = function(node)

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

mxRadialTreeLayout.prototype.apply = function(node)

WeightedCellSorter

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))

Summary
Functions
WeightedCellSorterConstructs a new weighted cell sorted for the given cell and weight.
Variables
weightedValueThe weighted value of the cell stored.
nudgeWhether or not to flip equal weight values.
visitedWhether or not this cell has been visited in the current assignment.
rankIndexThe index this cell is in the model rank.
cellThe cell whose median value is being calculated.
Functions
compareCompares two WeightedCellSorters.

Functions

WeightedCellSorter

function WeightedCellSorter(cell,
weightedValue)

Constructs a new weighted cell sorted for the given cell and weight.

Variables

weightedValue

WeightedCellSorter.prototype.weightedValue

The weighted value of the cell stored.

nudge

WeightedCellSorter.prototype.nudge

Whether or not to flip equal weight values.

visited

WeightedCellSorter.prototype.visited

Whether or not this cell has been visited in the current assignment.

rankIndex

WeightedCellSorter.prototype.rankIndex

The index this cell is in the model rank.

cell

WeightedCellSorter.prototype.cell

The cell whose median value is being calculated.

Functions

compare

WeightedCellSorter.prototype.compare = function(a,
b)

Compares two WeightedCellSorters.

Base class for all layout algorithms in mxGraph.
function mxRadialTreeLayout(graph,
invert)
Constructs a new radial tree layout for the specified graph
mxRadialTreeLayout.prototype.invert
Specifies if edge directions should be inverted.
mxRadialTreeLayout.prototype.angleOffset
The initial offset to compute the angle position.
mxRadialTreeLayout.prototype.rootx
The X co-ordinate of the root cell
mxRadialTreeLayout.prototype.rooty
The Y co-ordinate of the root cell
mxRadialTreeLayout.prototype.levelDistance
Holds the levelDistance.
mxRadialTreeLayout.prototype.nodeDistance
Holds the nodeDistance.
mxRadialTreeLayout.prototype.autoRadius
Specifies if the radios should be computed automatically
mxRadialTreeLayout.prototype.minradiusx
The minimum radius of each level in x axis
mxRadialTreeLayout.prototype.minradiusy
The minimum radius of each level in y axis
mxRadialTreeLayout.prototype.maxradiusy
The maximum radius of each level in y axis
mxRadialTreeLayout.prototype.radiusx
x-axis radius of each circle
mxRadialTreeLayout.prototype.radiusy
y-axis radius of each circle
mxRadialTreeLayout.prototype.sortEdges
Specifies if edges should be sorted according to the order of their opposite terminal cell in the model.
mxRadialTreeLayout.prototype.isVertexIgnored = function(vertex)
Returns a boolean indicating if the given mxCell should be ignored as a vertex.
Cells are the elements of the graph model.
mxRadialTreeLayout.prototype.execute = function(parent,
root)
Implements mxGraphLayout.execute.
mxGraphLayout.prototype.execute = function(parent)
Executes the layout algorithm for the children of the given parent.
mxRadialTreeLayout.prototype.moveNode = function(node,
dx,
dy)
Moves the specified node and all of its children by the given amount.
mxRadialTreeLayout.prototype.sortOutgoingEdges = function(source,
edges)
Called if sortEdges is true to sort the array of outgoing edges in place.
mxRadialTreeLayout.prototype.dfs = function(cell,
level,
treeParent,
graphParent,
visited)
Does a depth first search starting at the specified cell.
mxRadialTreeLayout.prototype.layout = function(level,
nodes)
Starts the actual compact tree layout algorithm at the given node.
mxRadialTreeLayout.prototype.createNode = function(cell,
treeParent)
mxRadialTreeLayout.prototype.localEdgeProcessing = function(node)
Moves the specified node and all of its children by the given amount.
mxRadialTreeLayout.prototype.apply = function(node)
function WeightedCellSorter(cell,
weightedValue)
Constructs a new weighted cell sorted for the given cell and weight.
WeightedCellSorter.prototype.weightedValue
The weighted value of the cell stored.
WeightedCellSorter.prototype.nudge
Whether or not to flip equal weight values.
WeightedCellSorter.prototype.visited
Whether or not this cell has been visited in the current assignment.
WeightedCellSorter.prototype.rankIndex
The index this cell is in the model rank.
WeightedCellSorter.prototype.cell
The cell whose median value is being calculated.
WeightedCellSorter.prototype.compare = function(a,
b)
Compares two WeightedCellSorters.
mxGraph.prototype.findTreeRoots = function(parent,
isolate,
invert)
Returns all children in the given parent which do not have incoming edges.
Close