mxStackLayout

Extends mxGraphLayout to create a horizontal or vertical stack of the child vertices.  The children do not need to be connected for this layout to work.

Example

var layout = new mxStackLayout(graph, true);
layout.execute(graph.getDefaultParent());
Summary
mxStackLayoutExtends mxGraphLayout to create a horizontal or vertical stack of the child vertices.
Functions
mxStackLayoutConstructs a new stack layout layout for the specified graph, spacing, orientation and offset.
Variables
horizontalSpecifies the orientation of the layout.
spacingSpecifies the spacing between the cells.
x0Specifies the horizontal origin of the layout.
y0Specifies the vertical origin of the layout.
borderBorder to be added if fill is true.
marginTopTop margin for the child area.
marginLeftTop margin for the child area.
marginRightTop margin for the child area.
marginBottomTop margin for the child area.
keepFirstLocationBoolean indicating if the location of the first cell should be kept, that is, it will not be moved to x0 or y0.
fillBoolean indicating if dimension should be changed to fill out the parent cell.
resizeParentIf the parent should be resized to match the width/height of the stack.
resizeParentMaxUse maximum of existing value and new value for resize of parent.
resizeLastIf the last element should be resized to fill out the parent.
wrapValue at which a new column or row should be created.
borderCollapseIf the strokeWidth should be ignored.
allowGapsIf gaps should be allowed in the stack.
gridSizeGrid size for alignment of position and size.
Functions
isHorizontalReturns horizontal.
moveCellImplements mxGraphLayout.moveCell.
getParentSizeReturns the size for the parent container or the size of the graph container if the parent is a layer or the root of the model.
getLayoutCellsReturns the cells to be layouted.
snapSnaps the given value to the grid size.
executeImplements mxGraphLayout.execute.
executeImplements mxGraphLayout.execute.
executeImplements mxGraphLayout.execute.

Functions

mxStackLayout

function mxStackLayout(graph,
horizontal,
spacing,
x0,
y0,
border)

Constructs a new stack layout layout for the specified graph, spacing, orientation and offset.

Variables

horizontal

mxStackLayout.prototype.horizontal

Specifies the orientation of the layout.  Default is true.

spacing

mxStackLayout.prototype.spacing

Specifies the spacing between the cells.  Default is 0.

x0

mxStackLayout.prototype.x0

Specifies the horizontal origin of the layout.  Default is 0.

y0

mxStackLayout.prototype.y0

Specifies the vertical origin of the layout.  Default is 0.

border

mxStackLayout.prototype.border

Border to be added if fill is true.  Default is 0.

marginTop

mxStackLayout.prototype.marginTop

Top margin for the child area.  Default is 0.

marginLeft

mxStackLayout.prototype.marginLeft

Top margin for the child area.  Default is 0.

marginRight

mxStackLayout.prototype.marginRight

Top margin for the child area.  Default is 0.

marginBottom

mxStackLayout.prototype.marginBottom

Top margin for the child area.  Default is 0.

keepFirstLocation

mxStackLayout.prototype.keepFirstLocation

Boolean indicating if the location of the first cell should be kept, that is, it will not be moved to x0 or y0.

fill

mxStackLayout.prototype.fill

Boolean indicating if dimension should be changed to fill out the parent cell.  Default is false.

resizeParent

mxStackLayout.prototype.resizeParent

If the parent should be resized to match the width/height of the stack.  Default is false.

resizeParentMax

mxStackLayout.prototype.resizeParentMax

Use maximum of existing value and new value for resize of parent.  Default is false.

resizeLast

mxStackLayout.prototype.resizeLast

If the last element should be resized to fill out the parent.  Default is false.  If resizeParent is true then this is ignored.

wrap

mxStackLayout.prototype.wrap

Value at which a new column or row should be created.  Default is null.

borderCollapse

mxStackLayout.prototype.borderCollapse

If the strokeWidth should be ignored.  Default is true.

allowGaps

mxStackLayout.prototype.allowGaps

If gaps should be allowed in the stack.  Default is false.

gridSize

mxStackLayout.prototype.gridSize

Grid size for alignment of position and size.  Default is 0.

Functions

isHorizontal

mxStackLayout.prototype.isHorizontal = function()

Returns horizontal.

moveCell

mxStackLayout.prototype.moveCell = function(cell,
x,
y)

Implements mxGraphLayout.moveCell.

getParentSize

mxStackLayout.prototype.getParentSize = function(parent)

Returns the size for the parent container or the size of the graph container if the parent is a layer or the root of the model.

getLayoutCells

mxStackLayout.prototype.getLayoutCells = function(parent)

Returns the cells to be layouted.

snap

mxStackLayout.prototype.snap = function(value)

Snaps the given value to the grid size.

execute

mxStackLayout.prototype.execute = function(parent)

Implements mxGraphLayout.execute.

Only children where <isVertexIgnored> returns false are taken into account.

execute

Implements mxGraphLayout.execute.

Only children where <isVertexIgnored> returns false are taken into account.

execute

Implements mxGraphLayout.execute.

Only children where <isVertexIgnored> returns false are taken into account.

Base class for all layout algorithms in mxGraph.
function mxStackLayout(graph,
horizontal,
spacing,
x0,
y0,
border)
Constructs a new stack layout layout for the specified graph, spacing, orientation and offset.
mxStackLayout.prototype.horizontal
Specifies the orientation of the layout.
mxStackLayout.prototype.spacing
Specifies the spacing between the cells.
mxStackLayout.prototype.x0
Specifies the horizontal origin of the layout.
mxStackLayout.prototype.y0
Specifies the vertical origin of the layout.
mxStackLayout.prototype.border
Border to be added if fill is true.
mxStackLayout.prototype.marginTop
Top margin for the child area.
mxStackLayout.prototype.marginLeft
Top margin for the child area.
mxStackLayout.prototype.marginRight
Top margin for the child area.
mxStackLayout.prototype.marginBottom
Top margin for the child area.
mxStackLayout.prototype.keepFirstLocation
Boolean indicating if the location of the first cell should be kept, that is, it will not be moved to x0 or y0.
mxStackLayout.prototype.fill
Boolean indicating if dimension should be changed to fill out the parent cell.
mxStackLayout.prototype.resizeParent
If the parent should be resized to match the width/height of the stack.
mxStackLayout.prototype.resizeParentMax
Use maximum of existing value and new value for resize of parent.
mxStackLayout.prototype.resizeLast
If the last element should be resized to fill out the parent.
mxStackLayout.prototype.wrap
Value at which a new column or row should be created.
mxStackLayout.prototype.borderCollapse
If the strokeWidth should be ignored.
mxStackLayout.prototype.allowGaps
If gaps should be allowed in the stack.
mxStackLayout.prototype.gridSize
Grid size for alignment of position and size.
mxStackLayout.prototype.isHorizontal = function()
Returns horizontal.
mxStackLayout.prototype.moveCell = function(cell,
x,
y)
Implements mxGraphLayout.moveCell.
mxGraphLayout.prototype.moveCell = function(cell,
x,
y)
Notified when a cell is being moved in a parent that has automatic layout to update the cell state (eg.
mxStackLayout.prototype.getParentSize = function(parent)
Returns the size for the parent container or the size of the graph container if the parent is a layer or the root of the model.
mxStackLayout.prototype.getLayoutCells = function(parent)
Returns the cells to be layouted.
mxStackLayout.prototype.snap = function(value)
Snaps the given value to the grid size.
mxStackLayout.prototype.execute = function(parent)
Implements mxGraphLayout.execute.
mxGraphLayout.prototype.execute = function(parent)
Executes the layout algorithm for the children of the given parent.
Close