Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GraphViz

Hierarchy

Index

Constructors

constructor

  • new GraphViz(width: number, height: number, directed: boolean): GraphViz

Properties

Private boxSize

boxSize: number

directed

directed: boolean

edges

edges: EdgeViz[]

frozen

frozen: boolean

id

id: string

dom id for <g> element

maxHeight

maxHeight: number

maxWidth

maxWidth: number

nodeRadius

nodeRadius: number

nodes

nodes: NodeViz[]

pseudo

pseudo: Pseudocode

separation

separation: number

simulation

simulation: Simulation<any, any>

timeline

timeline: any[]

Array of animation states through time

transitionDuration

transitionDuration: number

Methods

addEdge

addNode

  • Returns NodeViz

allEdges

  • Returns NodeViz[]

allNodes

  • Returns NodeViz[]

delayedFreeze

  • delayedFreeze(ms: number): void
  • Parameters

    • ms: number

    Returns void

drag

  • drag(simulation: Simulation<any, any>): DragBehavior<Element, unknown, unknown>

freeze

  • freeze(): void
  • Freezes the graph. (Stops the particle simulation from occurring.)

    Returns void

Protected getElement

  • getElement(): Selection<any, any, any, any>
  • Returns the d3 selection that represents the structure. Probably a <g> element

    Returns Selection<any, any, any, any>

getState

  • getState(): any
  • Returns a copy of the structures current state.

    Returns any

pushAndTransition

  • pushAndTransition(): void
  • Pushes the current state onto the timeline and transitions to it.

    Returns void

pushState

  • pushState(): void
  • Adds the current state to the timeline.

    Returns void

removeEdge

  • Parameters

    Returns void

removeNode

  • Parameters

    Returns void

setMaxHeight

  • setMaxHeight(n: number): void

setMaxHeightWidth

  • setMaxHeightWidth(n: number): void

simulationTick

  • simulationTick(): void
  • Returns void

startSimulation

  • startSimulation(): void
  • Sets all the parameters of the particle simulation. Should be rerun if the parameters have been changed.

    Returns void

thaw

  • thaw(): void
  • Lets

    Returns void

transition

  • transition(state: any): void
  • Transitions the visuals to the given state. Details are implemented in subclasses. In subclasses, call super.transition(state); in the transition implementation.

    Parameters

    • state: any

    Returns void

Private transitionLinks

  • transitionLinks(linkData: any[], trans: Transition<any, any, any, any>): void
  • Helper method for transition(). Transitions the links.

    Parameters

    • linkData: any[]

      data for the links based off state

    • trans: Transition<any, any, any, any>

      the D3 transition being used

    Returns void

Private transitionNodes

  • transitionNodes(nodeData: any[], trans: Transition<any, any, any, any>): void
  • Helper method for transition(). Transitions the nodes.

    Parameters

    • nodeData: any[]

      data for the nodes based off state

    • trans: Transition<any, any, any, any>

      the D3 transition being used

    Returns void

wipeOut

  • wipeOut(): void
  • Returns the structure to it's blank state

    Returns void

Generated using TypeDoc