Class GraphAbstractHierarchyCellAbstract

An abstraction of an internal hierarchy node or edge.

Hierarchy (view full)

Constructors

Properties

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.

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.

height: number = 0

The height of this cell. Default is 0.

id: null | string = null

Holds the Id. Default is null.

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[]

  • Returns the index of the specified child in the child array.

    Parameters

    • child: null | Cell

      Child whose index should be returned.

    Returns number

  • Returns the source or target terminal.

    Parameters

    • source: boolean = false

      Boolean that specifies if the source terminal should be returned.

    Returns null | Cell

  • Returns true if the user object is an XML node that contains the given attribute.

    Parameters

    • name: string

      Name nameName of the attribute.

    Returns boolean

  • 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

  • Returns true if the given parent is an ancestor of the given child. Note returns true if child == parent.

    Parameters

    • child: null | Cell

      that specifies the child.

    Returns boolean

  • Removes the child at the specified index from the child array and returns the child that was removed. Will remove the parent reference of the child.

    Parameters

    • index: number

    Returns null | 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

  • Removes the edge from its source or target terminal.

    Parameters

    • isSource: boolean

      Boolean that specifies if the edge should be removed from its source or target terminal.

    Returns void

  • 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

  • Sets the collapsed state.

    Parameters

    • collapsed: boolean

      Boolean that specifies the new collapsed state.

    Returns void

  • Sets the connectable state.

    Parameters

    • connectable: boolean

      Boolean that specifies the new connectable state.

    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

  • Sets the user object of the cell. The user object is stored in .

    Parameters

    • value: any

    Returns void

  • 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

  • Specifies if the cell is visible.

    Parameters

    • visible: boolean

      Boolean that specifies the new visible state.

    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