Class CircularLayout

This layout positions nodes in a circular arrangement. This layout makes use of a LayoutNetwork of CircularVertexes and CircularEdges that normally correspond to the Nodes and Links of the Diagram.

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): CircularLayout

Constructs a CircularLayout with no Layout#network and with no owning Layout#diagram.

Returns

CircularLayout

Properties

public static Ascending: EnumValue

Nodes are sorted using the #comparer, in ascending order; This value is used for CircularLayout#sorting.

public static BidirectionalLeft: EnumValue

The ring is filled by alternating sides; the second node is counterclockwise from the first node; This value is used for CircularLayout#direction.

public static BidirectionalRight: EnumValue

The ring is filled by alternating sides; the second node is clockwise from the first node; This value is used for CircularLayout#direction.

public static Circular: EnumValue

The effective diameter is either the width or height of the node, whichever is larger; This will cause circular nodes to touch when CircularLayout#spacing is 0; This is ideal when the nodes are circular.

public static Clockwise: EnumValue

Rings are filled clockwise; This value is used for CircularLayout#direction.

public static ConstantAngle: EnumValue

The angular distance between the nodes is constant; This value is used for CircularLayout#arrangement.

public static ConstantDistance: EnumValue

The distance between the centers of the nodes is constant; This value is used for CircularLayout#arrangement.

public static ConstantSpacing: EnumValue

The spacing between the idealized boundaries of the nodes is constant; This value is used for CircularLayout#arrangement.

public static Counterclockwise: EnumValue

Rings are filled counterclockwise; This value is used for CircularLayout#direction.

public static Descending: EnumValue

Nodes are sorted using the #comparer, in reverse ascending (descending) order; This value is used for CircularLayout#sorting.

public static Forwards: EnumValue

Nodes are arranged in the order given; This value is used for CircularLayout#sorting.

public static Optimized: EnumValue

Nodes are ordered to reduce link crossings; This value is used for CircularLayout#sorting.

public static Packed: EnumValue

The vertices are arranged as close together as possible considering the CircularLayout#spacing, assuming the nodes are rectangular; This value is used for CircularLayout#arrangement.

public static Pythagorean: EnumValue

The effective diameter is sqrt(width^2+height^2); The corners of square nodes will touch at 45 degrees when CircularLayout#spacing is 0; This value is used for CircularLayout#nodeDiameterFormula.

public static Reverse: EnumValue

Nodes are arranged in the reverse of the order given; This value is used for CircularLayout#sorting.

public actualCenter: Point

Returns the coordinates of the center of the laid-out ellipse.

public actualSpacing: number

Gets the effective spacing that may have been calculated by the layout.

public actualXRadius: number

Gets the effective X radius that may have been calculated by the layout.

public actualYRadius: number

Gets the effective Y radius that may have been calculated by the layout.

public arrangement: EnumValue

Gets or sets how the nodes are spaced.

public arrangementOrigin: Point

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

public aspectRatio: number

Gets or sets the ratio of the arrangement's height to its width (1 for a circle, >1 for a vertically elongated ellipse).

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

Gets or sets the comparer which sorts the data when #sorting is set to CircularLayout#Ascending or CircularLayout#Descending.

public diagram: Diagram

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

public direction: EnumValue

Gets or sets whether the nodes are arranged clockwise or counterclockwise.

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 nodeDiameterFormula: EnumValue

Specifies how the diameter of nodes will be calculated.

public radius: number

Gets or sets the horizontal radius of the elliptical arrangement.

public sorting: EnumValue

Gets or sets if and how the nodes are sorted.

public spacing: number

Gets or sets the distance between nodes (if #radius is NaN) or the minimum distance between nodes (if #radius is a number).

public startAngle: number

Gets or sets the angle (in degrees, clockwise from the positive side of the X axis) of the first element.

public sweepAngle: number

Gets or sets the absolute angle (in degrees) between the first and last node.

Methods

public commitLayout(): any

Position each Node according to the Vertex position, and then position the Links.

Returns

any

public commitLinks(): any

Commit the position and routing of all edge links.

Returns

any

public commitNodes(): any

Commit the position of all vertex nodes.

Returns

any

public copy(): Layout

Creates a copy of this Layout and returns it.

Returns

Layout

public createNetwork(): LayoutNetwork

Create a new LayoutNetwork of CircularVertexes and CircularEdges.

Returns

LayoutNetwork

public doLayout(coll: Diagram): any

Assign the positions of the vertexes in the network.

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