Extends mxGraphLayout to implement a fast organic layout algorithm. The vertices need to be connected for this layout to work, vertices with no connections are ignored.
var layout = new mxFastOrganicLayout(graph); layout.execute(graph.getDefaultParent());
mxFastOrganicLayout | Extends mxGraphLayout to implement a fast organic layout algorithm. |
Functions | |
mxCompactTreeLayout | Constructs a new fast organic layout for the specified graph. |
Variables | |
useInputOrigin | Specifies if the top left corner of the input cells should be the origin of the layout result. |
resetEdges | Specifies if all edge points of traversed edges should be removed. |
disableEdgeStyle | Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result. |
forceConstant | The force constant by which the attractive forces are divided and the replusive forces are multiple by the square of. |
forceConstantSquared | Cache of <forceConstant>^2 for performance. |
minDistanceLimit | Minimal distance limit. |
minDistanceLimit | Minimal distance limit. |
minDistanceLimitSquared | Cached version of minDistanceLimit squared. |
initialTemp | Start value of temperature. |
temperature | Temperature to limit displacement at later stages of layout. |
maxIterations | Total number of iterations to run the layout though. |
iteration | Current iteration count. |
vertexArray | An array of all vertices to be laid out. |
dispX | An array of locally stored X co-ordinate displacements for the vertices. |
dispY | An array of locally stored Y co-ordinate displacements for the vertices. |
cellLocation | An array of locally stored co-ordinate positions for the vertices. |
radius | The approximate radius of each cell, nodes only. |
radiusSquared | The approximate radius squared of each cell, nodes only. |
isMoveable | Array of booleans representing the movable states of the vertices. |
neighbours | Local copy of cell neighbours. |
indices | Hashtable from cells to local indices. |
allowedToRun | Boolean flag that specifies if the layout is allowed to run. |
Functions | |
isVertexIgnored | Returns a boolean indicating if the given mxCell should be ignored as a vertex. |
execute | Implements mxGraphLayout.execute. |
calcPositions | Takes the displacements calculated for each cell and applies them to the local cache of cell positions. |
calcAttraction | Calculates the attractive forces between all laid out nodes linked by edges |
calcRepulsion | Calculates the repulsive forces between all laid out nodes |
reduceTemperature | Reduces the temperature of the layout from an initial setting in a linear fashion to zero. |
mxFastOrganicLayout.prototype.minDistanceLimitSquared
Cached version of minDistanceLimit squared.
mxFastOrganicLayout.prototype.execute = function( parent )
Implements mxGraphLayout.execute. This operates on all children of the given parent where isVertexIgnored returns false.
Specifies if the top left corner of the input cells should be the origin of the layout result.
mxFastOrganicLayout.prototype.useInputOrigin
Specifies if all edge points of traversed edges should be removed.
mxFastOrganicLayout.prototype.resetEdges
Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result.
mxFastOrganicLayout.prototype.disableEdgeStyle
The force constant by which the attractive forces are divided and the replusive forces are multiple by the square of.
mxFastOrganicLayout.prototype.forceConstant
Cache of <forceConstant>^2 for performance.
mxFastOrganicLayout.prototype.forceConstantSquared
Minimal distance limit.
mxFastOrganicLayout.prototype.minDistanceLimit
Cached version of minDistanceLimit squared.
mxFastOrganicLayout.prototype.minDistanceLimitSquared
Start value of temperature.
mxFastOrganicLayout.prototype.initialTemp
Temperature to limit displacement at later stages of layout.
mxFastOrganicLayout.prototype.temperature
Total number of iterations to run the layout though.
mxFastOrganicLayout.prototype.maxIterations
Current iteration count.
mxFastOrganicLayout.prototype.iteration
An array of all vertices to be laid out.
mxFastOrganicLayout.prototype.vertexArray
An array of locally stored X co-ordinate displacements for the vertices.
mxFastOrganicLayout.prototype.dispX
An array of locally stored Y co-ordinate displacements for the vertices.
mxFastOrganicLayout.prototype.dispY
An array of locally stored co-ordinate positions for the vertices.
mxFastOrganicLayout.prototype.cellLocation
The approximate radius of each cell, nodes only.
mxFastOrganicLayout.prototype.radius
The approximate radius squared of each cell, nodes only.
mxFastOrganicLayout.prototype.radiusSquared
Array of booleans representing the movable states of the vertices.
mxFastOrganicLayout.prototype.isMoveable
Local copy of cell neighbours.
mxFastOrganicLayout.prototype.neighbours
Hashtable from cells to local indices.
mxFastOrganicLayout.prototype.indices
Boolean flag that specifies if the layout is allowed to run.
mxFastOrganicLayout.prototype.allowedToRun
Returns a boolean indicating if the given mxCell should be ignored as a vertex.
mxFastOrganicLayout.prototype.isVertexIgnored = function( vertex )
Implements mxGraphLayout.execute.
mxFastOrganicLayout.prototype.execute = function( parent )
Executes the layout algorithm for the children of the given parent.
mxGraphLayout.prototype.execute = function( parent )
Takes the displacements calculated for each cell and applies them to the local cache of cell positions.
mxFastOrganicLayout.prototype.calcPositions = function()
Calculates the attractive forces between all laid out nodes linked by edges
mxFastOrganicLayout.prototype.calcAttraction = function()
Calculates the repulsive forces between all laid out nodes
mxFastOrganicLayout.prototype.calcRepulsion = function()
Reduces the temperature of the layout from an initial setting in a linear fashion to zero.
mxFastOrganicLayout.prototype.reduceTemperature = function()