Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Protected constructor

  • new TreeViz(width: number, height: number): TreeViz

Properties

containerDict

containerDict: default<NodeViz, NodeChildrenContainer>

Stores current node id along with the visualization structure of its children

edgeDict

edgeDict: default<string, EdgeViz>

Stores edges that are not regular (eg. have some highlight or label) by string source.id + "_" + target.id

id

id: string

dom id for <g> element

maxHeight

maxHeight: number

maxWidth

maxWidth: number

pseudo

pseudo: Pseudocode

root

root: NodeViz

Root NodeViz of the tree

timeline

timeline: any[]

Array of animation states through time

transitionDuration

transitionDuration: number

Methods

Abstract addChild

  • Adds a child node to a given parent node.

    Parameters

    Returns NodeViz

    the newly child node of type NodeViz

Abstract addRoot

  • Adds root node to current instance of MultiTreeViz.

    Returns NodeViz

    the newly created root node of type NodeViz

Abstract allNodes

  • Returns a list of all the NodeViz objects that make up the structure.

    Returns NodeViz[]

    a list of NodeViz

Abstract getEdgeByNodes

  • Gets an EdgeViz object to manipulate an edge. If no object existed before it create a new one. Otherwise it returns the old one.

    Parameters

    Returns EdgeViz

    a new nodeViz object to manipulate the edge

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>

Abstract getNodeById

  • getNodeById(nId: string): NodeViz
  • ONLY MADE FOR TESTING PURPOSES. Returns node with id == nId`

    Parameters

    • nId: string

      the DOM id of the node

    Returns NodeViz

getParent

  • Returns the parent of node or null if node is the root.

    Parameters

    Returns NodeViz

getState

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

    Returns any

moveSubtree

  • Puts the subtree rooted at source in the location of target. Deleting the subtree of target.

    pre

    Precondition: target must not be a descendant of source.

    Parameters

    Returns void

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

removeNode

  • Removes node from the structure along with it's subtree.

    Parameters

    Returns void

setMaxHeight

  • setMaxHeight(n: number): void

setMaxHeightWidth

  • setMaxHeightWidth(n: number): 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

transplant

  • Swaps the position of 2 subtrees. If one node is a descendant of the other then the subtree of the ancestor will be removed and replaced with just the subtree of the descendant.

    Parameters

    Returns void

wipeOut

  • wipeOut(): void
  • Removes all nodes and edges from the tree including the root.

    Returns void

Generated using TypeDoc