function TreeNode(name, file, line, parent_ref = undefined) {
  this.count = 0;
  this.child_count = 0;
  if (parent_ref) {
    this.parent_ref = parent_ref;
    parent_ref.children.push(this);
  } else {
    this.parent_ref = undefined;
  }
  this.children = [];
  this.file = file;
  this.name = name;
  this.line = line;
  this.colour = colours[0];
  this.width = 0;
  this.x_pos = 0;
  this.depth = (parent_ref === undefined) ? 0 : parent_ref.depth + 1;
  this.selected = false;
  this.addTicks = function(ticks) {
    this.count += ticks;
    let next_parent = this.parent_ref;
    while (next_parent) {
      next_parent.child_count += ticks;
      next_parent = next_parent.parent_ref;
    }
  };
  all_tree_nodes.push(this);
  max_depth = Math.max(max_depth, this.depth);
}
// Constructor, creates a TreeNode from a profile node.
Constructor, creates a TreeNode from a profile node.
Constructor creates a TreeNode from a profile node .
function TreeNode(name, file, line, parent_ref = undefined) {
  this.count = 0;
  this.child_count = 0;
  if (parent_ref) {
    this.parent_ref = parent_ref;
    parent_ref.children.push(this);
  } else {
    this.parent_ref = undefined;
  }
  this.children = [];
  this.file = file;
  this.name = name;
  this.line = line;
  this.colour = colours[0];
  this.width = 0;
  this.x_pos = 0;
  this.depth = (parent_ref === undefined) ? 0 : parent_ref.depth + 1;
  this.selected = false;
  this.addTicks = function(ticks) {
    this.count += ticks;
    let next_parent = this.parent_ref;
    while (next_parent) {
      next_parent.child_count += ticks;
      next_parent = next_parent.parent_ref;
    }
  };
  all_tree_nodes.push(this);
  max_depth = Math.max(max_depth, this.depth);
}
function TreeNode ( name , file , line , parent_ref = undefined ) { this . count = 0 ; this . child_count = 0 ; if ( parent_ref ) { this . parent_ref = parent_ref ; parent_ref . children . push ( this ) ; } else { this . parent_ref = undefined ; } this . children = [ ] ; this . file = file ; this . name = name ; this . line = line ; this . colour = colours [ 0 ] ; this . width = 0 ; this . x_pos = 0 ; this . depth = ( parent_ref === undefined ) ? 0 : parent_ref . depth + 1 ; this . selected = false ; this . addTicks = function ( ticks ) { this . count += ticks ; let next_parent = this . parent_ref ; while ( next_parent ) { next_parent . child_count += ticks ; next_parent = next_parent . parent_ref ; } } ; all_tree_nodes . push ( this ) ; max_depth = Math . max ( max_depth , this . depth ) ; }
Constructor, creates a TreeNode from a profile node.
Constructor creates a TreeNode from a profile node .