GoJS API
/ to search
    Preparing search index...

    Class TreeLayout

    This layout positions nodes of a tree-structured graph in layers (rows or columns).

    For a discussion and examples of the most commonly used properties, see Trees page in Learn. If you want to experiment interactively with most of the properties, try the Tree Layout sample. See samples that make use of TreeLayout in the samples index.

    This layout makes use of a LayoutNetwork of TreeVertexes and TreeEdges that normally correspond to the Nodes and Links of the Diagram.

    The most commonly set properties for controlling the results of a TreeLayout are:

    • angle: the direction in which the tree grows, from parent to child; the default value of zero means that the tree grows towards the right, with the children of a node arranged in a layer that is a column. An angle of 0 or 180 means that children form vertical layers -- breadth is height and depth is width; an angle of 90 or 270 means that children form horizontal layers -- breadth is width and depth is height.
    • layerSpacing: the distance between layers -- between a parent node and its child nodes.
    • nodeSpacing: the distance between nodes within a layer -- between siblings.
    • alignment: the relative position of a parent node with its children.
    • sorting and comparer: specify the order of the immediate children of a parent node.
    • compaction: whether subtrees should be packed closer together if there is room.
    • layerStyle: whether the children of one node are aligned with the children of a sibling node.
    • setsPortSpot, portSpot, setsChildPortSpot, and childPortSpot: this controls whether to set the Link.fromSpot and Link.toSpot to be sensible for the angle.
    • nodeIndent and nodeIndentPastParent: if the alignment is TreeAlignment.Start or TreeAlignment.End, control how much extra space the first child is given when positioned.
    • breadthLimit, rowSpacing: try to limit the total breadth of a subtree to a certain distance; when there are too many children or when they are too broad, this puts children into additional rows (or columns, depending on the angle) thereby limiting the breadth while increasing the depth of the tree.

    When you set one of the TreeLayout properties listed above, that property normally applies to all of the nodes in the tree. What if you want alignment to be TreeAlignment.CenterChildren for the root node but TreeAlignment.Bus for the other nodes in the tree? Or what if you want want layerSpacing to be 50 for all layers except for the layer separating "leaf" nodes from their parent?

    One common solution is to set treeStyle. For the former scenario, you could set treeStyle to TreeStyle.RootOnly; the value of alignment would only apply to the root node. For the latter scenario, you could set it to TreeStyle.LastParents; the value of layerSpacing would apply to all nodes except those that have children but that do not have grandchildren. How do you then set the alignment or layerSpacing for the other nodes? By setting the TreeLayout properties whose names start with "alternate...". In these cases that would mean setting alternateAlignment or alternateLayerSpacing.

    These TreeLayout properties actually apply to the TreeVertex that the TreeLayout uses to represent a Node within the LayoutNetwork. All of those TreeLayout properties are actually stored in rootDefaults; all of the "alternate..." properties are stored in alternateDefaults. Depending on the value of treeStyle, the actual TreeVertex properties for each Node are copied appropriately from either rootDefaults or alternateDefaults. In the default case where treeStyle is TreeStyle.Layered, the alternateDefaults are ignored. (Note that treeStyle, and a few other properties such as path and arrangement, apply to the whole layout, not to an individual node/vertex.)

    The use of treeStyle and "alternate..." TreeLayout properties will cover a lot of common needs for tree layout customization. However, there may be times when that is not enough. Imagine a situation where you want a special TreeVertex property value for a particular Node. The solution is to override assignTreeVertexValues, where you can examine the given TreeVertex, including its corresponding LayoutVertex.node, to decide what TreeVertex property values should apply.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods

    Properties

    Constructors

    Accessors

    • get alternateAngle(): number

      Gets or sets the alternate direction for tree growth.

      The default value is 0; the value must be one of: 0, 90, 180, 270.

      These values are in degrees, where 0 is along the positive X axis, and where 90 is along the positive Y axis. This sets the alternateDefaults' property of the same name.

      Returns number

    • get alternateBreadthLimit(): number

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

      A value of zero (the default) means there is no limit; a positive value specifies a limit. The default value is zero.

      This property is just a suggested constraint on how broadly the tree will be laid out. When there isn't enough breadth for all of the children of a node, the children are placed in as many rows as needed to try to stay within the given breadth limit. If the value is too small, since this layout algorithm does not modify the size or shape of any node, the nodes will just be laid out in a line, one per row, and the breadth is determined by the broadest node. The distance between rows is specified by alternateRowSpacing. To make room for the links that go around earlier rows to get to later rows, when the alignment is not a "center" alignment, the alternateRowIndent property specifies that space at the start of each row. This sets the alternateDefaults' property of the same name.

      Returns number

    • get alternateChildPortSpot(): Spot

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

      A value of Spot.Default will cause the TreeLayout to assign a ToSpot based on the parent node's TreeVertex.angle.

      If the value is other than NoSpot, it is just assigned. When path is Source, the port's FromSpot is set instead of the ToSpot. This sets the alternateDefaults' property of the same name.

      Returns Spot

    • get alternateCommentMargin(): number

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

      The default value is 20.

      This is used by addComments and layoutComments. This sets the alternateDefaults' property of the same name.

      Returns number

    • get alternateCommentSpacing(): number

      Gets or sets the alternate distance between comments.

      The default value is 10.

      This is used by addComments and layoutComments. This sets the alternateDefaults' property of the same name.

      Returns number

    • get alternateLayerSpacing(): number

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

      The default value is 50.

      This is the distance between a parent node and its first row of children, in case there are multiple rows of its children. The alternateNodeSpacing property determines the distance between siblings. The alternateRowSpacing property determines the distance between rows of children. Negative values may cause children to overlap with the parent. This sets the alternateDefaults' property of the same name.

      Returns number

    • get alternateLayerSpacingParentOverlap(): number

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

      The default value is 0.0 -- there is overlap between layers only if alternateLayerSpacing is negative. A value of 1.0 and a zero alternateLayerSpacing will cause child nodes to completely overlap the parent.

      A value greater than zero may still cause overlap between layers, unless the value of alternateLayerSpacing is large enough. A value of zero might still allow overlap between layers, if alternateLayerSpacing is negative. This sets the alternateDefaults' property of the same name.

      Returns number

    • get alternateNodeIndent(): number

      Gets or sets the alternate indentation of the first child.

      The default value is zero. The value should be non-negative.

      This property is only sensible when the alignment is Start or End. Having a positive value is useful if you want to reserve space at the start of the row of children for some reason. For example, if you want to pretend the parent node is infinitely deep, you can set this to be the breadth of the parent node. This sets the alternateDefaults' property of the same name.

      Returns number

    • get alternateNodeIndentPastParent(): number

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

      The default value is 0.0 -- the only indentation is specified by alternateNodeIndent. When the value is 1.0, the children will be indented past the breadth of the parent node.

      This property is only sensible when the alignment is Start or End.

      Returns number

    • get alternateNodeSpacing(): number

      Gets or sets the alternate distance between child nodes.

      The default value is 20.

      A negative value causes sibling nodes to overlap. This sets the alternateDefaults' property of the same name.

      Returns number

    • get alternatePortSpot(): Spot

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

      The default value is Spot.Default.

      A value of Spot.Default will cause the TreeLayout to assign a FromSpot based on the parent node's TreeVertex.angle. If the value is other than NoSpot, it is just assigned. When path is Source, the port's ToSpot is set instead of the FromSpot. This sets the alternateDefaults' property of the same name.

      Returns Spot

    • get alternateRowIndent(): number

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

      The default value is 10. The value should be non-negative.

      This is used to leave room for the links that connect a parent node with the child nodes that are in additional rows. This sets the alternateDefaults' property of the same name.

      Returns number

    • get alternateRowSpacing(): number

      Gets or sets the alternate distance between rows of children.

      The default value is 25.

      This property is only used when there is more than one row of children for a given parent node. The alternateLayerSpacing property determines the distance between the parent node and its first row of child nodes. This sets the alternateDefaults' property of the same name.

      Returns number

    • get alternateSetsChildPortSpot(): boolean

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

      The default value is true -- this may modify the spot of the ports of the children nodes, if the node has only a single port.

      The spot used depends on the value of alternateChildPortSpot. This sets the alternateDefaults' property of the same name.

      Returns boolean

    • get alternateSetsPortSpot(): boolean

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

      The default value is true -- this may modify the spot of the port of this node, the parent, if the node has only a single port.

      The spot used depends on the value of alternatePortSpot. This sets the alternateDefaults' property of the same name.

      Returns boolean

    • get angle(): number

      Gets or sets the default direction for tree growth.

      The default value is 0; the value must be one of: 0, 90, 180, 270.

      These values are in degrees, where 0 is along the positive X axis, and where 90 is along the positive Y axis.

      This sets the rootDefaults' property of the same name.

      Returns number

    • get arrangementOrigin(): Point

      Gets or sets the top-left point for where the graph should be positioned when laid out. The default value for this property is the Point(0, 0). Setting this property to a new value invalidates this layout. This property is likely to be set by many Layouts that belong to a Group when the layout is performed.

      Returns Point

    • get boundsComputation(): ((part: Part, lay: Layout, rect: Rect) => Rect) | null

      Gets or sets a function that determines the initial size and position in document coordinates of a LayoutVertex corresponding to a Node. This function is called by getLayoutBounds. The default value for this property is null, in which case the GraphObject.actualBounds of the Node is used. Setting this property to a new value invalidates this layout.

      The non-null value must be a function that takes 3 arguments. The first argument will be the Part whose bounds the Layout should use. The second argument will be this Layout. The third argument will be a Rect that must be modified and returned The return value must be in document coordinates. You may find it convenient to call GraphObject.getDocumentBounds to get the bounds in document coordinates of an object within the node.

      Returns ((part: Part, lay: Layout, rect: Rect) => Rect) | null

      since

      2.0

    • get breadthLimit(): number

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

      A value of zero (the default) means there is no limit; a positive value specifies a limit. The default value is zero.

      This property is just a suggested constraint on how broadly the tree will be laid out. When there isn't enough breadth for all of the children of a node, the children are placed in as many rows as needed to try to stay within the given breadth limit. If the value is too small, since this layout algorithm does not modify the size or shape of any node, the nodes will just be laid out in a line, one per row, and the breadth is determined by the broadest node. The distance between rows is specified by rowSpacing. To make room for the links that go around earlier rows to get to later rows, when the alignment is not a "center" alignment, the rowIndent property specifies that space at the start of each row.

      This sets the rootDefaults' property of the same name.

      Returns number

    • get childPortSpot(): Spot

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

      The default value is Spot.Default.

      A value of Spot.Default will cause the TreeLayout to assign a ToSpot based on the parent node's TreeVertex.angle. If the value is other than NoSpot, it is just assigned. When path is Source, the port's FromSpot is set instead of the ToSpot.

      This sets the rootDefaults' property of the same name.

      Returns Spot

    • get commentMargin(): number

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

      The default value is 20.

      This is used by addComments and layoutComments.

      This sets the rootDefaults' property of the same name.

      Returns number

    • get comments(): boolean

      Gets or sets whether this layout should find all Nodes whose category is "Comment" and whose anchors are nodes represented in the network, and increase the size of the corresponding TreeVertex to make room for the comment nodes. The default value is true.

      Returns boolean

    • get commentSpacing(): number

      Gets or sets the distance between comments.

      The default value is 10.

      This is used by addComments and layoutComments.

      This sets the rootDefaults' property of the same name.

      Returns number

    • get comparer(): (a: TreeVertex, b: TreeVertex) => number

      Gets or sets the default comparison function used for sorting the immediate children of a vertex.

      The default comparer compares the LayoutVertex.node Text values.

      This sets the rootDefaults' property of the same name. Whether this comparison function is used is determined by the value of sorting.

      new go.TreeLayout({
      sorting: go.TreeSorting.Ascending,
      comparer: (va, vb) => {
      const da = va.node.data;
      const db = vb.node.data;
      if (da.someProperty < db.someProperty) return -1;
      if (da.someProperty > db.someProperty) return 1;
      return 0;
      }
      })

      Returns (a: TreeVertex, b: TreeVertex) => number

    • get diagram(): Diagram | null

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

      If this property and group are non-null, the Group should be in this Diagram.

      Returns Diagram | null

      see

      group

    • get group(): Group | null

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

      If this property is set to a Group, the diagram is automatically set to be the Group's Diagram.

      Returns Group | null

    • get isInitial(): boolean

      Gets or sets whether this layout is performed on an initial layout. The default value is true. Setting this property to false causes isValidLayout to be set to true so that the diagram does not perform this layout.

      If you set both isInitial and isOngoing to false, there will be no automatic layout invalidation, because invalidateLayout will not set isValidLayout to false. To get your nodes to appear, you will need to explicitly set or data-bind their Part.location or GraphObject.position to real Point values, because automatic layout will not assign any positions.

      Another way of controlling when layouts are invalidated is by setting Part.isLayoutPositioned or Part.layoutConditions.

      Returns boolean

    • get isOngoing(): boolean

      Gets or sets whether this layout can be invalidated by invalidateLayout. Set this to false to prevent actions such as adding or removing Parts from invalidating this layout. The default value is true. Setting this property does not invalidate this layout.

      If you set both isInitial and isOngoing to false, there will be no automatic layout invalidation, because invalidateLayout will not set isValidLayout to false. To get your nodes to appear, you will need to explicitly set or data-bind their Part.location or GraphObject.position to real Point values, because automatic layout will not assign any positions.

      Another way of controlling when layouts are invalidated is by setting Part.isLayoutPositioned or Part.layoutConditions.

      Returns boolean

    • get isRealtime(): boolean | null

      Gets or sets whether this layout be performed in real-time, before the end of a transaction. All layouts that are invalidated will be performed at the end of a transaction. The default value is null. A null value is treated as true for a Diagram.layout but false for a Group.layout. Setting this property does not invalidate this layout.

      Returns boolean | null

    • get isRouting(): boolean

      Gets or sets whether this layout routes Links. The default value is true. When false, this layout will not explicitly set the Link.points, and the default routing of each individual Link will take place after the Nodes are moved by commitLayout. Setting this property does not invalidate this layout.

      Some layouts ignore links, in which case this property is ignored.

      Returns boolean

    • get isValidLayout(): boolean

      Gets or sets whether this layout needs to be performed again (if false). Instead of setting this property directly, it is normal to set it to false by calling invalidateLayout, since that also requests performing a layout in the near future.

      Returns boolean

    • get isViewportSized(): boolean

      Gets or sets whether this layout depends on the Diagram.viewportBounds's size. If set to true, the layout will invalidate when the Diagram's viewport changes size. This only applies to diagram layouts, not to group layouts, and only when Diagram.autoScale is set to AutoScale.None.

      The default value is false. Setting this property to true will invalidate this layout.

      It is possible that a viewport-sized layout will trigger the Diagram to require scrollbars, which modifies the Diagram.viewportBounds, which will in turn trigger another layout. This is uncommon, but possible with GridLayout if the results require a vertical scrollbar, and that vertical scrollbar shrinks the viewport width enough that a grid column can no longer fit. When designing custom layouts, one should be careful that this behavior does not result in an infinite loop.

      Returns boolean

    • get layerSpacing(): number

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

      This is the distance between a parent node and the layer of its children. Negative values may cause children to overlap with the parent. The default value is 50.

      The nodeSpacing property determines the distance between siblings. The rowSpacing property determines the distance between multiple rows or columns of children.

      This sets the rootDefaults' property of the same name.

      Returns number

    • get 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.

      The default value is 0.0 -- there is overlap between layers only if layerSpacing is negative. A value of 1.0 and a zero layerSpacing will cause child nodes to completely overlap the parent.

      A value greater than zero may still cause overlap between layers, unless the value of layerSpacing is large enough. A value of zero might still allow overlap between layers, if layerSpacing is negative.

      This sets the rootDefaults' property of the same name.

      Returns number

    • get nodeIndent(): number

      Gets or sets the default indentation of the first child.

      The default value is zero. The value should be non-negative.

      This property is only sensible when the alignment is Start or End. Having a positive value is useful if you want to reserve space at the start of the row of children for some reason. For example, if you want to pretend the parent node is infinitely deep, you can set this to be the breadth of the parent node.

      This sets the rootDefaults' property of the same name.

      Returns number

    • get 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.

      The default value is 0.0 -- the only indentation is specified by nodeIndent. When the value is 1.0, the children will be indented past the breadth of the parent node.

      This property is only sensible when the alignment is Start or End.

      This sets the rootDefaults' property of the same name.

      Returns number

    • get nodeSpacing(): number

      Gets or sets the distance between child nodes.

      This is the distance between sibling nodes. A negative value causes sibling nodes to overlap. The default value is 20.

      The layerSpacing property determines the distance between a parent node and the layer of its children.

      This sets the rootDefaults' property of the same name.

      Returns number

    • get portSpot(): Spot

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

      The default value is Spot.Default.

      A value of Spot.Default will cause the TreeLayout to assign a FromSpot based on the parent node's TreeVertex.angle. If the value is other than NoSpot, it is just assigned. When path is Source, the port's ToSpot is set instead of the FromSpot.

      This sets the rootDefaults' property of the same name.

      Returns Spot

    • get roots(): Set<Node | TreeVertex>

      Gets or sets the collection of root vertexes.

      Initially this will be an empty go.Set.

      If the path is either Destination or Source, this layout can easily determine all of the tree roots by searching the whole network. Otherwise, you should explicitly initialize this collection with one or more TreeVertexes.

      Returns Set<Node | TreeVertex>

    • get rowIndent(): number

      Gets or sets the default indentation of the first child of each row, if the alignment is not a "Center" alignment, when the breadth occupied by the children is limited by breadthLimit.

      The default value is 10. The value should be non-negative.

      This is used to leave room for the links that connect a parent node with the child nodes that are in additional rows. The rowSpacing property determines the distance between the rows or columns when there is more than one.

      This sets the rootDefaults' property of the same name.

      Returns number

    • get rowSpacing(): number

      Gets or sets the distance between multiple rows or columns of a parent node's immediate children when the breadth occupied by the children is limited by breadthLimit.

      The default value is 25.

      This property is only used when there is more than one row of children for a given parent node. The nodeSpacing property determines the distance between siblings. The layerSpacing property determines the distance between the parent node and its first row or column of child nodes. The rowIndent property determines any indentation for all of the rows.

      This sets the rootDefaults' property of the same name.

      Returns number

    • get setsChildPortSpot(): boolean

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

      The default value is true -- this may modify the spot of the ports of the children nodes, if the node has only a single port.

      The spot used depends on the value of childPortSpot.

      This sets the rootDefaults' property of the same name.

      Returns boolean

    • get setsPortSpot(): boolean

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

      The default value is true -- this may modify the spot of the port of this node, the parent, if the node has only a single port.

      The spot used depends on the value of portSpot.

      This sets the rootDefaults' property of the same name.

      Returns boolean

    Methods

    • Find any associated objects to be positioned along with the LayoutVertex.node.

      This looks for visible Node's whose category is "Comment" and that refer to the tree vertex's Node. This method is only called when comments is true.

      You may want to override this method in order to customize how any associated objects are found and how the node's LayoutVertex.bounds are set to reserve space for those associated objects. This method should not walk the tree, since it is called for each TreeVertex in an indeterminate order. Please read the Learn page on Extensions for how to override methods and how to call this base method.

      Parameters

      Returns void

    • Position each separate tree.

      This is called after each tree has been laid out and thus each subtree bounds are known. The arrangement and arrangementSpacing and Layout.arrangementOrigin properties affect this method's behavior. Please read the Learn page on Extensions for how to override methods and how to call this base method.

      Returns void

    • Assign final property values for a TreeVertex.

      This method is commonly overridden in order to provide tree layout properties for particular nodes. This method is called after values have been inherited from other TreeVertexes, so you can examine and modify the values of related tree nodes. Please read the Learn page on Extensions for how to override methods and how to call this base method.

      However, when TreeVertex.alignment is TreeAlignment.BusBranching, changing the TreeVertex.sorting or TreeVertex.comparer properties in this method will have no effect.

      This method should not walk the tree, since it is called for each TreeVertex in a depth-first manner starting at a root.

      Here is an example where the children are squeezed together if there are many of them, but only on nodes that have no grandchildren. This makes use of two TreeVertex properties that are automatically computed for you, TreeVertex.childrenCount and TreeVertex.descendantCount.

      class SqueezingTreeLayout extends go.TreeLayout {
      assignTreeVertexValues(v) {
      if (v.childrenCount > 6 && v.childrenCount === v.descendantCount) {
      v.alignment = go.TreeAlignment.BottomRightBus;
      v.layerSpacing = 10;
      v.rowSpacing = 0;
      }
      }
      }

      If you need to assign TreeVertex values and also have them be "inherited" by the child vertexes, you should override initializeTreeVertexValues instead. However at the time that method is called, the computed properties of TreeVertex will not be available.

      Parameters

      Returns void

    • A convenient way of converting the Diagram|Group|Iterable argument to doLayout to an actual collection of eligible Parts. The resulting Set will not include any Nodes or Links for which Part.canLayout is false. If the argument includes a Group for which Group.layout is null, the resulting Set will include the member parts of that group rather than that group itself. You will not need to call collectParts if you call makeNetwork, because that method does effectively the same thing when building the LayoutNetwork.

      Typical usage:

      public doLayout(coll) {
      // COLL might be a Diagram or a Group or some Iterable<Part>
      const it = this.collectParts(coll).iterator;
      while (it.next()) {
      const node = it.value;
      if (node instanceof go.Node) {
      . . . position the node . . .
      }
      }
      }

      Parameters

      Returns Set<Part>

    • This overridable method is called by commitLayout if layerStyle is LayerUniform to support custom arrangement of bands or labels across each layout layer. By default this method does nothing.

      The coordinates used in the resulting Rects may need to be offset by the Layout.arrangementOrigin and/or by the arrangement of subtrees done by arrangeTrees.

      Parameters

      • layerRects: Rect[]

        an Array of Rects with the bounds of each of the "layers"

      • offset: Point

        the position of the top-left corner of the banded area relative to the coordinates given by the layerRects

      Returns void

    • Set the fromSpot and toSpot on each Link, position each Node according to the vertex position, and then position/route the Links.

      This calls the commitNodes and commitLinks methods, the latter only if isRouting is true. You should not call this method -- it is a "protected virtual" method. Please read the Learn page on Extensions for how to override methods and how to call this base method.

      Returns void

    • Routes the links.

      This is called by commitLayout. This is only called if Layout.isRouting is true. See also commitNodes. Please read the Learn page on Extensions for how to override methods and how to call this base method.

      Returns void

    • Commit the position of all nodes.

      This is called by commitLayout. See also commitLinks. Please read the Learn page on Extensions for how to override methods and how to call this base method.

      Returns void

    • This method is called by layouts to determine the size and initial position of the nodes that it is laying out. Normally this just returns the part's GraphObject.actualBounds. However, if boundsComputation has been set to a function, that function will be called in order to return the bounds of the given Part in document coordinates that the layout should pretend it has.

      Parameters

      • part: Part

        the Part being laid out

      • Optionalrect: Rect

        an optional Rect that will be modified and returned

      Returns Rect

      a Rect in document coordinates

      since

      2.0

    • Compute the desired value of arrangementOrigin if this Layout is being performed for a Group. This is typically called near the beginning of the implementation of doLayout: this.arrangementOrigin = this.initialOrigin(this.arrangementOrigin); if the layout wants to respect the pre-layout location of the Group when deciding where to position its member nodes.

      Parameters

      Returns Point

    • 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. If isInitial is true, this layout is invalidated only when the Diagram.model is replaced, not under the normal circumstances such as when parts are added or removed or due to other calls to Layout._invalidateLayout.

      If you set both isInitial and isOngoing to false, there will be no automatic layout invalidation, because this method will not set isValidLayout to false. However you can still set isValidLayout explicitly.

      This is typically called when a layout property value has changed, or when a Part is added or removed or changes visibility, if Part.layoutConditions includes the pertinent flags.

      Returns void

    • Position and TreeVertex.comments around the vertex.

      This method should not walk the tree, since it is called for each TreeVertex in an indeterminate order. Please read the Learn page on Extensions for how to override methods and how to call this base method.

      Parameters

      Returns void

    • When using a LayoutNetwork, update the "physical" node positionings and link routings. This should be called by doLayout when this layout uses a network. This calls commitLayout to actually set Node positions and route Links. This performs the changes within a transaction. Please read the Learn page on Extensions for how to override methods and how to call this base method.

      Returns void

    Properties

    AlignmentBottomRightBus: BottomRightBus = TreeAlignment.BottomRightBus
    AlignmentBus: Bus = TreeAlignment.Bus
    deprecated

    See TreeAlignment.Bus.

    AlignmentBusBranching: BusBranching = TreeAlignment.BusBranching
    AlignmentCenterChildren: CenterChildren = TreeAlignment.CenterChildren
    AlignmentCenterSubtrees: CenterSubtrees = TreeAlignment.CenterSubtrees
    AlignmentEnd: End = TreeAlignment.End
    deprecated

    See TreeAlignment.End.

    AlignmentStart: Start = TreeAlignment.Start
    deprecated

    See TreeAlignment.Start.

    AlignmentTopLeftBus: TopLeftBus = TreeAlignment.TopLeftBus
    deprecated

    See TreeAlignment.TopLeftBus.

    ArrangementFixedRoots: FixedRoots = TreeArrangement.FixedRoots
    ArrangementHorizontal: Horizontal = TreeArrangement.Horizontal
    ArrangementVertical: Vertical = TreeArrangement.Vertical
    deprecated

    See TreeArrangement.Vertical.

    CompactionBlock: Block = TreeCompaction.Block
    deprecated

    See TreeCompaction.Block.

    CompactionNone: None = TreeCompaction.None
    deprecated

    See TreeCompaction.None.

    LayerIndividual: Individual = TreeLayerStyle.Individual
    LayerSiblings: Siblings = TreeLayerStyle.Siblings
    deprecated

    See TreeLayerStyle.Siblings.

    LayerUniform: Uniform = TreeLayerStyle.Uniform
    deprecated

    See TreeLayerStyle.Uniform.

    PathDefault: Default = TreePath.Default
    deprecated

    See TreePath.Default.

    PathDestination: Destination = TreePath.Destination
    deprecated

    See TreePath.Destination.

    PathSource: Source = TreePath.Source
    deprecated

    See TreePath.Source.

    SortingAscending: Ascending = TreeSorting.Ascending
    deprecated

    See TreeSorting.Ascending.

    SortingDescending: Descending = TreeSorting.Descending
    deprecated

    See TreeSorting.Descending.

    SortingForwards: Forwards = TreeSorting.Forwards
    deprecated

    See TreeSorting.Forwards.

    SortingReverse: Reverse = TreeSorting.Reverse
    deprecated

    See TreeSorting.Reverse.

    StyleAlternating: Alternating = TreeStyle.Alternating
    deprecated

    See TreeStyle.Alternating.

    StyleLastParents: LastParents = TreeStyle.LastParents
    deprecated

    See TreeStyle.LastParents.

    StyleLayered: Layered = TreeStyle.Layered
    deprecated

    See TreeStyle.Layered.

    StyleRootOnly: RootOnly = TreeStyle.RootOnly
    deprecated

    See TreeStyle.RootOnly.