Skip to main content
GridLayoutParameters
Options for the GridLayout.
NameTypeDescription
columns?numberOptional fixed number of columns. By default this is set to -1 - meaning not fixed - which will result in the layout making its best effort at drawing a grid of equal width and height
height?numberOptional fixed height for the layout.
horizontalAlignment?GridLayoutHorizontalAlignmentOptional alignment for horizontal placement in cells. Defaults to center.
locationFunction?LocationFunctionOptional function that, given some vertex, can provide the x/y location of the vertex on the canvas
orientation?GridLayoutOrientationWhether to lay out items row first or column first. Additionally, this setting will determine where any extra items are placed if the dataset does not conform to a grid of equal width and height
padding?PointXYOptional padding to put around the elements.
rows?numberOptional fixed number of rows. By default this is set to -1 - meaning not fixed - which will result in the layout making its best effort at drawing a grid of equal width and height.
sort?(a:Node | Group, b:Node | Group) => numberOptional sort function to run before layout.
verticalAlignment?GridLayoutVerticalAlignmentOptional alignment for vertical placement in cells. Defaults to center.
width?numberOptional fixed width for the layout.