Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GraphTracer

Hierarchy

Index

Constructors

constructor

  • new GraphTracer(title?: undefined | string): GraphTracer

Methods

addEdge

  • addEdge(source: any, target: any, weight?: any): void
  • Add an edge.

    Parameters

    • source: any

      The id of the node where the edge starts.

    • target: any

      The id of the node where the edge ends.

    • Optional weight: any

    Returns void

addNode

  • addNode(id: any, weight?: any, x?: undefined | number, y?: undefined | number): void
  • Add a node.

    Parameters

    • id: any
    • Optional weight: any
    • Optional x: undefined | number

      The x position between -160 and +160.

    • Optional y: undefined | number

      The y position between -160 and +160.

    Returns void

deselect

  • deselect(target: any, source?: any): void
  • Stop selecting a node.

    Parameters

    • target: any

      The id of the node to stop selecting.

    • Optional source: any

      The id of the node to stop selecting from.

    Returns void

destroy

  • destroy(): void

directed

  • directed(isDirected?: undefined | false | true): this
  • Make the graph directed.

    Parameters

    • Optional isDirected: undefined | false | true

    Returns this

layoutCircle

  • layoutCircle(): this

layoutRandom

  • layoutRandom(): this

layoutTree

  • layoutTree(root?: any, sorted?: undefined | false | true): this
  • Arrange nodes on a tree layout.

    Parameters

    • Optional root: any

      The id of a root node.

    • Optional sorted: undefined | false | true

      Whether to sort sibling nodes.

    Returns this

leave

  • leave(target: any, source?: any, weight?: any): void
  • Leave after visiting a node.

    Parameters

    • target: any

      The id of the node to leave.

    • Optional source: any

      The id of the node to leave to.

    • Optional weight: any

      The weight of target to set to.

    Returns void

log

removeEdge

  • removeEdge(source: any, target: any): void
  • Remove an edge.

    Parameters

    • source: any

      The id of the node where the edge starts.

    • target: any

      The id of the node where the edge ends.

    Returns void

removeNode

  • removeNode(id: any): void

reset

  • reset(): void

select

  • select(target: any, source?: any): void
  • Select a node.

    Parameters

    • target: any

      The id of the node to select.

    • Optional source: any

      The id of the node to select from.

    Returns void

set

  • set(array2d?: any[][]): void
  • Set an adjacency matrix to visualize.

    Parameters

    • Optional array2d: any[][]

    Returns void

updateEdge

  • updateEdge(source: any, target: any, weight?: any): void
  • Update an edge.

    Parameters

    • source: any

      The id of the node where the edge starts.

    • target: any

      The id of the node where the edge ends.

    • Optional weight: any

    Returns void

updateNode

  • updateNode(id: any, weight?: any, x?: undefined | number, y?: undefined | number): void
  • Update a node.

    Parameters

    • id: any
    • Optional weight: any
    • Optional x: undefined | number

      The x position between -160 and +160.

    • Optional y: undefined | number

      The y position between -160 and +160.

    Returns void

visit

  • visit(target: any, source?: any, weight?: any): void
  • Visit a node.

    Parameters

    • target: any

      The id of the node to visit.

    • Optional source: any

      The id of the node to visit from.

    • Optional weight: any

      The weight of target to set to.

    Returns void

weighted

  • weighted(isWeighted?: undefined | false | true): this
  • Make the graph weighted.

    Parameters

    • Optional isWeighted: undefined | false | true

    Returns this

Static delay

  • delay(lineNumber?: Number): void
  • Pause to show changes in all tracers.

    Parameters

    • Optional lineNumber: Number

      The line number to indicate when paused. If omitted, the line calling this method will be indicated.

    Returns void

Generated using TypeDoc