GoJS API
/ to search
    Preparing search index...

    Class TreeVertexUnindexed

    This holds TreeLayout-specific information about Nodes.

    This class inherits from LayoutVertex.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get angle(): number

      Gets or sets the absolute angle at which this subtree should grow from this vertex.

      The default value is zero, meaning that general tree growth should proceed rightwards along the X axis.

      This inherited property is initialized in the TreeLayout.initializeTreeVertexValues pass. By default this is the same as the Angle of the parent TreeVertex. However, after the initial propagation of property values, perhaps in an override of TreeLayout.assignTreeVertexValues, you could just set this property to specify the angle at which this node grows its subtrees.

      Returns number

    • get bounds(): Rect

      Gets or sets the bounds of this vertex, in document coordinates. Setting this property does not directly modify the position of any Node, but it will modify the value of centerX and centerY, as well as the subsidiary convenience properties x, y, width, and height.

      Returns Rect

    • get breadthLimit(): number

      Gets or sets how broad a node and its descendants should be.

      By default this is zero. A value of zero imposes no limit; a positive value will specify a limit for the total width of this subtree.

      This inherited property is initialized in the TreeLayout.initializeTreeVertexValues pass.

      Returns number

    • get centerX(): number

      Gets or sets the center Point.x of this vertex, in document coordinates. This property depends on both bounds and focus. Setting this property does not modify the position of any Node, but it will modify the value of bounds.

      Returns number

    • get centerY(): number

      Gets or sets the center Point.y of this vertex, in document coordinates. This property depends on both bounds and focus. Setting this property does not modify the position of any Node, but it will modify the value of bounds.

      Returns number

    • get children(): TreeVertex[]

      Gets or sets the logical children for this node.

      The default value is an empty array.

      This structural property is computed in TreeLayout.doLayout when building the tree structures. You should probably not be setting this property.

      Returns TreeVertex[]

    • get childrenCount(): number

      This read-only property returns the number of immediate children this node has.

      The default value is zero.

      Returns number

    • get commentMargin(): number

      Gets or sets the space to leave between the node and the comments.

      The default value is 20.

      Negative values may cause comments to overlap with the node. This inherited property is initialized in the TreeLayout.initializeTreeVertexValues pass.

      Returns number

    • get comments(): Node[] | null

      Gets or sets an array of Nodes that will be positioned near this node.

      The default value is null.

      These objects should not have their own TreeVertexes to be laid out. Typically these will be Nodes whose Category is "Comment". This array should be allocated and initialized in TreeLayout.addComments.

      Returns Node[] | null

    • get commentSpacing(): number

      Gets or sets the space to leave between consecutive comments.

      The default value is 10.

      Negative values may cause comments to overlap. This inherited property is initialized in the TreeLayout.initializeTreeVertexValues pass.

      Returns number

    • get data(): ObjectData | null

      Gets or sets the data object in the model that should be associated with this vertex, if any. The value will be non-null if this vertex is virtualized, not represented by a real Node in the Diagram. Each data object should have a 'bounds' property that is a Rect or any JavaScript Object with 'x', 'y', 'width', and 'height' properties that are real numbers, and non-negative numbers for the width and the height. Setting this data property will also set the bounds and focus properties.

      Returns ObjectData | null

    • get descendantCount(): number

      Gets or sets the number of descendants this node has.

      For a leaf node, this will be zero.

      This informational property is computed as part of the TreeLayout.initializeTreeVertexValues pass. You should probably not be setting this property.

      Returns number

    • get destinationEdges(): Iterator<LayoutEdge>

      This read-only property returns an iterator for all of the edges that go out of this vertex.

      Returns Iterator<LayoutEdge>

    • get destinationVertexes(): Iterator<LayoutVertex>

      This read-only property returns an iterator for all of the vertexes that are connected with edges going out of this vertex.

      Note that this is inefficient compared to iterating over the edges (destinationEdges) due to the need to avoid duplicate vertexes if there happen to be multiple edges connecting with the same vertex.

      Returns Iterator<LayoutVertex>

    • get edges(): Iterator<LayoutEdge>

      This read-only property returns an iterator for all of the edges that are connected with this vertex in either direction.

      Note that this is inefficient compared to iterating over the edges: sourceEdges and destinationEdges.

      Returns Iterator<LayoutEdge>

    • get edgesCount(): number

      This read-only property returns the total number of edges that are connected with this vertex in either direction.

      Returns number

    • get focus(): Point

      Gets or sets the offset of the focusX and focusY from the bounds position. Setting this property does not directly modify the position of any Node, but it does affect the value of centerX and centerY.

      The "focus" is normally the center of the Node's Part.locationObject.

      Returns Point

    • get focusX(): number

      Gets or sets the relative X position of the "center" point, the focus.

      Returns number

    • get focusY(): number

      Gets or sets the relative Y position of the "center" point, the focus.

      Returns number

    • get height(): number

      Gets or sets the height of this vertex. This is always the vertical distance reserved for the node.

      Returns number

    • get initialized(): boolean

      Gets or sets whether this node has been initialized as part of TreeLayout.doLayout when building the tree structures.

      The default value is false.

      Returns boolean

    • get layerSpacing(): number

      Gets or sets the distance between this node and its children.

      The default value is 50.

      Negative values may cause children to overlap with the parent. This inherited property is initialized in the TreeLayout.initializeTreeVertexValues pass.

      Returns number

    • get layerSpacingParentOverlap(): number

      Gets or sets the fraction of this node's depth that may overlap with the children's layer.

      The default value is 0.0 -- there is overlap only if layerSpacing is negative. Values must range from 0.0 to 1.0, where 1.0 means the full depth of this node.

      When this value is greater than 0.0, there might not be overlap if layerSpacing is larger than the depth of this node times this fraction. Even when this value is 0.0, there may be overlap when layerSpacing is negative. This inherited property is initialized in the TreeLayout.initializeTreeVertexValues pass.

      Returns number

    • get level(): number

      Gets or sets the number of single-parent ancestors this node has.

      This could also be interpreted as which layer this node is in. A root node will have a value of zero.

      This informational property is computed in TreeLayout.doLayout when building the tree structures. You should probably not be setting this property.

      Returns number

    • get maxChildrenCount(): number

      Gets or sets the maximum number of children of any descendant of this node.

      For a leaf node, this will be zero.

      This informational property is computed as part of the TreeLayout.initializeTreeVertexValues pass. You should probably not be setting this property.

      Returns number

    • get maxGenerationCount(): number

      Gets or sets the maximum depth of the subtrees below this node.

      For a leaf node, this will be zero.

      This informational property is computed as part of the TreeLayout.initializeTreeVertexValues pass. You should probably not be setting this value.

      Returns number

    • get node(): Node | null

      Gets or sets the Node associated with this vertex, if any. The value may be null if this vertex is a "dummy" vertex, not represented by a real Node in the Diagram.

      This property setter also sets the bounds and focus properties according to the value of the Node's actualBounds and its Part.locationObject's center point.

      Returns Node | null

    • get nodeIndentPastParent(): number

      Gets or sets whether the first child should be indented past the parent node's breadth.

      The default value is 0.0 -- the only start or end spacing is provided by nodeIndent. Values must range from 0.0 to 1.0, where 1.0 means the full breadth of this node.

      This inherited property is initialized in the TreeLayout.initializeTreeVertexValues pass. This property is only sensible when the alignment is TreeAlignment.Start or TreeAlignment.End.

      Returns number

    • get nodeSpacing(): number

      Gets or sets the distance between child nodes.

      The default value is 20.

      A negative value will cause sibling nodes to overlap. This inherited property is initialized in the TreeLayout.initializeTreeVertexValues pass.

      Returns number

    • get parent(): TreeVertex | null

      Gets or sets the logical parent for this node.

      The default value is null.

      This structural property is computed in TreeLayout.doLayout when building the tree structures. You should probably not be setting this property.

      Returns TreeVertex | null

    • get relativePosition(): Point

      Gets or sets the position of this node relative to its parent node.

      This informational property is computed during TreeLayout.doLayout. You should probably not be setting this property.

      Returns Point

    • get rowIndent(): number

      Gets or sets the distance the first child of each row should be indented.

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

      This inherited property is initialized in the TreeLayout.initializeTreeVertexValues pass. This property is only used when the breadthLimit is positive, and some initial space needs to be reserved in each row of nodes for the links that are routed around those rows.

      Returns number

    • get rowSpacing(): number

      Gets or sets the distance between rows within one layer, all sharing the same parent.

      The default value is 25.

      Negative values may cause nodes to overlap. This inherited property is initialized in the TreeLayout.initializeTreeVertexValues pass.

      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 spots of the ports of the children nodes, if the node has only a single port.

      This inherited property is initialized in the TreeLayout.initializeTreeVertexValues pass. The spot used depends on the value of childPortSpot.

      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.

      This inherited property is initialized in the TreeLayout.initializeTreeVertexValues pass. The spot used depends on the value of portSpot.

      Returns boolean

    • get sourceEdges(): Iterator<LayoutEdge>

      This read-only property returns an iterator for all of the edges that come into this vertex.

      Returns Iterator<LayoutEdge>

    • get sourceVertexes(): Iterator<LayoutVertex>

      This read-only property returns an iterator for all of the vertexes that are connected with edges coming into this vertex.

      Note that this is inefficient compared to iterating over the edges (sourceEdges) due to the need to avoid duplicate vertexes if there happen to be multiple edges connecting with the same vertex.

      Returns Iterator<LayoutVertex>

    • get subtreeOffset(): Point

      Gets or sets the offset of this parent node relative to its whole subtree.

      This informational property is computed during TreeLayout.doLayout. Of course if there are no children, this is just (0, 0). You should probably not be setting this property.

      Returns Point

    • get subtreeSize(): Size

      Gets or sets the size of the subtree (including all descendants) parented by this node.

      This informational property is computed during TreeLayout.doLayout. Of course if there are no children, this is just the same as Size. You should probably not be setting this property.

      Returns Size

    • get vertexes(): Iterator<LayoutVertex>

      This read-only property returns an iterator for all of the vertexes that are connected in either direction with this vertex.

      Note that this is inefficient compared to iterating over the edges (sourceEdges and destinationEdges) due to the need to avoid duplicate vertexes if there happen to be multiple edges connecting with the same vertex.

      Returns Iterator<LayoutVertex>

    • get width(): number

      Gets or sets the width of this vertex. This is always the horizontal distance reserved for the node.

      Returns number

    • get x(): number

      Gets or sets the left point of this vertex.

      Returns number

    • get y(): number

      Gets or sets the top point of this vertex.

      Returns number

    Methods

    • Moves the Node corresponding to this vertex so that its position is at the current bounds point.

      To make the most common cases look right, the Node's Part.locationObject is centered. Thus iconic nodes will have the center of the icon be positioned according to the center of this vertex, ignoring any labels. Please read the Learn page on Extensions for how to override methods and how to call this base method.

      Returns void

    • Copy inherited properties from another TreeVertex to this one.

      Parameters

      Returns void