The main graph object - this contrains nodes and edges that get modified with different Operations etc.

Hierarchy

  • Graph

Constructors

  • Construct a graph object (no initializing)

    Parameters

    • nodes: Map<number, _Node>

      Map of all the nodes associated with the graph

    • edges: Map<number, Edge>

      Map of all the edges assocaiated with the graph

    Returns Graph

Properties

edges: Map<number, Edge>
nodes: Map<number, _Node>

Methods

  • Add an edge to the graph

    Parameters

    • start: number

      Starting index of the edge

    • end: number

      The end index of the edge

    • data: any

      data associated with the edge

    Returns void

  • Add a noce to the graph

    Parameters

    • nodeID: number

      the node ID

    • data: _Node

      data associated with the node

    Returns void

  • Applies all the maps to the graph

    Parameters

    • layout: {
          emap: Map<number, Line>;
          pmap: Map<number, Point>;
      }

      Applies an object of maps associated with with a graph is made up of {pmap:(the position map), emap:{the edge map}}

      • emap: Map<number, Line>
      • pmap: Map<number, Point>

    Returns void

  • Apply an line map to a graph

    Parameters

    • data: Map<number, Line>

      Line data that has to be applied to the graph

    Returns void

  • Apply a position map based on some data

    Parameters

    • data: Map<number, Point>

      the position map that has to be applied to the graph

    Returns void

  • Constructs the adjacency associated with the graph

    Returns Promise<void>

  • Returns Map<number, number[]>

    Get the adjaceny (adjacency lists) associated with the graph

  • get the current edge map

    Returns Map<number, Line>

    The current set of edges associated with the graph

  • Gets the position map and the edge map respectively

    Returns {
        emap: Map<number, Line>;
        pmap: Map<number, Point>;
    }

    the positon map and the edge map as pmap and emap

    • emap: Map<number, Line>
    • pmap: Map<number, Point>
  • get the postion of the nodes in the graph

    Returns Map<number, Point>

    the position map

  • Initializes the graph and constructs a node adajaceny list list

    Returns Promise<void>

  • Prints out a snapshot of data associated with this graph like how many nodes and how many edges

    Returns void

  • This is the official create method to make a graph based on a set of nodes and edges It also auto initializes the graph and sets all the adjaceny lists in the memory

    Parameters

    • nodes: Map<number, _Node>

      map of nodes

    • edges: Map<number, Edge>

      map of edges

    Returns Promise<Graph>

Generated using TypeDoc