GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • @maxgraph/core

This view

  • Original page
  • New address

GeezerVison is showing maxgraph.github.io — CoordinateAssignment | @maxgraph/core

  • CoordinateAssignment

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.

Hierarchy (View Summary)

  • HierarchicalLayoutStage
    • CoordinateAssignment
  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:42
Index

Constructors

constructor

Properties

channelBuffer currentXDelta fineTuning groupPadding initialX interRankCellSpacing intraCellSpacing jettyPositions layout limitX maxIterations minEdgeJetty nextLayerConnectedCache orientation parallelEdgeSpacing prefHozEdgeSep prefVertEdgeOff previousLayerConnectedCache rankBottomY rankTopY rankWidths rankY widestRank widestRankValue

Methods

calculatedWeightedValue calculateWidestRank execute initialCoords localEdgeProcessing medianPos medianXValue minNode minPath printStatus processReversedEdge rankCoordinates rankMedianPosition repositionValid setCellLocations setEdgePosition setVertexLocation

Constructors

constructor

  • new CoordinateAssignment(
        layout: HierarchicalLayout | SwimlaneLayout,
        intraCellSpacing?: number,
        interRankCellSpacing?: number,
        orientation: DirectionValue,
        initialX: number,
        parallelEdgeSpacing?: number,
    ): CoordinateAssignment

    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

    Overrides HierarchicalLayoutStage.constructor

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:53

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.

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:116

currentXDelta

currentXDelta: number | null = null

The sum of x-displacements for the current iteration

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:148

fineTuning

fineTuning: boolean = true

Whether or not to perform local optimisations and iterate multiple times through the algorithm. Default is true.

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:184

groupPadding

groupPadding: number = 10

Padding added to resized parents Default is 10.

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:199

initialX

initialX: number

The minimum x position node placement starts at

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:138

interRankCellSpacing

interRankCellSpacing: number = 100

The minimum distance between cells on adjacent ranks. Default is 100.

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:84

intraCellSpacing

intraCellSpacing: number = 30

The minimum buffer between cells on the same rank. Default is 30.

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:79

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

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:127

layout

layout: HierarchicalLayout | SwimlaneLayout

Reference to the enclosing .

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:74

limitX

limitX: number | null = null

The maximum x value this positioning lays up to

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:143

maxIterations

maxIterations: number = 8

The number of heuristic iterations to run. Default is 8.

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:95

minEdgeJetty

minEdgeJetty: number = 12

The minimum distance for an edge jetty from a vertex Default is 12.

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:110

nextLayerConnectedCache

nextLayerConnectedCache: null

A store of connections to the layer above for speed

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:189

orientation

orientation: DirectionValue = 'north'

The position of the root ( start ) node(s) relative to the rest of the laid out graph.

Default

'north'
  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:133

parallelEdgeSpacing

parallelEdgeSpacing: number = 10

The distance between each parallel edge on each ranks for long edges. Default is 10.

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:90

prefHozEdgeSep

prefHozEdgeSep: number = 5

The preferred horizontal distance between edges exiting a vertex Default is 5.

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:100

prefVertEdgeOff

prefVertEdgeOff: number = 2

The preferred vertical offset between edges exiting a vertex Default is 2.

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:105

previousLayerConnectedCache

previousLayerConnectedCache: null

A store of connections to the layer below for speed

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:194

rankBottomY

rankBottomY: number[] | null = null

Internal cache of bottom-most value of Y for each rank

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:163

rankTopY

rankTopY: number[] | null = null

Internal cache of top-most values of Y for each rank

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:158

rankWidths

rankWidths: number[] | null = null

The width of all the ranks

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:173

rankY

rankY: number[] | null = null

The Y-coordinate of all the ranks

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:178

widestRank

widestRank: number | null = null

The rank that has the widest x position

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:153

widestRankValue

widestRankValue: number | null = null

The X-coordinate of the edge of the widest rank

  • Defined in view/layout/hierarchical/CoordinateAssignment.ts:168

Methods

calculatedWeightedValue

  • calculatedWeightedValue(
        currentCell: Cell,
        collection: GraphAbstractHierarchyCell[],
    ): number

    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

    Parameters

    • currentCell: Cell

      the cell whose weight is to be calculated

    • collection: GraphAbstractHierarchyCell[]

      the cells the specified cell is connected to

    Returns number

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:606

