mxSwimlaneLayout

A hierarchical layout algorithm.

Summary
mxSwimlaneLayoutA hierarchical layout algorithm.
Functions
mxSwimlaneLayoutConstructs a new hierarchical layout algorithm.
Variables
rootsHolds the array of mxCell that this layout contains.
swimlanesHolds the array of mxCell of the ordered swimlanes to lay out
dummyVertexWidthThe cell width of any dummy vertices inserted
resizeParentSpecifies if the parent should be resized after the layout so that it contains all the child cells.
maintainParentLocationSpecifies if the parent location should be maintained, so that the top, left corner stays the same before and after execution of the layout.
moveParentSpecifies if the parent should be moved if resizeParent is enabled.
parentBorderThe border to be added around the children if the parent is to be resized using resizeParent.
intraCellSpacingThe spacing buffer added between cells on the same layer.
interRankCellSpacingThe spacing buffer added between cell on adjacent layers.
interHierarchySpacingThe spacing buffer between unconnected hierarchies.
parallelEdgeSpacingThe distance between each parallel edge on each ranks for long edges.
orientationThe position of the root node(s) relative to the laid out graph in.
fineTuningWhether or not to perform local optimisations and iterate multiple times through the algorithm.
tightenToSourceWhether or not to tighten the assigned ranks of vertices up towards the source cells.
disableEdgeStyleSpecifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result.
traverseAncestorsWhether or not to drill into child cells and layout in reverse group order.
modelThe internal mxSwimlaneModel formed of the layout.
edgesSetA cache of edges whose source terminal is the key
edgesSetA cache of edges whose source terminal is the key
edgesSetA cache of edges whose source terminal is the key
edgeStyleThe style to apply between cell layers to edge segments.
Functions
getModelReturns the internal mxSwimlaneModel for this layout algorithm.
executeExecutes the layout for the children of the specified parent.
updateGroupBoundsUpdates the bounds of the given array of groups so that it includes all child vertices.
findRootsReturns all visible children in the given parent which do not have incoming edges.
getEdgesReturns the connected edges for the given cell.
getVisibleTerminalHelper function to return visible terminal for edge allowing for ports
runThe 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.
filterDescendantsCreates an array of descendant cells
isPortReturns 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
getEdgesBetweenReturns the edges between the given source and target.
cycleStageExecutes the cycle stage using mxMinimumCycleRemover.
layeringStageImplements first stage of a Sugiyama layout.
crossingStageExecutes the crossing stage using mxMedianHybridCrossingReduction.
placementStageExecutes the placement stage using mxCoordinateAssignment.

Functions

mxSwimlaneLayout

function mxSwimlaneLayout(graph,
orientation,
deterministic)

Constructs a new hierarchical layout algorithm.

Arguments

graphReference to the enclosing mxGraph.
orientationOptional constant that defines the orientation of this layout.
deterministicOptional boolean that specifies if this layout should be deterministic.  Default is true.

Variables

roots

mxSwimlaneLayout.prototype.roots

Holds the array of mxCell that this layout contains.

swimlanes

mxSwimlaneLayout.prototype.swimlanes

Holds the array of mxCell of the ordered swimlanes to lay out

dummyVertexWidth

mxSwimlaneLayout.prototype.dummyVertexWidth

The cell width of any dummy vertices inserted

resizeParent

mxSwimlaneLayout.prototype.resizeParent

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

maintainParentLocation

mxSwimlaneLayout.prototype.maintainParentLocation

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.

moveParent

mxSwimlaneLayout.prototype.moveParent

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

parentBorder

mxSwimlaneLayout.prototype.parentBorder

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

intraCellSpacing

mxSwimlaneLayout.prototype.intraCellSpacing

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

interRankCellSpacing

mxSwimlaneLayout.prototype.interRankCellSpacing

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

interHierarchySpacing

mxSwimlaneLayout.prototype.interHierarchySpacing

The spacing buffer between unconnected hierarchies.  Default is 60.

parallelEdgeSpacing

mxSwimlaneLayout.prototype.parallelEdgeSpacing

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

orientation

mxSwimlaneLayout.prototype.orientation

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

fineTuning

mxSwimlaneLayout.prototype.fineTuning

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

tightenToSource

mxSwimlaneLayout.prototype.tightenToSource

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

disableEdgeStyle

mxSwimlaneLayout.prototype.disableEdgeStyle

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

traverseAncestors

mxSwimlaneLayout.prototype.traverseAncestors

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.

model

mxSwimlaneLayout.prototype.model

The internal mxSwimlaneModel formed of the layout.

edgesSet

A cache of edges whose source terminal is the key

edgesSet

A cache of edges whose source terminal is the key

edgesSet

A cache of edges whose source terminal is the key

edgeStyle

mxHierarchicalLayout.prototype.edgeStyle

The style to apply between cell layers to edge segments.  Default is <mxHierarchicalEdgeStyle.POLYLINE>.

Functions

getModel

mxSwimlaneLayout.prototype.getModel = function()

Returns the internal mxSwimlaneModel for this layout algorithm.

execute

mxSwimlaneLayout.prototype.execute = function(parent,
swimlanes)

Executes the layout for the children of the specified parent.

Parameters

parentParent mxCell that contains the children to be laid out.
swimlanesOrdered array of swimlanes to be laid out

updateGroupBounds

mxSwimlaneLayout.prototype.updateGroupBounds = function()

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

findRoots

mxSwimlaneLayout.prototype.findRoots = function(parent,
vertices)

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

parentmxCell whose children should be checked.
verticesarray of vertices to limit search to

