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 — SwimlaneLayout | @maxgraph/core

  • SwimlaneLayout

Class SwimlaneLayout

A hierarchical layout algorithm.

Hierarchy (View Summary)

  • GraphLayout
    • SwimlaneLayout
  • Defined in view/layout/SwimlaneLayout.ts:38
Index

Constructors

constructor

Properties

deterministic disableEdgeStyle dummyVertexWidth edgesCache edgeSourceTermCache edgesTargetTermCache edgeStyle fineTuning graph interHierarchySpacing interRankCellSpacing intraCellSpacing maintainParentLocation model moveParent orientation parallelEdgeSpacing parent parentBorder parentX parentY resizeParent roots swimlanes tightenToSource traverseAncestors useBoundingBox

Methods

arrangeGroups crossingStage cycleStage execute filterDescendants findRoots getConstraint getDataModel getEdges getEdgesBetween getGraph getParentOffset getVertexBounds getVisibleTerminal isAncestor isEdgeIgnored isPort isVertexIgnored isVertexMovable layeringStage moveCell placementStage resizeCell run setEdgePoints setEdgeStyleEnabled setOrthogonalEdge setVertexLocation traverse updateGroupBounds

Constructors

constructor

  • new SwimlaneLayout(
        graph: AbstractGraph,
        orientation: DirectionValue | null,
        deterministic?: boolean,
    ): SwimlaneLayout

    Constructs a new hierarchical layout algorithm.

    Parameters

    • graph: AbstractGraph

      Reference to the enclosing AbstractGraph.

    • orientation: DirectionValue | null

      Optional constant that defines the orientation of this layout. Default is 'north'.

    • deterministic: boolean = true

      Optional boolean that specifies if this layout should be deterministic. Default is true.

    Returns SwimlaneLayout

    Overrides GraphLayout.constructor

    • Defined in view/layout/SwimlaneLayout.ts:46

Properties

deterministic

deterministic: boolean
  • Defined in view/layout/SwimlaneLayout.ts:58

disableEdgeStyle

disableEdgeStyle: boolean = true

Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result. Default is true.

  • Defined in view/layout/SwimlaneLayout.ts:143

dummyVertexWidth

dummyVertexWidth: number = 50

The cell width of any dummy vertices inserted

  • Defined in view/layout/SwimlaneLayout.ts:73

edgesCache

edgesCache: Map<Cell, Cell[]> = ...

A cache of edges whose source terminal is the key

  • Defined in view/layout/SwimlaneLayout.ts:161

edgeSourceTermCache

edgeSourceTermCache: Map<Cell, Cell> = ...

A cache of edges whose source terminal is the key

  • Defined in view/layout/SwimlaneLayout.ts:166

edgesTargetTermCache

edgesTargetTermCache: Map<Cell, Cell> = ...

A cache of edges whose source terminal is the key

  • Defined in view/layout/SwimlaneLayout.ts:171

edgeStyle

edgeStyle: number = HierarchicalEdgeStyle.POLYLINE

The style to apply between cell layers to edge segments. Default is HierarchicalEdgeStyle#POLYLINE.

  • Defined in view/layout/SwimlaneLayout.ts:177

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/SwimlaneLayout.ts:131

graph

graph: AbstractGraph

Reference to the enclosing AbstractGraph.

Inherited from GraphLayout.graph

  • Defined in view/layout/GraphLayout.ts:42

interHierarchySpacing

interHierarchySpacing: number = 60

The spacing buffer between unconnected hierarchies. Default is 60.

  • Defined in view/layout/SwimlaneLayout.ts:113

interRankCellSpacing

interRankCellSpacing: number = 100

The spacing buffer added between cell on adjacent layers. Default is 100.

  • Defined in view/layout/SwimlaneLayout.ts:108

intraCellSpacing

intraCellSpacing: number = 30

