tensorboard icon indicating copy to clipboard operation
tensorboard copied to clipboard

Projector plugin UI not updated when data proto changes

Open svsgoogle opened this issue 9 years ago • 1 comments

When the data proto changes, the DataPanel's dataProvider attribute changes, but the selectedRun attribute will still have the value "proto", and therefore a call to DataPanel._selectedRunChanged() is never triggered. Consequently the projector UI still displays the old proto.

One possible solution is to change DataPanel.initialize() in vz-projector-data-panel.ts as follows:

  initialize(projector: Projector, dp: DataProvider) {
    this.projector = projector;
    let dataProviderSame = this.dataProvider == dp;
    this.dataProvider = dp;
    this.setupUploadButtons();

    // Tell the projector whenever the data normalization changes.
    // Unknown why, but the polymer checkbox button stops working as soon as
    // you do d3.select() on it.
    this.querySelector('#normalize-data-checkbox')
        .addEventListener('change', () => {
          this.projector.setNormalizeData(this.normalizeData);
        });

    let forceCategoricalColoringCheckbox =
        this.querySelector('#force-categorical-checkbox');
    forceCategoricalColoringCheckbox.addEventListener('change', () => {
      this.setForceCategoricalColoring(
          (forceCategoricalColoringCheckbox as HTMLInputElement).checked);
    });

    // Get all the runs.
    this.dataProvider.retrieveRuns(runs => {
      this.runNames = runs;
      // Choose the first run by default.
      if (this.runNames.length > 0) {
        let selectedRunSame = this.selectedRun == runs[0];
        this.selectedRun = runs[0];
        if (selectedRunSame && !dataProviderSame) {
          this._selectedRunChanged();
        }
      }
    });
  }

svsgoogle avatar Sep 05 '17 15:09 svsgoogle

Hmm, I'm trying to repro. How are you changing the data proto?

chihuahua avatar Sep 06 '17 09:09 chihuahua