GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • @maxgraph/core

This view

  • Original page
  • New address

GeezerVison is showing maxgraph.github.io — GraphHierarchyModel | @maxgraph/core

  • GraphHierarchyModel

Class GraphHierarchyModel

Internal model of a hierarchical graph. This model stores nodes and edges equivalent to the real graph nodes and edges, but also stores the rank of the cells, the order within the ranks and the new candidate locations of cells. The internal model also reverses edge direction were appropriate , ignores self-loop and groups parallels together under one edge object.

  • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:35
Index

Constructors

constructor

Properties

dfsCount edgeMapper maxRank parent ranks roots SOURCESCANSTARTRANK tightenToSource vertexMapper

Methods

createInternalCells dfs extendedDfs fixRanks initialRank visit

Constructors

constructor

  • new GraphHierarchyModel(
        layout: HierarchicalLayout,
        vertices: Cell[],
        roots: Cell[],
        parent: Cell,
        tightenToSource: boolean,
    ): GraphHierarchyModel

    Creates an internal ordered graph model using the vertices passed in. If there are any, leftward edge need to be inverted in the internal model

    Parameters

    • layout: HierarchicalLayout
    • vertices: Cell[]

      the vertices for this hierarchy

    • roots: Cell[]
    • parent: Cell
    • tightenToSource: boolean

      whether or not to tighten vertices towards the sources

    Returns GraphHierarchyModel

    • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:47

Properties

dfsCount

dfsCount: number = 0

Count of the number of times the ancestor dfs has been used.

  • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:154

edgeMapper

edgeMapper: Map<Cell, GraphHierarchyEdge>

Map from graph edges to internal model edges

  • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:133

maxRank

maxRank: number

Stores the largest rank number allocated

  • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:123

parent

parent: Cell | null = null

The parent cell whose children are being laid out

  • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:149

ranks

ranks: GraphAbstractHierarchyCell[][] | null = null

Mapping from rank number to actual rank

  • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:138

roots

roots: Cell[] | null = null

Store of roots of this hierarchy model, these are real graph cells, not internal cells

  • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:144

SOURCESCANSTARTRANK

SOURCESCANSTARTRANK: number = 100000000

High value to start source layering scan rank value from.

  • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:159

tightenToSource

tightenToSource: boolean = false

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

  • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:165

vertexMapper

vertexMapper: Map<Cell, GraphHierarchyNode>

Map from graph vertices to internal model nodes.

  • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:128

Methods

createInternalCells

  • createInternalCells(
        layout: HierarchicalLayout,
        vertices: Cell[],
        internalVertices: { [key: number]: GraphHierarchyNode },
    ): void

    Creates all edges in the internal model

    Parameters

    • layout: HierarchicalLayout

      Reference to the algorithm.

    • vertices: Cell[]

      Array of Cells that represent the vertices whom are to have an internal representation created.

    • internalVertices: { [key: number]: GraphHierarchyNode }

      The array of GraphHierarchyNodes to have their information filled in using the real vertices.

    Returns void

    • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:176

dfs

  • dfs(
        parent: GraphHierarchyNode | null,
        root: GraphHierarchyNode | null,
        connectingEdge: GraphHierarchyEdge | null,
        visitor: Function,
        seen: { [key: string]: GraphHierarchyNode | null },
        layer: number,
    ): void

    Performs a depth first search on the internal hierarchy model

    Parameters

    • parent: GraphHierarchyNode | null

      the parent internal node of the current internal node

    • root: GraphHierarchyNode | null

      the current internal node

    • connectingEdge: GraphHierarchyEdge | null

      the internal edge connecting the internal node and the parent internal node, if any

    • visitor: Function

      the visitor pattern to be called for each node

    • seen: { [key: string]: GraphHierarchyNode | null }

      a set of all nodes seen by this dfs a set of all of the ancestor node of the current node

    • layer: number

      the layer on the dfs tree ( not the same as the model ranks )

    Returns void

    • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:500

extendedDfs

  • extendedDfs(
        parent: GraphHierarchyNode | null,
        root: GraphHierarchyNode,
        connectingEdge: GraphHierarchyEdge | null,
        visitor: Function,
        seen: { [key: string]: GraphHierarchyNode },
        ancestors: any,
        childHash: string | number,
        layer: number,
    ): void

    Performs a depth first search on the internal hierarchy model. This dfs extends the default version by keeping track of cells ancestors, but it should be only used when necessary because of it can be computationally intensive for deep searches.

    Parameters

    • parent: GraphHierarchyNode | null

      the parent internal node of the current internal node

    • root: GraphHierarchyNode

      the current internal node

    • connectingEdge: GraphHierarchyEdge | null

      the internal edge connecting the internal node and the parent internal node, if any

    • visitor: Function

      the visitor pattern to be called for each node

    • seen: { [key: string]: GraphHierarchyNode }

      a set of all nodes seen by this dfs

    • ancestors: any

      the parent hash code

    • childHash: string | number

      the new hash code for this node

    • layer: number

      the layer on the dfs tree ( not the same as the model ranks )

    Returns void

    • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:548

fixRanks

  • fixRanks(): void

    Fixes the layer assignments to the values stored in the nodes. Also needs to create dummy nodes for edges that cross layers.

    Returns void

    • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:371

initialRank

  • initialRank(): void

    Basic determination of minimum layer ranking by working from from sources or sinks and working through each node in the relevant edge direction. Starting at the sinks is basically a longest path layering algorithm.

    Returns void

    • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:257

visit

  • visit(
        visitor: Function,
        dfsRoots: GraphHierarchyNode[] | null,
        trackAncestors: boolean,
        seenNodes?: { [key: string]: GraphHierarchyNode } | null,
    ): void

    A depth first search through the internal heirarchy model.

    Parameters

    • visitor: Function

      The visitor function pattern to be called for each node.

    • dfsRoots: GraphHierarchyNode[] | null
    • trackAncestors: boolean

      Whether or not the search is to keep track all nodes directly above this one in the search path.

    • seenNodes: { [key: string]: GraphHierarchyNode } | null = null

    Returns void

    • Defined in view/layout/hierarchical/GraphHierarchyModel.ts:447

Settings

Member Visibility
  • Protected
  • Inherited
Theme

On This Page

Constructors
constructor
Properties
dfsCountedgeMappermaxRankparentranksrootsSOURCESCANSTARTRANKtightenToSourcevertexMapper
Methods
createInternalCellsdfsextendedDfsfixRanksinitialRankvisit
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.