The spacing buffer added between cells on the same layer. Default is 30.

  • Defined in view/layout/SwimlaneLayout.ts:103

maintainParentLocation

maintainParentLocation: boolean = false

Specifies if the parent location should be maintained, so that the top, left corner stays the same before and after execution of the layout. Default is false for backwards compatibility.

  • Defined in view/layout/SwimlaneLayout.ts:86

model

model: SwimlaneModel | null = null

The internal SwimlaneModel formed of the layout.

  • Defined in view/layout/SwimlaneLayout.ts:156

moveParent

moveParent: boolean = false

Specifies if the parent should be moved if is enabled. Default is false.

  • Defined in view/layout/SwimlaneLayout.ts:92

orientation

orientation: DirectionValue = 'north'

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

Default

'north'.
  • Defined in view/layout/SwimlaneLayout.ts:125

parallelEdgeSpacing

parallelEdgeSpacing: number = 10

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

  • Defined in view/layout/SwimlaneLayout.ts:119

parent

parent: Cell | null = null

The parent cell of the layout, if any

Default

null

Inherited from GraphLayout.parent

  • Defined in view/layout/GraphLayout.ts:54

parentBorder

parentBorder: number = 30

The border to be added around the children if the parent is to be resized using . Default is 30.

  • Defined in view/layout/SwimlaneLayout.ts:98

parentX

parentX: number | null = null
  • Defined in view/layout/SwimlaneLayout.ts:56

parentY

parentY: number | null = null
  • Defined in view/layout/SwimlaneLayout.ts:57

resizeParent

resizeParent: boolean = false

Specifies if the parent should be resized after the layout so that it contains all the child cells. Default is false. See also .

  • Defined in view/layout/SwimlaneLayout.ts:79

roots

roots: Cell[] | null = null

Holds the array of that this layout contains.

  • Defined in view/layout/SwimlaneLayout.ts:63

swimlanes

swimlanes: Cell[] | null = null

Holds the array of of the ordered swimlanes to lay out

  • Defined in view/layout/SwimlaneLayout.ts:68

tightenToSource

tightenToSource: boolean = true

Whether or not to tighten the assigned ranks of vertices up towards the source cells. Default is true.

  • Defined in view/layout/SwimlaneLayout.ts:137

traverseAncestors

traverseAncestors: boolean = true

Whether or not to drill into child cells and layout in reverse group order. This also cause the layout to navigate edges whose terminal vertices have different parents but are in the same ancestry chain. Default is true.

  • Defined in view/layout/SwimlaneLayout.ts:151

useBoundingBox

useBoundingBox: boolean = true

Boolean indicating if the bounding box of the label should be used if it iss available.

Default

true.

Inherited from GraphLayout.useBoundingBox

  • Defined in view/layout/GraphLayout.ts:48

Methods

arrangeGroups

  • arrangeGroups(
        cells: Cell[],
        border: number,
        topBorder: number,
        rightBorder: number,
        bottomBorder: number,
        leftBorder: number,
    ): Cell[]

    Shortcut to AbstractGraph.updateGroupBounds with moveGroup set to true.

    Parameters

    • cells: Cell[]
    • border: number
    • topBorder: number
    • rightBorder: number
    • bottomBorder: number
    • leftBorder: number

    Returns Cell[]

    Inherited from GraphLayout.arrangeGroups

    • Defined in view/layout/GraphLayout.ts:424

crossingStage

  • crossingStage(parent: Cell): void

    Executes the crossing stage using mxMedianHybridCrossingReduction.

    Parameters

    • parent: Cell

    Returns void

    • Defined in view/layout/SwimlaneLayout.ts:845

cycleStage

  • cycleStage(parent: Cell): void

    Executes the cycle stage using mxMinimumCycleRemover.

    Parameters

    • parent: Cell

    Returns void

    • Defined in view/layout/SwimlaneLayout.ts:828

