Class TreeLayout

This layout positions nodes in a tree-like arrangement.

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): TreeLayout

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

Returns

TreeLayout

Properties

public static AlignmentBottomRightBus: EnumValue

The children are positioned in a bus, only on the bottom or right side of the parent; This value is used for TreeLayout#alignment or TreeLayout#alternateAlignment.

public static AlignmentBus: EnumValue

The children are positioned in a bus on both sides of an "aisle" where the links to them go, with the last odd child (if any) placed at the end of the aisle in the middle.

public static AlignmentBusBranching: EnumValue

Like TreeLayout#AlignmentBus with the children arranged on both sides of an "aisle" with any last odd child placed at the end of the aisle, but the children get an TreeVertex#angle that depends on which side of the aisle they were placed.

public static AlignmentCenterChildren: EnumValue

The parent is centered at the middle of the range of its immediate child nodes; This value is used for TreeLayout#alignment or TreeLayout#alternateAlignment.

public static AlignmentCenterSubtrees: EnumValue

The parent is centered at the middle of the range of its child subtrees; This value is used for TreeLayout#alignment or TreeLayout#alternateAlignment.

public static AlignmentEnd: EnumValue

The parent is positioned near the last of its children; This value is used for TreeLayout#alignment or TreeLayout#alternateAlignment.

public static AlignmentStart: EnumValue

The parent is positioned near the first of its children; This value is used for TreeLayout#alignment or TreeLayout#alternateAlignment.

public static AlignmentTopLeftBus: EnumValue

The children are positioned in a bus, only on the top or left side of the parent; This value is used for TreeLayout#alignment or TreeLayout#alternateAlignment.

public static ArrangementFixedRoots: EnumValue

Do not move each root node, but position all of their descendants relative to their root; This value is used for TreeLayout#arrangement.

public static ArrangementHorizontal: EnumValue

Position each tree in a non-overlapping fashion by increasing X coordinates, starting at the Layout#arrangementOrigin; This value is used for TreeLayout#arrangement.

public static ArrangementVertical: EnumValue

Position each tree in a non-overlapping fashion by increasing Y coordinates, starting at the Layout#arrangementOrigin; This value is used for TreeLayout#arrangement.

public static CompactionBlock: EnumValue

A simple fitting of subtrees; This value is used for TreeLayout#compaction or TreeLayout#alternateCompaction.

public static CompactionNone: EnumValue

Only simple placement of children next to each other, as determined by their subtree breadth; This value is used for TreeLayout#compaction or TreeLayout#alternateCompaction.

public static PathDefault: EnumValue

This value for TreeLayout#path causes the value of Diagram#isTreePathToChildren to effectively choose either TreeLayout#PathDestination (if true) or TreeLayout#PathSource (if false).

public static PathDestination: EnumValue

The children of a TreeVertex are its LayoutVertex#destinationVertexes, the collection of connected LayoutEdge#toVertexes; This value is used for TreeLayout#path.

public static PathSource: EnumValue

The children of a TreeVertex are its LayoutVertex#sourceVertexes, the collection of connected LayoutEdge#fromVertexes; This value is used for TreeLayout#path.

public static SortingAscending: EnumValue

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

public static SortingDescending: EnumValue

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

public static SortingForwards: EnumValue

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

public static SortingReverse: EnumValue

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

public static StyleAlternating: EnumValue

Alternate layers of the tree have different properties, typically including the angle; This value is used for TreeLayout#treeStyle.

public static StyleLastParents: EnumValue

Just like the standard layered tree style, except that the nodes with children but no grandchildren have alternate properties; This value is used for TreeLayout#treeStyle.

public static StyleLayered: EnumValue

The normal tree style, where all of the children of each TreeVertex are lined up horizontally or vertically; This value is used for TreeLayout#treeStyle.

public static StyleRootOnly: EnumValue

All of the nodes get the alternate properties, except the root node gets the default properties; This value is used for TreeLayout#treeStyle.

public alignment: EnumValue

Gets or sets the default alignment of parents relative to their children.

public alternateAlignment: EnumValue

Gets or sets the default alignment of parents relative to their children.

public alternateAngle: number

Gets or sets the default direction for tree growth.

public alternateBreadthLimit: number

Gets or sets a limit on how broad a tree should be.

public alternateChildPortSpot: Spot

Gets or sets the spot that children nodes' ports get as their ToSpot The default value is Spot#Default.

public alternateCommentMargin: number

Gets or sets the distance between a node and its comments.

