Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Graph<NodeDataType, VertexDataType>

Type parameters

  • NodeDataType

  • VertexDataType

Hierarchy

  • Graph

Index

Constructors

constructor

  • new Graph(nodes: Map<string, Node<NodeDataType>>, vertices: Vertex<VertexDataType>[]): Graph

Properties

nodes

nodes: Map<string, Node<NodeDataType>>

vertices

vertices: Vertex<VertexDataType>[]

Methods

coulombEsqueForce

  • coulombEsqueForce(delta: Vector3, forceStrength: number, maxDistance: number): void
  • Add in Coulomb-esque node-node repulsive forces

    Parameters

    • delta: Vector3
    • forceStrength: number
    • maxDistance: number

    Returns void

hookeEsqueForce

  • hookeEsqueForce(delta: Vector3, maxDistance: number, forceStrength: number): void
  • Add Hooke-esque edge spring forces

    Parameters

    • delta: Vector3
    • maxDistance: number
    • forceStrength: number

    Returns void

moveEdges

  • moveEdges(dampening: number, maxVelocity: number): void

moveVertices

  • moveVertices(): void

optimize

  • optimize(iterations?: number, forceStrength?: number, dampening?: number, maxVelocity?: number, maxDistance?: number, delta?: Vector3): void
  • Parameters

    • Default value iterations: number = 10
    • Default value forceStrength: number = 10
    • Default value dampening: number = 0.01
    • Default value maxVelocity: number = 2
    • Default value maxDistance: number = 50
    • Default value delta: Vector3 = new Vector3()

    Returns void

Generated using TypeDoc