Skip to content

Commit 7bf028f

Browse files
committed
Embedding Projector: fix bookmark projection state
1 parent 963afb7 commit 7bf028f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tensorboard/plugins/projector/vz_projector/data.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,8 @@ export class State {
680680
filteredPoints: number[];
681681
/** The indices of selected points. */
682682
selectedPoints: number[] = [];
683+
/** The shuffled indices of points. */
684+
shuffledDataIndices: number[] = [];
683685
/** Camera state (2d/3d, position, target, zoom, etc). */
684686
cameraDef: CameraDef;
685687
/** Color by option. */

tensorboard/plugins/projector/vz_projector/vz-projector.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ class Projector
650650
state.tSNEIteration = this.dataSet.tSNEIteration;
651651
state.selectedPoints = this.selectedPointIndices;
652652
state.filteredPoints = this.dataSetFilterIndices!;
653+
state.shuffledDataIndices = this.dataSet.shuffledDataIndices;
653654
this.projectorScatterPlotAdapter.populateBookmarkFromUI(state);
654655
state.selectedColorOptionName = this.dataPanel.selectedColorOptionName;
655656
state.forceCategoricalColoring = this.dataPanel.forceCategoricalColoring;
@@ -674,10 +675,14 @@ class Projector
674675
const point = this.dataSet.points[i];
675676
const projection = state.projections[i];
676677
const keys = Object.keys(projection);
678+
point.projections = {};
677679
for (let j = 0; j < keys.length; ++j) {
678680
point.projections[keys[j]] = projection[keys[j]];
679681
}
680682
}
683+
if (state.shuffledDataIndices) {
684+
this.dataSet.shuffledDataIndices = state.shuffledDataIndices;
685+
}
681686
this.dataSet.hasTSNERun = state.selectedProjection === 'tsne';
682687
this.dataSet.tSNEIteration = state.tSNEIteration;
683688
this.projectionsPanel.restoreUIFromBookmark(state);

0 commit comments

Comments
 (0)