getEdges

mxSwimlaneLayout.prototype.getEdges = function(cell)

Returns the connected edges for the given cell.

Parameters

cellmxCell whose edges should be returned.

getVisibleTerminal

mxSwimlaneLayout.prototype.getVisibleTerminal = function(edge,
source)

Helper function to return visible terminal for edge allowing for ports

Parameters

edgemxCell whose edges should be returned.
sourceBoolean that specifies whether the source or target terminal is to be returned

run

mxSwimlaneLayout.prototype.run = function(parent)

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.

filterDescendants

mxSwimlaneLayout.prototype.filterDescendants = function(cell,
result)

Creates an array of descendant cells

isPort

mxSwimlaneLayout.prototype.isPort = function(cell)

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

cellmxCell that represents the port.

getEdgesBetween

mxSwimlaneLayout.prototype.getEdgesBetween = function(source,
target,
directed)

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

Parameters

source - target - directed -

cycleStage

mxSwimlaneLayout.prototype.cycleStage = function(parent)

Executes the cycle stage using mxMinimumCycleRemover.

layeringStage

mxSwimlaneLayout.prototype.layeringStage = function()

Implements first stage of a Sugiyama layout.

crossingStage

mxSwimlaneLayout.prototype.crossingStage = function(parent)

Executes the crossing stage using mxMedianHybridCrossingReduction.

placementStage

mxSwimlaneLayout.prototype.placementStage = function(initialX,
parent)

Executes the placement stage using mxCoordinateAssignment.

function mxSwimlaneLayout(graph,
orientation,
deterministic)
Constructs a new hierarchical layout algorithm.
mxSwimlaneLayout.prototype.roots
Holds the array of mxCell that this layout contains.
Cells are the elements of the graph model.
mxSwimlaneLayout.prototype.swimlanes
Holds the array of mxCell of the ordered swimlanes to lay out
mxSwimlaneLayout.prototype.dummyVertexWidth
The cell width of any dummy vertices inserted
mxSwimlaneLayout.prototype.resizeParent
Specifies if the parent should be resized after the layout so that it contains all the child cells.
mxSwimlaneLayout.prototype.maintainParentLocation
Specifies if the parent location should be maintained, so that the top, left corner stays the same before and after execution of the layout.
mxSwimlaneLayout.prototype.moveParent
Specifies if the parent should be moved if resizeParent is enabled.
mxSwimlaneLayout.prototype.parentBorder
The border to be added around the children if the parent is to be resized using resizeParent.
mxSwimlaneLayout.prototype.intraCellSpacing
The spacing buffer added between cells on the same layer.
mxSwimlaneLayout.prototype.interRankCellSpacing
The spacing buffer added between cell on adjacent layers.
mxSwimlaneLayout.prototype.interHierarchySpacing
The spacing buffer between unconnected hierarchies.
mxSwimlaneLayout.prototype.parallelEdgeSpacing
The distance between each parallel edge on each ranks for long edges.
mxSwimlaneLayout.prototype.orientation
The position of the root node(s) relative to the laid out graph in.
mxSwimlaneLayout.prototype.fineTuning
Whether or not to perform local optimisations and iterate multiple times through the algorithm.
mxSwimlaneLayout.prototype.tightenToSource
Whether or not to tighten the assigned ranks of vertices up towards the source cells.
mxSwimlaneLayout.prototype.disableEdgeStyle
Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result.
mxSwimlaneLayout.prototype.traverseAncestors
Whether or not to drill into child cells and layout in reverse group order.
mxSwimlaneLayout.prototype.model
The internal mxSwimlaneModel formed of the layout.
Internal model of a hierarchical graph.
mxHierarchicalLayout.prototype.edgeStyle
The style to apply between cell layers to edge segments.
mxSwimlaneLayout.prototype.getModel = function()
Returns the internal mxSwimlaneModel for this layout algorithm.
mxSwimlaneLayout.prototype.execute = function(parent,
swimlanes)
Executes the layout for the children of the specified parent.
mxSwimlaneLayout.prototype.updateGroupBounds = function()
Updates the bounds of the given array of groups so that it includes all child vertices.
mxSwimlaneLayout.prototype.findRoots = function(parent,
vertices)
Returns all visible children in the given parent which do not have incoming edges.
mxSwimlaneLayout.prototype.getEdges = function(cell)
Returns the connected edges for the given cell.
mxSwimlaneLayout.prototype.getVisibleTerminal = function(edge,
source)
Helper function to return visible terminal for edge allowing for ports
mxSwimlaneLayout.prototype.run = function(parent)
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.
mxSwimlaneLayout.prototype.filterDescendants = function(cell,
result)
Creates an array of descendant cells
mxSwimlaneLayout.prototype.isPort = function(cell)
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
mxSwimlaneLayout.prototype.getEdgesBetween = function(source,
target,
directed)
Returns the edges between the given source and target.
mxSwimlaneLayout.prototype.cycleStage = function(parent)
Executes the cycle stage using mxMinimumCycleRemover.
mxSwimlaneLayout.prototype.layeringStage = function()
Implements first stage of a Sugiyama layout.
mxSwimlaneLayout.prototype.crossingStage = function(parent)
Executes the crossing stage using mxMedianHybridCrossingReduction.
mxSwimlaneLayout.prototype.placementStage = function(initialX,
parent)
Executes the placement stage using mxCoordinateAssignment.
Extends mxEventSource to implement a graph component for the browser.
DIRECTION_NORTH: 'north'
Constant for direction north.
Close