execute

  • execute(parent: Cell, swimlanes?: Cell[] | null): void

    Executes the layout for the children of the specified parent.

    Parameters

    • parent: Cell

      Parent that contains the children to be laid out.

    • swimlanes: Cell[] | null = null

      Ordered array of swimlanes to be laid out

    Returns void

    Overrides GraphLayout.execute

    • Defined in view/layout/SwimlaneLayout.ts:192

filterDescendants

  • filterDescendants(cell: Cell, result: { [key: string]: Cell }): void

    Creates an array of descendant cells

    Parameters

    • cell: Cell
    • result: { [key: string]: Cell }

    Returns void

    • Defined in view/layout/SwimlaneLayout.ts:642

findRoots

  • findRoots(parent: Cell, vertices: { [key: string]: Cell }): Cell[]

    Returns all visible children in the given parent which do not have incoming edges. If the result is empty then the children with the maximum difference between incoming and outgoing edges are returned. This takes into account edges that are being promoted to the given root due to invisible children or collapsed cells.

    Parameters

    • parent: Cell

      whose children should be checked.

    • vertices: { [key: string]: Cell }

      array of vertices to limit search to

    Returns Cell[]

    • Defined in view/layout/SwimlaneLayout.ts:364

getConstraint

  • getConstraint(key: string, cell: Cell, edge?: Cell, source?: boolean): any

    Returns the constraint for the given key and cell. The optional edge and source arguments are used to return inbound and outgoing routing- constraints for the given edge and vertex. This implementation always returns the value for the given key in the style of the given cell.

    Parameters

    • key: string

      Key of the constraint to be returned.

    • cell: Cell

      Cell whose constraint should be returned.

    • Optionaledge: Cell

      Optional Cell that represents the connection whose constraint should be returned. Default is null.

    • Optionalsource: boolean

      Optional boolean that specifies if the connection is incoming or outgoing. Default is null.

    Returns any

    Inherited from GraphLayout.getConstraint

    • Defined in view/layout/GraphLayout.ts:115

getDataModel

  • getDataModel(): SwimlaneModel | null

    Returns the internal SwimlaneModel for this layout algorithm.

    Returns SwimlaneModel | null

    • Defined in view/layout/SwimlaneLayout.ts:182

getEdges

  • getEdges(cell: Cell): Cell[]

    Returns the connected edges for the given cell.

    Parameters

    • cell: Cell

      whose edges should be returned.

    Returns Cell[]

    • Defined in view/layout/SwimlaneLayout.ts:425

getEdgesBetween

  • getEdgesBetween(source: Cell, target: Cell, directed?: boolean): Cell[]

    Returns the edges between the given source and target. This takes into account collapsed and invisible cells and ports.

    source - target - directed -

    Parameters

    • source: Cell
    • target: Cell
    • directed: boolean = false

    Returns Cell[]

    • Defined in view/layout/SwimlaneLayout.ts:693

getGraph

  • getGraph(): AbstractGraph

    Returns the graph that this layout operates on.

    Returns AbstractGraph

    Inherited from GraphLayout.getGraph

    • Defined in view/layout/GraphLayout.ts:98

getParentOffset

  • getParentOffset(parent: Cell | null): Point

    Determines the offset of the given parent to the parent of the layout

    Parameters

    • parent: Cell | null

    Returns Point

    Inherited from GraphLayout.getParentOffset

    • Defined in view/layout/GraphLayout.ts:261

getVertexBounds

  • getVertexBounds(cell: Cell): Rectangle

    Returns an Rectangle that defines the bounds of the given cell or the bounding box if useBoundingBox is true.

    Parameters

    • cell: Cell

    Returns Rectangle

    Inherited from GraphLayout.getVertexBounds

    • Defined in view/layout/GraphLayout.ts:380