calculateWidestRank

  • calculateWidestRank(graph: AbstractGraph, model: GraphHierarchyModel): void

    Calculates the width rank in the hierarchy. Also set the y value of each rank whilst performing the calculation

    Parameters

    • graph: AbstractGraph

      the facade describing the input graph

    • model: GraphHierarchyModel

      an internal model of the hierarchical layout

    Returns void

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:747

execute

  • execute(parent: any): void

    A basic horizontal coordinate assignment algorithm

    Parameters

    • parent: any

    Returns void

    Overrides HierarchicalLayoutStage.execute

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:227

initialCoords

  • initialCoords(facade: AbstractGraph, model: GraphHierarchyModel): void

    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.

    Parameters

    • facade: AbstractGraph

      the facade describing the input graph

    • model: GraphHierarchyModel

      an internal model of the hierarchical layout

    Returns void

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:657

localEdgeProcessing

  • localEdgeProcessing(model: GraphHierarchyModel): void

    Separates the x position of edges as they connect to vertices

    Parameters

    • model: GraphHierarchyModel

      the layout model

    Returns void

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:1051

medianPos

  • medianPos(i: number, model: GraphHierarchyModel): void

    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

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:441

medianXValue

  • medianXValue(
        connectedCells: GraphAbstractHierarchyCell[],
        rankValue: number,
    ): number

    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

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:628

minNode

  • minNode(model: GraphHierarchyModel): void

    Performs one median positioning sweep in both directions

    Parameters

    • model: GraphHierarchyModel

    Returns void

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:288

minPath

  • minPath(graph: AbstractGraph, model: GraphHierarchyModel): void

    Straightens out chains of virtual nodes where possibleacade to those stored after this layout processing step has completed.

    Parameters

    • graph: AbstractGraph

      the facade describing the input graph

    • model: GraphHierarchyModel

      an internal model of the hierarchical layout

    Returns void

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:842

printStatus

  • printStatus(): void

    Utility method to display current positions

    Returns void

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:204

processReversedEdge

  • processReversedEdge(edge: GraphHierarchyEdge, realEdge: Cell): void

    Hook to add additional processing

    Parameters

    • edge: GraphHierarchyEdge

      the hierarchical model edge

    • realEdge: Cell

      the real edge in the graph

    Returns void

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:1420

rankCoordinates

  • rankCoordinates(
        rankValue: number,
        graph: AbstractGraph,
        model: GraphHierarchyModel,
    ): void

    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

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:684

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

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:464

repositionValid

  • repositionValid(
        model: GraphHierarchyModel,
        cell: GraphHierarchyEdge | GraphHierarchyNode,
        rank: number,
        position: number,
    ): boolean

    Determines whether or not a node may be moved to the specified x position on the specified rank

    Parameters

    • model: GraphHierarchyModel

      the layout model

    • cell: GraphHierarchyEdge | GraphHierarchyNode

      the cell being analysed

    • rank: number

      the layer of the cell

    • position: number

      the x position being sought

    Returns boolean

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:951

setCellLocations

  • setCellLocations(graph: AbstractGraph, model: GraphHierarchyModel): void

    Sets the cell locations in the facade to those stored after this layout processing step has completed.

    Parameters

    • graph: AbstractGraph

      the input graph

    • model: GraphHierarchyModel

      the layout model

    Returns void

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:1010

setEdgePosition

  • setEdgePosition(cell: GraphHierarchyEdge): void

    Fixes the control points

    Parameters

    • cell: GraphHierarchyEdge

    Returns void

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:1172

setVertexLocation

  • setVertexLocation(cell: GraphHierarchyNode): void

    Fixes the position of the specified vertex.

    Parameters

    • cell: GraphHierarchyNode

      the vertex to position

    Returns void

    • Defined in view/layout/hierarchical/CoordinateAssignment.ts:1393

Settings

Member Visibility
  • Protected
  • Inherited
Theme

On This Page

Constructors
constructor
Properties
channelBuffercurrentXDeltafineTuninggroupPaddinginitialXinterRankCellSpacingintraCellSpacingjettyPositionslayoutlimitXmaxIterationsminEdgeJettynextLayerConnectedCacheorientationparallelEdgeSpacingprefHozEdgeSepprefVertEdgeOffpreviousLayerConnectedCacherankBottomYrankTopYrankWidthsrankYwidestRankwidestRankValue
Methods
calculatedWeightedValuecalculateWidestRankexecuteinitialCoordslocalEdgeProcessingmedianPosmedianXValueminNodeminPathprintStatusprocessReversedEdgerankCoordinatesrankMedianPositionrepositionValidsetCellLocationssetEdgePositionsetVertexLocation
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.