selectFunction(functionId) {
    this.clearGraph();
    this.selectedFunctionId_ = null;

    // Scrape the function/proc/block names from the package.
    let graph = null;
    for (let func of this.package_['function_bases']) {
      if (functionId == func['id']) {
        graph = func;
      }
    }
    if (graph == null) {
      return;
    }
    this.irGraph_ = new irGraph.IrGraph(graph);
    this.graph_ = new selectableGraph.SelectableGraph(this.irGraph_);
    this.highlightIr_(graph);
    this.setIrTextListeners_();
    this.selectedFunctionId_ = functionId;

    if (this.graphView_) {
      this.draw(document.getElementById('only-selected-checkbox').checked);
    }

    // Scroll the start of the selected function definition into view.
    document.getElementById(`ir-function-def-${functionId}`).scrollIntoView();

    // Unselect all functions. This will grey out the IR text of all functions.
    document.querySelectorAll('.ir-function').forEach(e => {
      e.classList.add('ir-function-unselected');
    });

    // For the selected function, add the class `ir-function-selected` which
    // will display this function in normal (not greyed out) text.
    document.getElementById(`ir-function-${functionId}`)
        .classList.remove('ir-function-unselected');
    document.getElementById(`ir-function-${functionId}`)
        .classList.add('ir-function-selected');
  }
/**
   * Sets the function to visualize to the function with the given id.
   * @param {string} functionId
   */
Sets the function to visualize to the function with the given id.
@param {string} functionId
Sets the function to visualize to the function with the given id . @param { string } functionId
selectFunction(functionId) {
    this.clearGraph();
    this.selectedFunctionId_ = null;
    let graph = null;
    for (let func of this.package_['function_bases']) {
      if (functionId == func['id']) {
        graph = func;
      }
    }
    if (graph == null) {
      return;
    }
    this.irGraph_ = new irGraph.IrGraph(graph);
    this.graph_ = new selectableGraph.SelectableGraph(this.irGraph_);
    this.highlightIr_(graph);
    this.setIrTextListeners_();
    this.selectedFunctionId_ = functionId;
    if (this.graphView_) {
      this.draw(document.getElementById('only-selected-checkbox').checked);
    }
    document.getElementById(`ir-function-def-${functionId}`).scrollIntoView();
    document.querySelectorAll('.ir-function').forEach(e => {
      e.classList.add('ir-function-unselected');
    });
    document.getElementById(`ir-function-${functionId}`)
        .classList.remove('ir-function-unselected');
    document.getElementById(`ir-function-${functionId}`)
        .classList.add('ir-function-selected');
  }
selectFunction ( functionId ) { this . clearGraph ( ) ; this . selectedFunctionId_ = null ; let graph = null ; for ( let func of this . package_ [ 'function_bases' ] ) { if ( functionId == func [ 'id' ] ) { graph = func ; } } if ( graph == null ) { return ; } this . irGraph_ = new irGraph . IrGraph ( graph ) ; this . graph_ = new selectableGraph . SelectableGraph ( this . irGraph_ ) ; this . highlightIr_ ( graph ) ; this . setIrTextListeners_ ( ) ; this . selectedFunctionId_ = functionId ; if ( this . graphView_ ) { this . draw ( document . getElementById ( 'only-selected-checkbox' ) . checked ) ; } document . getElementById ( ` ${ functionId } ` ) . scrollIntoView ( ) ; document . querySelectorAll ( '.ir-function' ) . forEach ( e => { e . classList . add ( 'ir-function-unselected' ) ; } ) ; document . getElementById ( ` ${ functionId } ` ) . classList . remove ( 'ir-function-unselected' ) ; document . getElementById ( ` ${ functionId } ` ) . classList . add ( 'ir-function-selected' ) ; }
Sets the function to visualize to the function with the given id.
Sets the function to visualize to the function with the given id .
// Scrape the function/proc/block names from the package. // Scroll the start of the selected function definition into view. // Unselect all functions. This will grey out the IR text of all functions. // For the selected function, add the class `ir-function-selected` which // will display this function in normal (not greyed out) text.