GeezerVison is showing maxgraph.github.io — CoordinateAssignment | @maxgraph/core
Class CoordinateAssignment
Sets the horizontal locations of node and edge dummy nodes on each layer.
Uses median down and up weightings as well as heuristics to straighten edges as
far as possible.
Constructors
constructor
-
Creates a coordinate assignment.
Parameters
- layout: HierarchicalLayout | SwimlaneLayout
- intraCellSpacing: number = 30
the minimum buffer between cells on the same rank interRankCellSpacing
- interRankCellSpacing: number = 100
the minimum distance between cells on adjacent ranks
- orientation: DirectionValue
the position of the root node(s) relative to the graph
- initialX: number
the leftmost coordinate node placement starts at
- parallelEdgeSpacing: number = 10
Returns CoordinateAssignment
Properties
channelBuffer
channelBuffer: number = 4
The size of the vertical buffer in the center of inter-rank channels
where edge control points should not be placed Default is 4.
currentXDelta
currentXDelta: number | null = null
The sum of x-displacements for the current iteration
fineTuning
fineTuning: boolean = true
Whether or not to perform local optimisations and iterate multiple times
through the algorithm. Default is true.
groupPadding
groupPadding: number = 10
Padding added to resized parents Default is 10.
initialX
initialX: number
The minimum x position node placement starts at
interRankCellSpacing
interRankCellSpacing: number = 100
The minimum distance between cells on adjacent ranks. Default is 100.
intraCellSpacing
intraCellSpacing: number = 30
The minimum buffer between cells on the same rank. Default is 30.
jettyPositions
jettyPositions: { [key: string]: number[] } | null = null
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
layout
Reference to the enclosing .
limitX
limitX: number | null = null
The maximum x value this positioning lays up to
maxIterations
maxIterations: number = 8
The number of heuristic iterations to run. Default is 8.
minEdgeJetty
minEdgeJetty: number = 12
The minimum distance for an edge jetty from a vertex Default is 12.
nextLayerConnectedCache
nextLayerConnectedCache: null
A store of connections to the layer above for speed
orientation
The position of the root ( start ) node(s) relative to the rest of the laid out graph.
parallelEdgeSpacing
parallelEdgeSpacing: number = 10
The distance between each parallel edge on each ranks for long edges.
Default is 10.
prefHozEdgeSep
prefHozEdgeSep: number = 5
The preferred horizontal distance between edges exiting a vertex Default is 5.
prefVertEdgeOff
prefVertEdgeOff: number = 2
The preferred vertical offset between edges exiting a vertex Default is 2.
previousLayerConnectedCache
previousLayerConnectedCache: null
A store of connections to the layer below for speed
rankBottomY
rankBottomY: number[] | null = null
Internal cache of bottom-most value of Y for each rank
rankTopY
rankTopY: number[] | null = null
Internal cache of top-most values of Y for each rank
rankWidths
rankWidths: number[] | null = null
The width of all the ranks
rankY
rankY: number[] | null = null
The Y-coordinate of all the ranks
widestRank
widestRank: number | null = null
The rank that has the widest x position
widestRankValue
widestRankValue: number | null = null
The X-coordinate of the edge of the widest rank
Methods
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
Returns number
calculateWidestRank
-
Calculates the width rank in the hierarchy. Also set the y value of each
rank whilst performing the calculation
Returns void
execute
-
execute(parent: any): void
A basic horizontal coordinate assignment algorithm
Returns void
initialCoords
-
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.
Returns void
localEdgeProcessing
-
Separates the x position of edges as they connect to vertices
Returns void
medianPos
-
Performs one median positioning sweep in one direction
Parameters
- i: number
the iteration of the whole process
- model: GraphHierarchyModel
an internal model of the hierarchical layout
Returns void
medianXValue
-
Calculates the median position of the connected cell on the specified
rank
Parameters
- connectedCells: GraphAbstractHierarchyCell[]
the cells the candidate connects to on this level
- rankValue: number
the layer number of this rank
Returns number
minNode
-
Performs one median positioning sweep in both directions
Returns void
minPath
-
Straightens out chains of virtual nodes where possibleacade to those stored after this layout
processing step has completed.
Returns void
printStatus
-
Utility method to display current positions
Returns void
processReversedEdge
-
Hook to add additional processing
Returns void
rankCoordinates
-
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.
Parameters
- rankValue: number
the current rank being processed
- graph: AbstractGraph
the facade describing the input graph
- model: GraphHierarchyModel
an internal model of the hierarchical layout
Returns void
rankMedianPosition
-
rankMedianPosition( rankValue: number, model: GraphHierarchyModel, nextRankValue: number,): void
Performs median minimisation over one rank.
Parameters
- rankValue: number
the layer number of this rank
- model: GraphHierarchyModel
an internal model of the hierarchical layout
- nextRankValue: number
the layer number whose connected cels are to be laid out
relative to
Returns void
repositionValid
-
Determines whether or not a node may be moved to the specified x
position on the specified rank
Returns boolean
setCellLocations
-
Sets the cell locations in the facade to those stored after this layout
processing step has completed.
Returns void
setVertexLocation
-
Fixes the position of the specified vertex.
Returns void
On This Page
Constructors
Properties
Methods
|