Sets the horizontal locations of node and edge dummy nodes on each layer. Uses median down and up weighings as well as heuristics to straighten edges as far as possible.
mxCoordinateAssignment | Sets the horizontal locations of node and edge dummy nodes on each layer. |
Functions | |
mxCoordinateAssignment | Creates a coordinate assignment. |
Variables | |
layout | Reference to the enclosing mxHierarchicalLayout. |
intraCellSpacing | The minimum buffer between cells on the same rank. |
interRankCellSpacing | The minimum distance between cells on adjacent ranks. |
parallelEdgeSpacing | The distance between each parallel edge on each ranks for long edges. |
maxIterations | The number of heuristic iterations to run. |
prefHozEdgeSep | The preferred horizontal distance between edges exiting a vertex Default is 5. |
prefVertEdgeOff | The preferred vertical offset between edges exiting a vertex Default is 2. |
minEdgeJetty | The minimum distance for an edge jetty from a vertex Default is 12. |
channelBuffer | The size of the vertical buffer in the center of inter-rank channels where edge control points should not be placed Default is 4. |
jettyPositions | Map of internal edges and (x,y) pair of positions of the start and end jetty for that edge where it connects to the source and target vertices. |
orientation | The position of the root ( start ) node(s) relative to the rest of the laid out graph. |
initialX | The minimum x position node placement starts at |
limitX | The maximum x value this positioning lays up to |
currentXDelta | The sum of x-displacements for the current iteration |
widestRank | The rank that has the widest x position |
rankTopY | Internal cache of top-most values of Y for each rank |
rankBottomY | Internal cache of bottom-most value of Y for each rank |
widestRankValue | The X-coordinate of the edge of the widest rank |
rankWidths | The width of all the ranks |
rankY | The Y-coordinate of all the ranks |
fineTuning | Whether or not to perform local optimisations and iterate multiple times through the algorithm. |
nextLayerConnectedCache | A store of connections to the layer above for speed |
previousLayerConnectedCache | A store of connections to the layer below for speed |
groupPadding | Padding added to resized parents Default is 10. |
Functions | |
execute | A basic horizontal coordinate assignment algorithm |
minNode | Performs one median positioning sweep in both directions |
medianPos | Performs one median positioning sweep in one direction |
rankMedianPosition | Performs median minimisation over one rank. |
calculatedWeightedValue | Calculates the priority the specified cell has based on the type of its cell and the cells it is connected to on the next layer |
medianXValue | Calculates the median position of the connected cell on the specified rank |
initialCoords | Sets up the layout in an initial positioning. |
rankCoordinates | Sets up the layout in an initial positioning. |
calculateWidestRank | Calculates the width rank in the hierarchy. |
minPath | Straightens out chains of virtual nodes where possibleacade to those stored after this layout processing step has completed. |
repositionValid | Determines whether or not a node may be moved to the specified x position on the specified rank |
setCellLocations | Sets the cell locations in the facade to those stored after this layout processing step has completed. |
localEdgeProcessing | Separates the x position of edges as they connect to vertices |
setEdgePosition | Fixes the control points |
setVertexLocation | Fixes the position of the specified vertex. |
processReversedEdge | Hook to add additional processing |
function mxCoordinateAssignment( layout, intraCellSpacing, interRankCellSpacing, orientation, initialX, parallelEdgeSpacing )
Creates a coordinate assignment.
intraCellSpacing | the minimum buffer between cells on the same rank |
interRankCellSpacing | the minimum distance between cells on adjacent ranks |
orientation | the position of the root node(s) relative to the graph |
initialX | the leftmost coordinate node placement starts at |
mxCoordinateAssignment.prototype.layout
Reference to the enclosing mxHierarchicalLayout.
mxCoordinateAssignment.prototype.jettyPositions
Map of internal edges and (x,y) pair of positions of the start and end jetty for that edge where it connects to the source and target vertices. Note this should technically be a WeakHashMap, but since JS does not have an equivalent, housekeeping must be performed before using. i.e. check all edges are still in the model and clear the values. Note that the y co-ord is the offset of the jetty, not the absolute point
mxCoordinateAssignment.prototype.orientation
The position of the root ( start ) node(s) relative to the rest of the laid out graph. Default is mxConstants.DIRECTION_NORTH.
mxCoordinateAssignment.prototype.rankMedianPosition = function( rankValue, model, nextRankValue )
Performs median minimisation over one rank.
rankValue | the layer number of this rank |
model | an internal model of the hierarchical layout |
nextRankValue | the layer number whose connected cels are to be laid out relative to |
mxCoordinateAssignment.prototype.calculatedWeightedValue = function( currentCell, collection )
Calculates the priority the specified cell has based on the type of its cell and the cells it is connected to on the next layer
currentCell | the cell whose weight is to be calculated |
collection | the cells the specified cell is connected to |
mxCoordinateAssignment.prototype.initialCoords = function( facade, model )
Sets up the layout in an initial positioning. The ranks are all centered as much as possible along the middle vertex in each rank. The other cells are then placed as close as possible on either side.
facade | the facade describing the input graph |
model | an internal model of the hierarchical layout |
mxCoordinateAssignment.prototype.rankCoordinates = function( rankValue, graph, model )
Sets up the layout in an initial positioning. All the first cells in each rank are moved to the left and the rest of the rank inserted as close together as their size and buffering permits. This method works on just the specified rank.
rankValue | the current rank being processed |
graph | the facade describing the input graph |
model | an internal model of the hierarchical layout |
mxCoordinateAssignment.prototype.calculateWidestRank = function( graph, model )
Calculates the width rank in the hierarchy. Also set the y value of each rank whilst performing the calculation
graph | the facade describing the input graph |
model | an internal model of the hierarchical layout |
mxCoordinateAssignment.prototype.repositionValid = function( model, cell, rank, position )
Determines whether or not a node may be moved to the specified x position on the specified rank
model | the layout model |
cell | the cell being analysed |
rank | the layer of the cell |
position | the x position being sought |
Creates a coordinate assignment.
function mxCoordinateAssignment( layout, intraCellSpacing, interRankCellSpacing, orientation, initialX, parallelEdgeSpacing )
Reference to the enclosing mxHierarchicalLayout.
mxCoordinateAssignment.prototype.layout
The minimum buffer between cells on the same rank.
mxCoordinateAssignment.prototype.intraCellSpacing
The minimum distance between cells on adjacent ranks.
mxCoordinateAssignment.prototype.interRankCellSpacing
The distance between each parallel edge on each ranks for long edges.
mxCoordinateAssignment.prototype.parallelEdgeSpacing
The number of heuristic iterations to run.
mxCoordinateAssignment.prototype.maxIterations
The preferred horizontal distance between edges exiting a vertex Default is 5.
mxCoordinateAssignment.prototype.prefHozEdgeSep
The preferred vertical offset between edges exiting a vertex Default is 2.
mxCoordinateAssignment.prototype.prefVertEdgeOff
The minimum distance for an edge jetty from a vertex Default is 12.
mxCoordinateAssignment.prototype.minEdgeJetty
The size of the vertical buffer in the center of inter-rank channels where edge control points should not be placed Default is 4.
mxCoordinateAssignment.prototype.channelBuffer
Map of internal edges and (x,y) pair of positions of the start and end jetty for that edge where it connects to the source and target vertices.
mxCoordinateAssignment.prototype.jettyPositions
The position of the root ( start ) node(s) relative to the rest of the laid out graph.
mxCoordinateAssignment.prototype.orientation
The minimum x position node placement starts at
mxCoordinateAssignment.prototype.initialX
The maximum x value this positioning lays up to
mxCoordinateAssignment.prototype.limitX
The sum of x-displacements for the current iteration
mxCoordinateAssignment.prototype.currentXDelta
The rank that has the widest x position
mxCoordinateAssignment.prototype.widestRank
Internal cache of top-most values of Y for each rank
mxCoordinateAssignment.prototype.rankTopY
Internal cache of bottom-most value of Y for each rank
mxCoordinateAssignment.prototype.rankBottomY
The X-coordinate of the edge of the widest rank
mxCoordinateAssignment.prototype.widestRankValue
The width of all the ranks
mxCoordinateAssignment.prototype.rankWidths
The Y-coordinate of all the ranks
mxCoordinateAssignment.prototype.rankY
Whether or not to perform local optimisations and iterate multiple times through the algorithm.
mxCoordinateAssignment.prototype.fineTuning
A store of connections to the layer above for speed
mxCoordinateAssignment.prototype.nextLayerConnectedCache
A store of connections to the layer below for speed
mxCoordinateAssignment.prototype.previousLayerConnectedCache
Padding added to resized parents Default is 10.
mxCoordinateAssignment.prototype.groupPadding
A basic horizontal coordinate assignment algorithm
mxCoordinateAssignment.prototype.execute = function( parent )
Performs one median positioning sweep in both directions
mxCoordinateAssignment.prototype.minNode = function( model )
Performs one median positioning sweep in one direction
mxCoordinateAssignment.prototype.medianPos = function( i, model )
Performs median minimisation over one rank.
mxCoordinateAssignment.prototype.rankMedianPosition = function( rankValue, model, nextRankValue )
Calculates the priority the specified cell has based on the type of its cell and the cells it is connected to on the next layer
mxCoordinateAssignment.prototype.calculatedWeightedValue = function( currentCell, collection )
Calculates the median position of the connected cell on the specified rank
mxCoordinateAssignment.prototype.medianXValue = function( connectedCells, rankValue )
Sets up the layout in an initial positioning.
mxCoordinateAssignment.prototype.initialCoords = function( facade, model )
Sets up the layout in an initial positioning.
mxCoordinateAssignment.prototype.rankCoordinates = function( rankValue, graph, model )
Calculates the width rank in the hierarchy.
mxCoordinateAssignment.prototype.calculateWidestRank = function( graph, model )
Straightens out chains of virtual nodes where possibleacade to those stored after this layout processing step has completed.
mxCoordinateAssignment.prototype.minPath = function( graph, model )
Determines whether or not a node may be moved to the specified x position on the specified rank
mxCoordinateAssignment.prototype.repositionValid = function( model, cell, rank, position )
Sets the cell locations in the facade to those stored after this layout processing step has completed.
mxCoordinateAssignment.prototype.setCellLocations = function( graph, model )
Separates the x position of edges as they connect to vertices
mxCoordinateAssignment.prototype.localEdgeProcessing = function( model )
Fixes the control points
mxCoordinateAssignment.prototype.setEdgePosition = function( cell )
Fixes the position of the specified vertex.
mxCoordinateAssignment.prototype.setVertexLocation = function( cell )
Hook to add additional processing
mxCoordinateAssignment.prototype.processReversedEdge = function( graph, model )
Constant for direction north.
DIRECTION_NORTH: 'north'