The Grid Layout (GL) has two main modes: grid and row/column.
- In grid mode, the layout arranges the nodes of a graph in the cells of a grid (matrix). If a node is too large to fit in one grid cell (with margins), it occupies multiple cells. The size of the grid cells and the margins are parameters of the algorithm.
- In row/column mode, the layout arranges the nodes of a graph either by rows or by columns (according to the specified option). The width of the rows is controlled by the width of the layout region parameter. The height of the columns is controlled by the height of the layout region parameter. The horizontal and vertical margins between the nodes are parameters of the algorithm.
GL Example
The following code sample uses the GridLayout class. This code sample shows
how to perform a Grid Layout:
dojo.require("ibm_ilog.graphlayout.grid.GridLayout"); var gridLayout = new ibm_ilog.graphlayout.grid.GridLayout(); graph.setNodeLayout(gridLayout); graph.performGraphLayout();