public alternateCommentSpacing: number

Gets or sets the distance between comments.

public alternateCompaction: EnumValue

Gets or sets how closely to pack the child nodes of a subtree.

public alternateComparer: (a: go.TreeVertex, b: go.TreeVertex) => number

Gets or sets the default comparison function used for sorting.

public alternateDefaults: TreeVertex

Gets or sets the object holding the default values for alternate layer TreeVertexes, used when the #treeStyle is #StyleAlternating or #StyleLastParents.

public alternateLayerSpacing: number

Gets or sets the distance between a parent node and its children.

public alternateLayerSpacingParentOverlap: number

Gets or sets the fraction of the node's depth for which the children's layer starts overlapped with the parent's layer.

public alternateNodeIndent: number

Gets or sets the default indentation of the first child.

public alternateNodeIndentPastParent: number

Gets or sets the fraction of this node's breadth is added to #nodeIndent to determine any spacing at the start of the children.

public alternateNodeSpacing: number

Gets or sets the distance between child nodes.

public alternatePortSpot: Spot

Gets or sets the spot that this node's port gets as its FromSpot.

public alternateRowIndent: number

Gets or sets the default indentation of the first child of each row, if the #alignment is not a "Center" alignment.

public alternateRowSpacing: number

Gets or sets the distance between rows of children.

public alternateSetsChildPortSpot: boolean

Gets or sets whether the TreeLayout should set the ToSpot for each child node port.

public alternateSetsPortSpot: boolean

Gets or sets whether the TreeLayout should set the FromSpot for this parent node port.

public alternateSorting: EnumValue

Gets or sets the default Sorting policy.

public angle: number

Gets or sets the default direction for tree growth.

public arrangement: EnumValue

Gets or sets how #arrangeTrees should lay out the separate trees.

public arrangementOrigin: Point

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

public arrangementSpacing: Size

Gets or sets the space between which #arrangeTrees will position the trees.

public breadthLimit: number

Gets or sets a limit on how broad a tree should be.

public childPortSpot: Spot

Gets or sets the spot that children nodes' ports get as their ToSpot.

public commentMargin: number

Gets or sets the distance between a node and its comments.

public commentSpacing: number

Gets or sets the distance between comments.

public compaction: EnumValue

Gets or sets how closely to pack the child nodes of a subtree.

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

Gets or sets the default comparison function used for sorting.

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 layerSpacing: number

Gets or sets the distance between a parent node and its children.

public layerSpacingParentOverlap: number

Gets or sets the fraction of the node's depth for which the children's layer starts overlapped with the parent's layer.

public newtork: LayoutNetwork

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

public nodeIndent: number

Gets or sets the default indentation of the first child.

public nodeIndentPastParent: number

Gets or sets the fraction of this node's breadth is added to #nodeIndent to determine any spacing at the start of the children.

public nodeSpacing: number

Gets or sets the distance between child nodes.

public path: EnumValue

Gets or sets how the tree should be constructed from the TreeEdges connecting TreeVertexes.

public portSpot: Spot

Gets or sets the spot that this node's port gets as its FromSpot.

public rootDefaults: TreeVertex

Gets or sets the object holding the default values for root TreeVertexes.

public roots: Set

Gets or sets the collection of root vertexes.

public rowIndent: number

Gets or sets the default indentation of the first child of each row, if the #alignment is not a "Center" alignment.

public rowSpacing: number

Gets or sets the distance between rows of children.

public setsChildPortSpot: boolean

Gets or sets whether the TreeLayout should set the ToSpot for each child node port.

public setsPortSpot: boolean

Gets or sets whether the TreeLayout should set the FromSpot for this parent node port.

public sorting: EnumValue

Gets or sets the default Sorting policy.

public treeStyle: EnumValue

Gets or sets the Style for the resulting trees.

Methods

public addComments(v: LayoutVertex): any

Find associated objects to be positioned along with the TreeVertex.

Parameters

Returns

any

public arrangeTrees(): any

Position each separate tree.

Returns

any

public assignTreeVertexValues(v: LayoutVertex): any

Assign final property values for a TreeVertex.

Parameters

Returns

any

public commitLayout(): any

Set the fromSpot and toSpot for each Vertex, 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 TreeVertexes and TreeEdges.

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 initializeTreeVertexValues(v: LayoutVertex): any

Assign initial property values for a TreeVertex.

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 layoutComments(v: LayoutVertex): any

Position and TreeVertex#comments around the vertex.

Parameters

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