Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • DepGraph

Index

Properties

incomingEdges

incomingEdges: any

nodes

nodes: any

outgoingEdges

outgoingEdges: any

Methods

addDependency

  • addDependency(from: any, to: any): boolean
  • Add a dependency between two nodes. If either of the nodes does not exist, an Error will be thrown.

    Parameters

    • from: any
    • to: any

    Returns boolean

addNode

  • addNode(node: any, data?: any): void
  • Add a node to the dependency graph. If a node already exists, this method will do nothing.

    Parameters

    • node: any
    • Optional data: any

    Returns void

dependantsOf

  • dependantsOf(node: any, leavesOnly: any): any[]
  • get an array containing the nodes that depend on the specified node (transitively).

    Throws an Error if the graph has a cycle, or the specified node does not exist.

    If leavesOnly is true, only nodes that do not have any dependants will be returned in the array.

    Parameters

    • node: any
    • leavesOnly: any

    Returns any[]

dependenciesOf

  • dependenciesOf(node: any, leavesOnly: any): any[]
  • Get an array containing the nodes that the specified node depends on (transitively).

    Throws an Error if the graph has a cycle, or the specified node does not exist.

    If leavesOnly is true, only nodes that do not depend on any other nodes will be returned in the array.

    Parameters

    • node: any
    • leavesOnly: any

    Returns any[]

getNodeData

  • getNodeData(node: any): any
  • Get the data associated with a node name

    Parameters

    • node: any

    Returns any

hasNode

  • hasNode(node: any): any
  • Check if a node exists in the graph

    Parameters

    • node: any

    Returns any

overallOrder

  • overallOrder(leavesOnly?: any): any[]
  • Construct the overall processing order for the dependency graph.

    Throws an Error if the graph has a cycle.

    If leavesOnly is true, only nodes that do not depend on any other nodes will be returned.

    Parameters

    • Optional leavesOnly: any

    Returns any[]

removeDependency

  • removeDependency(from: any, to: any): void
  • Remove a dependency between two nodes.

    Parameters

    • from: any
    • to: any

    Returns void

removeNode

  • removeNode(node: any): void
  • Remove a node from the dependency graph. If a node does not exist, this method will do nothing.

    Parameters

    • node: any

    Returns void

setNodeData

  • setNodeData(node: any, data: any): void
  • Set the associated data for a given node name. If the node does not exist, this method will throw an error

    Parameters

    • node: any
    • data: any

    Returns void

Generated using TypeDoc