Class GraphHierarchyNode

An abstraction of a hierarchical edge for the hierarchy layout

Hierarchy (view full)

Constructors

Properties

cell: Cell

The graph cell this object represents.

children: Cell[] = []

Holds the child cells.

collapsed: boolean = false

Specifies whether the cell is collapsed. Default is false.

connectable: boolean = true

Specifies whether the cell is connectable. Default is true.

connectsAsSource: GraphHierarchyEdge[]

Collection of hierarchy edges that have this node as a source

connectsAsTarget: GraphHierarchyEdge[]

Collection of hierarchy edges that have this node as a target

edge: boolean = false

Specifies whether the cell is an edge. Default is false.

edges: Cell[] = []

Holds the edges.

geometry: null | Geometry = null

Holds the Geometry. Default is null.

hashCode: any = false

Assigns a unique hashcode for each node. Used by the model dfs instead of copying HashSets

height: number = 0

The height of this cell. Default is 0.

id: string

The object identity of the wrapped cell

ids: string[] = []

The object identities of the wrapped cells

invalidating: boolean = false
maxRank: number = -1

The maximum rank this cell occupies. Default is -1.

minRank: number = -1

The minimum rank this cell occupies. Default is -1.

mxTransient: string[] = ...

List of members that should not be cloned inside . This field is passed to Utils#clone and is not made persistent in . This is not a convention for all classes, it is only used in this class to mark transient fields since transient modifiers are not supported by the language.

nextLayerConnectedCells: null | {
    [key: number]: GraphAbstractHierarchyCell[];
} = null

A cached version of the cells this cell connects to on the next layer up

onInit: null | (() => void) = null
overlays: CellOverlay[] = []
parent: null | Cell = null

Reference to the parent cell.

previousLayerConnectedCells: null | {
    [key: number]: GraphAbstractHierarchyCell[];
} = null

A cached version of the cells this cell connects to on the next layer down

source: null | Cell = null

Reference to the source terminal.

style: CellStyle = {}

Holds the style as a string of the form [(stylename|key=value);]. Default is null.

swimlaneIndex: null | number = null
target: null | Cell = null

Reference to the target terminal.

temp: number[]

Temporary variable for general use. Generally, try to avoid carrying information between stages. Currently, the longest path layering sets temp to the rank position in fixRanks() and the crossing reduction uses this. This meant temp couldn't be used for hashing the nodes in the model dfs and so hashCode was created

value: any = null

Holds the user object. Default is null.

vertex: boolean = false

Specifies whether the cell is a vertex. Default is false.

visible: boolean = true

Specifies whether the cell is visible. Default is true.

width: number = 0

The width of this cell. Default is 0.

x: number[]

The x position of this cell for each layer it occupies

y: number[]

The y position of this cell for each layer it occupies

Methods

  • Visits all cells recursively and applies the specified filter function to each cell. If the function returns true then the cell is added to the resulting array. The parent and result paramters are optional. If parent is not specified then the recursion starts at root.

    Example: The following example extracts all vertices from a given model:

    var filter(cell)
    {
    return model.isVertex(cell);
    }
    var vertices = model.filterDescendants(filter);

    Parameters

    • filter: null | FilterFunction

      JavaScript function that takes an Cell as an argument and returns a boolean.

    Returns Cell[]

  • Returns the specified attribute from the user object if it is an XML node.

    Parameters

    • name: string

      Name of the attribute whose value should be returned.

    • OptionaldefaultValue: any

      Optional default value to use if the attribute has no value.

    Returns any

  • Returns the children of the given cell that are vertices and/or edges depending on the arguments.

    Parameters

    • vertices: boolean = false

      Boolean indicating if child vertices should be returned. Default is false.

    • edges: boolean = false

      Boolean indicating if child edges should be returned. Default is false.

    Returns Cell[]

  • Returns the number of incoming or outgoing edges, ignoring the given edge.

    Parameters

    • outgoing: boolean

      Boolean that specifies if the number of outgoing or incoming edges should be returned.

    • ignoredEdge: null | Cell = null

      that represents an edge to be ignored.

    Returns number

  • Returns all distinct edges connected to this cell as a new array of Cell. If at least one of incoming or outgoing is true, then loops are ignored, otherwise if both are false, then all edges connected to the given cell are returned including loops.

    Parameters

    • incoming: boolean = true

      Optional boolean that specifies if incoming edges should be returned. Default is true.

    • outgoing: boolean = true

      Optional boolean that specifies if outgoing edges should be returned. Default is true.

    • includeLoops: boolean = true

      Optional boolean that specifies if loops should be returned. Default is true.

    Returns Cell[]

  • Inserts the specified child into the child array at the specified index and updates the parent reference of the child. If not childIndex is specified then the child is appended to the child array. Returns the inserted child.

    Parameters

    • child: Cell
    • Optionalindex: number

    Returns null | Cell

  • Inserts the specified edge into the edge array and returns the edge. Will update the respective terminal reference of the edge.

    Parameters

    • edge: Cell

      to be inserted into the edge array.

    • isOutgoing: boolean = false

      Boolean that specifies if the edge is outgoing.

    Returns Cell

  • Removes the specified edge from the edge array and returns the edge. Will remove the respective terminal reference from the edge.

    Parameters

    • edge: null | Cell
    • isOutgoing: boolean = false

      Boolean that specifies if the edge is outgoing.

    Returns null | Cell

  • Sets the specified attribute on the user object if it is an XML node.

    Parameters

    • name: string

      Name of the attribute whose value should be set.

    • value: any

      New value of the attribute.

    Returns void

  • Specifies if the cell is an edge. This should only be assigned at construction of the cell and not be changed during its lifecycle.

    Parameters

    • edge: boolean

      Boolean that specifies if the cell is an edge.

    Returns void

  • Sets the source or target terminal and returns the new terminal.

    Parameters

    • terminal: null | Cell

      Cell that represents the new source or target terminal.

    • isSource: boolean

      boolean that specifies if the source or target terminal should be set.

    Returns null | Cell

  • Specifies if the cell is a vertex. This should only be assigned at construction of the cell and not be changed during its lifecycle.

    Parameters

    • vertex: boolean

      Boolean that specifies if the cell is a vertex.

    Returns void

  • Changes the user object after an in-place edit and returns the previous value. This implementation replaces the user object with the given value and returns the old user object.

    Parameters

    • newValue: any

    Returns any