@maxgraph/core
    Preparing search index...

    Class HierarchicalLayout

    A hierarchical layout algorithm.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    deterministic: boolean
    disableEdgeStyle: boolean = true

    Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result. Default is true.

    edgesCache: Dictionary<Cell, Cell[]> = ...

    A cache of edges whose source terminal is the key

    edgeSourceTermCache: Dictionary<Cell, Cell> = ...

    A cache of edges whose source terminal is the key

    edgesTargetTermCache: Dictionary<Cell, Cell> = ...

    A cache of edges whose source terminal is the key

    edgeStyle: number = HierarchicalEdgeStyle.POLYLINE

    The style to apply between cell layers to edge segments. Default is HierarchicalEdgeStyle#POLYLINE.

    fineTuning: boolean = true

    Whether or not to perform local optimisations and iterate multiple times through the algorithm. Default is true.

    graph: Graph

    Reference to the enclosing Graph.

    interHierarchySpacing: number = 60

    The spacing buffer between unconnected hierarchies. Default is 60.

    interRankCellSpacing: number = 100

    The spacing buffer added between cell on adjacent layers. Default is 100.

    intraCellSpacing: number = 30

    The spacing buffer added between cells on the same layer. Default is 30.

    maintainParentLocation: boolean = false

    Specifies if the parent location should be maintained, so that the top, left corner stays the same before and after execution of the layout. Default is false for backwards compatibility.

    model: null | GraphHierarchyModel = null

    The internal formed of the layout.

    moveParent: boolean = false

    Specifies if the parent should be moved if is enabled. Default is false.

    orientation: DIRECTION = DIRECTION.NORTH

    The position of the root node(s) relative to the laid out graph in. Default is <mxConstants.DIRECTION.NORTH>.

    parallelEdgeSpacing: number = 10

    The distance between each parallel edge on each ranks for long edges. Default is 10.

    parent: null | Cell = null

    The parent cell of the layout, if any

    null
    
    parentBorder: number = 0

    The border to be added around the children if the parent is to be resized using . Default is 0.

    parentX: null | number = null
    parentY: null | number = null
    resizeParent: boolean = false

    Specifies if the parent should be resized after the layout so that it contains all the child cells. Default is false. See also .

    roots: null | Cell[] = null

    Holds the array of that this layout contains.

    tightenToSource: boolean = true

    Whether or not to tighten the assigned ranks of vertices up towards the source cells. Default is true.

    traverseAncestors: boolean = true

    Whether or not to drill into child cells and layout in reverse group order. This also cause the layout to navigate edges whose terminal vertices have different parents but are in the same ancestry chain. Default is true.

    useBoundingBox: boolean = true

    Boolean indicating if the bounding box of the label should be used if it iss available.

    true.
    

    Methods

    • Returns all visible children in the given parent which do not have incoming edges. If the result is empty then the children with the maximum difference between incoming and outgoing edges are returned. This takes into account edges that are being promoted to the given root due to invisible children or collapsed cells.

      Parameters

      • parent: Cell

        whose children should be checked.

      • vertices: Cell[]

        array of vertices to limit search to

      Returns Cell[]

    • Returns the constraint for the given key and cell. The optional edge and source arguments are used to return inbound and outgoing routing- constraints for the given edge and vertex. This implementation always returns the value for the given key in the style of the given cell.

      Parameters

      • key: string

        Key of the constraint to be returned.

      • cell: Cell

        Cell whose constraint should be returned.

      • Optionaledge: Cell

        Optional Cell that represents the connection whose constraint should be returned. Default is null.

      • Optionalsource: boolean

        Optional boolean that specifies if the connection is incoming or outgoing. Default is null.

      Returns any

    • Returns the edges between the given source and target. This takes into account collapsed and invisible cells and ports.

      source - target - directed -

      Parameters

      • source: Cell
      • target: Cell
      • directed: boolean

      Returns Cell[]

    • Helper function to return visible terminal for edge allowing for ports

      Parameters

      • edge: Cell

        whose edges should be returned.

      • source: boolean

        Boolean that specifies whether the source or target terminal is to be returned

      Returns null | Cell

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

      Parameters

      • parent: Cell

        Cell that specifies the parent.

      • child: null | Cell

        Cell that specifies the child.

      • OptionaltraverseAncestors: boolean

        boolean whether to

      Returns boolean

    • Returns true if the given cell is a "port", that is, when connecting to it, its parent is the connecting vertex in terms of graph traversal

      Parameters

      • cell: Cell

        that represents the port.

      Returns boolean

    • Returns a boolean indicating if the given Cell is movable or bendable by the algorithm. This implementation returns true if the given cell is movable in the graph.

      Parameters

      • cell: Cell

        Cell whose movable state should be returned.

      Returns boolean

    • Notified when a cell is being moved in a parent that has automatic layout to update the cell state (eg. index) so that the outcome of the layout will position the vertex as close to the point (x, y) as possible.

      Empty implementation.

      Parameters

      • cell: Cell

        Cell which has been moved.

      • x: number

        X-coordinate of the new cell location.

      • y: number

        Y-coordinate of the new cell location.

      Returns void

    • Executes the placement stage using mxCoordinateAssignment.

      Parameters

      • initialX: number
      • parent: any

      Returns number

    • The API method used to exercise the layout upon the graph description and produce a separate description of the vertex position and edge routing changes made. It runs each stage of the layout that has been created.

      Parameters

      • parent: any

      Returns void

    • Sets the new position of the given cell taking into account the size of the bounding box if useBoundingBox is true. The change is only carried out if the new location is not equal to the existing location, otherwise the geometry is not replaced with an updated instance. The new or old bounds are returned (including overlapping labels).

      Parameters

      • cell: Cell

        Cell whose geometry is to be set.

      • x: number

        Integer that defines the x-coordinate of the new location.

      • y: number

        Integer that defines the y-coordinate of the new location.

      Returns null | Rectangle

    • Traverses the (directed) graph invoking the given function for each visited vertex and edge. The function is invoked with the current vertex and the incoming edge as a parameter. This implementation makes sure each vertex is only visited once. The function may return false if the traversal should stop at the given vertex.

      Parameters

      • __namedParameters: HierarchicalGraphLayoutTraverseArgs

      Returns { [key: string]: null | Cell }