getVisibleTerminal

  • getVisibleTerminal(edge: Cell, source: boolean): Cell | null

    Helper function to return visible terminal for edge allowing for ports

    Parameters

    • edge: Cell

      whose edges should be returned.

    • source: boolean

      Boolean that specifies whether the source or target terminal is to be returned

    Returns Cell | null

    • Defined in view/layout/SwimlaneLayout.ts:488

isAncestor

  • isAncestor(
        parent: Cell,
        child: Cell | null,
        traverseAncestors?: boolean,
    ): boolean

    Returns true if the given parent is an ancestor of the given child.

    Parameters

    • parent: Cell

      Cell that specifies the parent.

    • child: Cell | null

      Cell that specifies the child.

    • OptionaltraverseAncestors: boolean

      boolean whether to

    Returns boolean

    Inherited from GraphLayout.isAncestor

    • Defined in view/layout/GraphLayout.ts:191

isEdgeIgnored

  • isEdgeIgnored(edge: Cell): boolean

    Returns a boolean indicating if the given Cell should be ignored by the algorithm. This implementation returns false for all vertices.

    Parameters

    • edge: Cell

      Cell whose ignored state should be returned.

    Returns boolean

    Inherited from GraphLayout.isEdgeIgnored

    • Defined in view/layout/GraphLayout.ts:234

isPort

  • isPort(cell: Cell): boolean

    Returns true if the given cell is a "port", that is, when connecting to it, its parent is the connecting vertex in terms of graph traversal

    Parameters

    • cell: Cell

      that represents the port.

    Returns boolean

    • Defined in view/layout/SwimlaneLayout.ts:678

isVertexIgnored

  • isVertexIgnored(vertex: Cell): boolean

    Returns a boolean indicating if the given Cell should be ignored by the algorithm. This implementation returns false for all vertices.

    Parameters

    • vertex: Cell

      Cell whose ignored state should be returned.

    Returns boolean

    Inherited from GraphLayout.isVertexIgnored

    • Defined in view/layout/GraphLayout.ts:224

isVertexMovable

  • isVertexMovable(cell: Cell): boolean

    Returns a boolean indicating if the given Cell is movable or bendable by the algorithm. This implementation returns true if the given cell is movable in the graph.

    Parameters

    • cell: Cell

      Cell whose movable state should be returned.

    Returns boolean

    Inherited from GraphLayout.isVertexMovable

    • Defined in view/layout/GraphLayout.ts:214

layeringStage

  • layeringStage(): void

    Implements first stage of a Sugiyama layout.

    Returns void

    • Defined in view/layout/SwimlaneLayout.ts:836

moveCell

  • moveCell(cell: Cell, x: number, y: number): void

    Notified when a cell is being moved in a parent that has automatic layout to update the cell state (eg. index) so that the outcome of the layout will position the vertex as close to the point (x, y) as possible.

    Empty implementation.

    Parameters

    • cell: Cell

      Cell which has been moved.

    • x: number

      X-coordinate of the new cell location.

    • y: number

      Y-coordinate of the new cell location.

    Returns void

    Inherited from GraphLayout.moveCell

    • Defined in view/layout/GraphLayout.ts:68

placementStage

  • placementStage(initialX: number, parent: Cell): number

    Executes the placement stage using mxCoordinateAssignment.

    Parameters

    • initialX: number
    • parent: Cell

    Returns number

    • Defined in view/layout/SwimlaneLayout.ts:853

resizeCell

  • resizeCell(cell: Cell, bounds: Rectangle, prev?: Cell): void

    Notified when a cell is being resized in a parent that has automatic layout to update the other cells in the layout.

    Empty implementation.

    Parameters

    • cell: Cell

      Cell which has been moved.

    • bounds: Rectangle

      Rectangle that represents the new cell bounds.

    • Optionalprev: Cell

    Returns void

    Inherited from GraphLayout.resizeCell

    • Defined in view/layout/GraphLayout.ts:82

