Class Graph<NodeDataType, VertexDataType>
Type parameters
-
NodeDataType
-
VertexDataType
Constructors
constructor
- new Graph(nodes: Map<string, Node<NodeDataType>>, vertices: Vertex<VertexDataType>[]): Graph
-
Parameters
-
nodes: Map<string, Node<NodeDataType>>
-
vertices: Vertex<VertexDataType>[]
Properties
nodes
nodes
: Map<string, Node<NodeDataType>>
vertices
vertices
: Vertex<VertexDataType>[]
Methods
coulombEsqueForce
- coulombEsqueForce(delta: Vector3, forceStrength: number, maxDistance: number): void
-
Parameters
-
delta: Vector3
-
forceStrength: number
-
maxDistance: number
Returns void
hookeEsqueForce
- hookeEsqueForce(delta: Vector3, maxDistance: number, forceStrength: number): void
-
Parameters
-
delta: Vector3
-
maxDistance: number
-
forceStrength: number
Returns void
moveEdges
- moveEdges(dampening: number, maxVelocity: number): void
-
Parameters
-
dampening: number
-
maxVelocity: number
Returns 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
Add in Coulomb-esque node-node repulsive forces