Class GridLayout

This simple layout places all of the Parts in a grid-like arrangement, ordered, spaced apart, and wrapping as needed. It ignores any Links connecting the Nodes being laid out.

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): GridLayout

This simple layout places all of the Parts in a grid-like arrangement, ordered, spaced apart, and wrapping as needed. It ignores any Links connecting the Nodes being laid out.

Returns

GridLayout

Properties

public static Ascending: EnumValue

Lay out each child according to the sort order given by GridLayout#comparer; This value is used for GridLayout#sorting.

public static Descending: EnumValue

Lay out each child in reverse sort order given by GridLayout#comparer; This value is used for GridLayout#sorting.

public static Forward: EnumValue

Lay out each child in the order in which they were found; This value is used for GridLayout#sorting.

public static LeftToRight: EnumValue

Fill each row from left to right; This value is used for GridLayout#arrangement.

public static Location: EnumValue

Position the part's Part#location at a grid point; This value is used for GridLayout#alignment.

public static Position: EnumValue

Position the top-left corner of each part at a grid point; This value is used for GridLayout#alignment.

public static Reverse: EnumValue

Lay out each child in reverse order from which they were found; This value is used for GridLayout#sorting.

public static RightToLeft: EnumValue

Fill each row from right to left; This value is used for GridLayout#arrangement.

public alignment: EnumValue

Gets or sets whether the Part#location or the position should be used to arrange each part.

public arrangement: EnumValue

Gets or sets how to arrange the parts.

public arrangementOrigin: Point

Gets or sets the top-left point for where the graph should be positioned when laid out.

public cellSize: Size

Gets or sets the minimum part size by which each part is positioned in the grid.

public comparer: (a: go.Part, b: go.Part) => number

Gets or sets the comparison function used to sort the parts.

public diagram: Diagram

Gets the Diagram that owns this layout, if it is the value of Diagram#layout.

public group: Group

Gets the Group that uses this layout, if it is the value of a group's Group#layout.

public isInitial: boolean

Gets or sets whether this layout is performed on an initial layout.

public isOngoing: boolean

Gets or sets whether this layout can be invalidated by #invalidateLayout.

public isRealtime: boolean

Gets or sets whether this layout be performed in real-time, before the end of a transaction.

public isRouting: boolean

Gets or sets whether this layout routes Links.

public isValidLayout: boolean

Gets or sets whether this layout needs to be performed again.

public isViewportSized: boolean

Gets or sets whether this layout depends on the Diagram#viewportBounds's size.

public newtork: LayoutNetwork

Gets or sets the LayoutNetwork used by this Layout, if any.

public sorting: EnumValue

Gets or sets what order to place the parts.

public spacing: Size

Gets or sets the minimum horizontal and vertical space between parts.

public wrappingColumn: number

Gets or sets the maximum number of columns.

public wrappingWidth: number

Gets or sets the wrapping width.

Methods

public commitLayout(): any

When using a LayoutNetwork, commit changes to the diagram by setting Node positions and by routing the Links.

Returns

any

public copy(): Layout

Creates a copy of this Layout and returns it.

Returns

Layout

public createNetwork(): LayoutNetwork

Create a new LayoutNetwork of LayoutVertexes and LayoutEdges.

Returns

LayoutNetwork

public doLayout(coll: Diagram): any

Assign the positions of the parts, ignoring any links.

Parameters

  • coll: Diagram

    A Diagram or a Group or a collection of Parts.

Returns

any

public doLayout(coll: Group): any

Parameters

Returns

any

public doLayout(coll: Iterable): any

Parameters

Returns

any

public invalidateLayout(): any

If #isOngoing is true and if an initial layout has not yet been performed, set the #isValidLayout property to false, and ask to perform another layout in the near future.

Returns

any

public makeNetwork(coll: Diagram): LayoutNetwork

Create and initialize a LayoutNetwork with the given nodes and links.

Parameters

  • coll: Diagram

    A Diagram or a Group or a collection of Parts.

Returns

LayoutNetwork

public makeNetwork(coll: Group): LayoutNetwork

Parameters

Returns

LayoutNetwork

public makeNetwork(coll: Iterable): LayoutNetwork

Parameters

Returns

LayoutNetwork

public updateParts(): any

When using a LayoutNetwork, update the "physical" node positionings and link routings.

Returns

any