run

  • run(parent: Cell): void

    The API method used to exercise the layout upon the graph description and produce a separate description of the vertex position and edge routing changes made. It runs each stage of the layout that has been created.

    Parameters

    • parent: Cell

    Returns void

    • Defined in view/layout/SwimlaneLayout.ts:525

setEdgePoints

  • setEdgePoints(edge: Cell, points: Point[] | null): void

    Replaces the array of Point in the geometry of the given edge with the given array of Point.

    Parameters

    • edge: Cell
    • points: Point[] | null

    Returns void

    Inherited from GraphLayout.setEdgePoints

    • Defined in view/layout/GraphLayout.ts:286

setEdgeStyleEnabled

  • setEdgeStyleEnabled(edge: Cell, value: boolean): void

    Disables or enables the edge style of the given edge.

    Parameters

    • edge: Cell
    • value: boolean

    Returns void

    Inherited from GraphLayout.setEdgeStyleEnabled

    • Defined in view/layout/GraphLayout.ts:246

setOrthogonalEdge

  • setOrthogonalEdge(edge: Cell, value: boolean): void

    Disables or enables orthogonal end segments of the given edge.

    Parameters

    • edge: Cell
    • value: boolean

    Returns void

    Inherited from GraphLayout.setOrthogonalEdge

    • Defined in view/layout/GraphLayout.ts:253

setVertexLocation

  • setVertexLocation(cell: Cell, x: number, y: number): Rectangle | null

    Sets the new position of the given cell taking into account the size of the bounding box if useBoundingBox is true. The change is only carried out if the new location is not equal to the existing location, otherwise the geometry is not replaced with an updated instance. The new or old bounds are returned (including overlapping labels).

    Parameters

    • cell: Cell

      Cell whose geometry is to be set.

    • x: number

      Integer that defines the x-coordinate of the new location.

    • y: number

      Integer that defines the y-coordinate of the new location.

    Returns Rectangle | null

    Inherited from GraphLayout.setVertexLocation

    • Defined in view/layout/GraphLayout.ts:324

traverse

  • traverse(
        vertex: SwimlaneGraphLayoutTraverseArgs,
    ): { [key: string]: Cell | null }

    Traverses the (directed) graph invoking the given function for each visited vertex and edge. The function is invoked with the current vertex and the incoming edge as a parameter. This implementation makes sure each vertex is only visited once. The function may return false if the traversal should stop at the given vertex.

    Parameters

    • vertex: SwimlaneGraphLayoutTraverseArgs

      that represents the vertex where the traversal starts.

    Returns { [key: string]: Cell | null }

    Overrides GraphLayout.traverse

    • Defined in view/layout/SwimlaneLayout.ts:728

updateGroupBounds

  • updateGroupBounds(): void

    Updates the bounds of the given array of groups so that it includes all child vertices.

    Returns void

    • Defined in view/layout/SwimlaneLayout.ts:281

Settings

Member Visibility
  • Protected
  • Inherited
Theme

On This Page

Constructors
constructor
Properties
deterministicdisableEdgeStyledummyVertexWidthedgesCacheedgeSourceTermCacheedgesTargetTermCacheedgeStylefineTuninggraphinterHierarchySpacinginterRankCellSpacingintraCellSpacingmaintainParentLocationmodelmoveParentorientationparallelEdgeSpacingparentparentBorderparentXparentYresizeParentrootsswimlanestightenToSourcetraverseAncestorsuseBoundingBox
Methods
arrangeGroupscrossingStagecycleStageexecutefilterDescendantsfindRootsgetConstraintgetDataModelgetEdgesgetEdgesBetweengetGraphgetParentOffsetgetVertexBoundsgetVisibleTerminalisAncestorisEdgeIgnoredisPortisVertexIgnoredisVertexMovablelayeringStagemoveCellplacementStageresizeCellrunsetEdgePointssetEdgeStyleEnabledsetOrthogonalEdgesetVertexLocationtraverseupdateGroupBounds
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.