Snake Algorithm

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The snake algorithm arranges child layout nodes along a linear path in two dimensions, allowing the linear flow to continue across multiple rows or columns.

Parameters

Parameter

Values

Description

bkpt

  • endCnv (end of canvas, default)

  • bal (balanced)

  • fixed

Specifies the point at which the diagram starts to snake. The value bal specifies that snaking begins at an even number of rows and columns. The value fixed specifies that snaking begins at a fixed point (for example, in a row that contains three nodes). The value endCnv specifies that snaking begins when there is no more room for a shape in the row.

bkPtFixedVal

An integer from 1 through 32766. The default is 2.

Specifies where the snake should break, if the value of the bkpt parameter is fixed.

off

  • ctr (center)

  • off (offset, default)

Specifies whether each row and column is centered or offset from the previous row or column. If the value is off, the algorithm uses the alignOff constraint.

contDir

  • revDir (reverse direction)

  • sameDir (same direction, default)

Specifies the direction of the subsequent row or column. For example, if the algorithm initially places the nodes from left to right, revDir places the nodes in the next row from right to left. However if the algorithm uses sameDir, the nodes on the next row are arranged from left to right.

grDir

  • tL (top left, default)

  • tR (top right)

  • bL (bottom left)

  • bR (bottom right)

Specifies from which corner the snake grows. For example, if the algorithm uses the tL value, the snake grows from the top left.

flowDir

  • row (row, default)

  • col (column)

Specifies whether nodes are arranged in rows or columns.

nodeHorzAlign

  • l (left)

  • ctr (center, default)

  • r (right)

Specifies how child nodes are aligned along the x-axis in the extent of the layout node. For example, you can align the tops of all the child nodes by using node alignment, and then center the entire results in the canvas by using horzAlign or vertAlign.

nodeVertAlign

  • t (top)

  • mid (middle, default)

  • b (bottom)

Specifies how child nodes are aligned along the y-axis in the extent of the layout node. For example, you can align the sides of all the child nodes but center them vertically in the canvas.

Constraints

Constraint

Default value

Description

w

100

Specifies the width of the bounding box for a node.

h

100

Specifies the height of the bounding box for a node.

alignOff

0

Specifies the amount to offset each row or column, if the off parameter is set to off.

sp

0

Specifies the spacing between rows.

begPad

0

Specifies the beginning padding.

endPad

0

Specifies the ending padding.

See Also

Concepts

Algorithms, Parameters, and Constraints