layout.grid Object

Each layout algorithm has a different set of parameters customizing the layout but they also all have a common collection of parameters which relate to the way 'pieces' of a diagram are organized.

A diagram can have in general disconnected pieces, known as components, which can be organized in a way independent of the way a component on its own is arranged. In the picture above, this is one diagram consisting of four components.

When you apply a certain layout an analysis will first split the diagram in components, arrange each component individually and thereafter organize the components in a grid. The common parameters referred above deal with this grid layout, they define the width, margin and padding of the (invisible) grid used to organize the components.

layout.grid.componentSpacingX Number (default: 50)

Defines the horizontal spacing between each component. The default is 50.

layout.grid.componentSpacingY Number (default: 50)

Defines the vertical spacing between each component. The default is 50.

layout.grid.offsetX Number (default: 50)

Defines the left offset of the grid layout. The default is 50.

layout.grid.offsetY Number (default: 50)

Defines the top offset of the grid layout. The default is 50.

layout.grid.width Number (default: 1500)

Defines the width of the grid. The bigger this parameter the more components will be organized in an horizontal row. How many components really depends on your diagram and they type of layout applied to each component. The default is set to 800.

In this article