Sets the horizontal locations of node and edge dummy nodes on each layer. Uses median down and up weighings as well heuristic to straighten edges as far as possible.
mxMedianHybridCrossingReduction | Sets the horizontal locations of node and edge dummy nodes on each layer. |
Functions | |
mxMedianHybridCrossingReduction | Creates a coordinate assignment. |
Variables | |
layout | Reference to the enclosing mxHierarchicalLayout. |
maxIterations | The maximum number of iterations to perform whilst reducing edge crossings. |
nestedBestRanks | Stores each rank as a collection of cells in the best order found for each layer so far |
currentBestCrossings | The total number of crossings found in the best configuration so far |
iterationsWithoutImprovement | The total number of crossings found in the best configuration so far |
maxNoImprovementIterations | The total number of crossings found in the best configuration so far |
Functions | |
execute | Performs a vertex ordering within ranks as described by Gansner et al 1993 |
calculateCrossings | Calculates the total number of edge crossing in the current graph. |
calculateRankCrossing | Calculates the number of edges crossings between the specified rank and the rank below it. |
transpose | Takes each possible adjacent cell pair on each rank and checks if swapping them around reduces the number of crossing |
weightedMedian | Sweeps up or down the layout attempting to minimise the median placement of connected cells on adjacent ranks |
medianRank | Attempts to minimise the median placement of connected cells on this rank and one of the adjacent ranks |
medianValue | Calculates the median rank order positioning for the specified cell using the connected cells on the specified rank. |
MedianCellSorter | A utility class used to track cells whilst sorting occurs on the median values. |
Functions | |
MedianCellSorter | Constructs a new median cell sorter. |
Variables | |
medianValue | The weighted value of the cell stored. |
cell | The cell whose median value is being calculated |
Functions | |
compare | Compares two MedianCellSorters. |
function mxMedianHybridCrossingReduction( layout )
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 |
mxMedianHybridCrossingReduction.prototype.layout
Reference to the enclosing mxHierarchicalLayout.
mxMedianHybridCrossingReduction.prototype.calculateCrossings = function( model )
Calculates the total number of edge crossing in the current graph. Returns the current number of edge crossings in the hierarchy graph model in the current candidate layout
model | the internal model describing the hierarchy |
mxMedianHybridCrossingReduction.prototype.calculateRankCrossing = function( i, model )
Calculates the number of edges crossings between the specified rank and the rank below it. Returns the number of edges crossings with the rank beneath
i | the topmost rank of the pair ( higher rank value ) |
model | the internal model describing the hierarchy |
mxMedianHybridCrossingReduction.prototype.transpose = function( mainLoopIteration, model )
Takes each possible adjacent cell pair on each rank and checks if swapping them around reduces the number of crossing
mainLoopIteration | the iteration number of the main loop |
model | the internal model describing the hierarchy |
mxMedianHybridCrossingReduction.prototype.weightedMedian = function( iteration, model )
Sweeps up or down the layout attempting to minimise the median placement of connected cells on adjacent ranks
iteration | the iteration number of the main loop |
model | the internal model describing the hierarchy |
mxMedianHybridCrossingReduction.prototype.medianRank = function( rankValue, downwardSweep )
Attempts to minimise the median placement of connected cells on this rank and one of the adjacent ranks
rankValue | the layer number of this rank |
downwardSweep | whether or not this is a downward sweep through the graph |
mxMedianHybridCrossingReduction.prototype.medianValue = function( connectedCells, rankValue )
Calculates the median rank order positioning for the specified cell using the connected cells on the specified rank. Returns the median rank ordering value of the connected cells
connectedCells | the cells on the specified rank connected to the specified cell |
rankValue | the rank that the connected cell lie upon |
A utility class used to track cells whilst sorting occurs on the median values. Does not violate (x.compareTo(y)==0) == (x.equals(y))
Functions | |
MedianCellSorter | Constructs a new median cell sorter. |
Variables | |
medianValue | The weighted value of the cell stored. |
cell | The cell whose median value is being calculated |
Functions | |
compare | Compares two MedianCellSorters. |
Creates a coordinate assignment.
function mxMedianHybridCrossingReduction( layout )
Reference to the enclosing mxHierarchicalLayout.
mxMedianHybridCrossingReduction.prototype.layout
The maximum number of iterations to perform whilst reducing edge crossings.
mxMedianHybridCrossingReduction.prototype.maxIterations
Stores each rank as a collection of cells in the best order found for each layer so far
mxMedianHybridCrossingReduction.prototype.nestedBestRanks
The total number of crossings found in the best configuration so far
mxMedianHybridCrossingReduction.prototype.currentBestCrossings
The total number of crossings found in the best configuration so far
mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement
The total number of crossings found in the best configuration so far
mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations
Performs a vertex ordering within ranks as described by Gansner et al 1993
mxMedianHybridCrossingReduction.prototype.execute = function( parent )
Calculates the total number of edge crossing in the current graph.
mxMedianHybridCrossingReduction.prototype.calculateCrossings = function( model )
Calculates the number of edges crossings between the specified rank and the rank below it.
mxMedianHybridCrossingReduction.prototype.calculateRankCrossing = function( i, model )
Takes each possible adjacent cell pair on each rank and checks if swapping them around reduces the number of crossing
mxMedianHybridCrossingReduction.prototype.transpose = function( mainLoopIteration, model )
Sweeps up or down the layout attempting to minimise the median placement of connected cells on adjacent ranks
mxMedianHybridCrossingReduction.prototype.weightedMedian = function( iteration, model )
Attempts to minimise the median placement of connected cells on this rank and one of the adjacent ranks
mxMedianHybridCrossingReduction.prototype.medianRank = function( rankValue, downwardSweep )
Calculates the median rank order positioning for the specified cell using the connected cells on the specified rank.
mxMedianHybridCrossingReduction.prototype.medianValue = function( connectedCells, rankValue )
Constructs a new median cell sorter.
function MedianCellSorter()
The weighted value of the cell stored.
MedianCellSorter.prototype.medianValue
The cell whose median value is being calculated
MedianCellSorter.prototype.cell
Compares two MedianCellSorters.
MedianCellSorter.prototype.compare = function( a, b )