override process()

in frontend/app/components/tensorflow_stats/operations_table/operations_table_data_provider.ts [30:116]


  override process(): google.visualization.DataTable|google.visualization.DataView|null {
    if (!this.dataTable ||
        (this.opExecutor !== OpExecutor.DEVICE &&
         this.opExecutor !== OpExecutor.HOST)) {
      return null;
    }

    let dataView: google.visualization.DataView|null = null;

    if (!this.hasDiff || !this.diffTable) {
      dataView = this.makeDataView(this.dataTable, this.opExecutor);
    } else {
      const oldDataView = this.makeDataView(this.diffTable, this.opExecutor);
      const newDataView = this.makeDataView(this.dataTable, this.opExecutor);
      if (!oldDataView || !newDataView) {
        return null;
      }
      const formatDiffInfo = [
        {
          rangeMin: 1,
          rangeMax: 1,
          hasColor: false,
          isLargeBetter: false,
        },
        {
          rangeMin: 0,
          rangeMax: 0,
          hasColor: true,
          isLargeBetter: false,
        },
        {
          rangeMin: 2,
          hasColor: true,
          isLargeBetter: false,
        },
      ];
      const formatValueInfo = [
        {
          rangeMin: 1,
          rangeMax: 1,
          multiplier: 1,
          fixed: 0,
          suffix: '',
        },
        {
          rangeMin: 2,
          rangeMax: 2,
          multiplier: 1,
          fixed: 3,
          suffix: '',
        },
        {
          rangeMin: 0,
          rangeMax: 0,
          multiplier: 100,
          fixed: 1,
          suffix: '%',
        },
        {
          rangeMin: 3,
          multiplier: 100,
          fixed: 1,
          suffix: '%',
        },
      ];
      dataView = computeDiffTable(
          /* oldTable= */ oldDataView.toDataTable(),
          /* newTable= */ newDataView.toDataTable(),
          /* referenceCol= */ 0,
          /* comparisonCol= */ 3,
          /* addColumnType= */ 'number',
          /* addColumnLabel= */ 'Diff total self time',
          /* sortColumn= */[],
          /* hiddenColumns= */[],
          /* formatDiffInfo= */ formatDiffInfo,
          /* formatValueInfo= */ formatValueInfo);
    }

    if (!dataView) {
      return null;
    }

    this.options.height =
        dataView.getNumberOfRows() < MINIMUM_ROWS ? '' : '600px';

    return dataView;
  }