Implements a grid graph layout algorithm.
Namespace: MindFusion.Graphs
File: GridLayout.js
JavaScript
![]() |
---|
// class |
GridLayout arranges diagram nodes in a grid, keeping connected nodes close to each other. The algorithm strives to achieve a small number of link crossings. It is based on an iterative process whose initial steps shuffle the grid nodes randomly. That can lead to very different results each time the algorithm is run.
To apply the layout to a diagram, create a GridLayout instance, set its property values, and invoke the arrange method.
The distance between points in the layout grid can be changed through gridSize. Nodes to be placed at the upper-left and lower-right corners of the grid can be assigned to startNode and endNode.
MindFusion.Graphs.Layout
MindFusion.Graphs.GridLayout