Class Layout

This is the base class for all of the predefined diagram layout implementations. They only arrange Parts (primarily Nodes and Links) in a Diagram, not to GraphObjects in Panels (i.e. panel layout).

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): Layout

Create a minimal layout that only positions Nodes that do not have a location.

Returns

Layout

Properties

public arrangementOrigin: Point

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

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.

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

Position all of the nodes that do not have an assigned Part#location in the manner of a simple rectangular array.

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