Skip to content

Commit

Permalink
add missing type
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyajones committed Aug 30, 2023
1 parent 4eaf1b7 commit 594e291
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tensorboard/webapp/metrics/store/metrics_reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,16 @@ const {initialState, reducers: namespaceContextedReducer} =
settings: METRICS_SETTINGS_DEFAULT,
settingOverrides: {},
visibleCardMap: new Map<ElementId, CardId>(),
previousCardInteractions: {
tagFilters: [],
pins: [],
clicks: [],
},
newCardInteractions: {
tagFilters: [],
pins: [],
clicks: [],
},
},

/** onNavigated */
Expand Down
9 changes: 9 additions & 0 deletions tensorboard/webapp/metrics/store/metrics_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
} from '../data_source';
import {
CardId,
CardIdWithMetadata,
CardMetadata,
CardUniqueInfo,
HistogramMode,
Expand Down Expand Up @@ -166,6 +167,12 @@ export type CardStepIndexMap = Record<
CardStepIndexMetaData | null
>;

export type CardInteractions = {
tagFilters: string[];
pins: CardIdWithMetadata[];
clicks: CardIdWithMetadata[];
};

export type CardToPinnedCard = Map<NonPinnedCardId, PinnedCardId>;

export type PinnedCardToCard = Map<PinnedCardId, NonPinnedCardId>;
Expand Down Expand Up @@ -254,6 +261,8 @@ export interface MetricsNonNamespacedState {
* Map from ElementId to CardId. Only contains all visible cards.
*/
visibleCardMap: Map<ElementId, CardId>;
previousCardInteractions: CardInteractions;
newCardInteractions: CardInteractions;
}

export type MetricsState = NamespaceContextedState<
Expand Down
10 changes: 10 additions & 0 deletions tensorboard/webapp/metrics/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ function buildBlankState(): MetricsState {
isSettingsPaneOpen: false,
isSlideoutMenuOpen: false,
tableEditorSelectedTab: DataTableMode.SINGLE,
previousCardInteractions: {
tagFilters: [],
pins: [],
clicks: [],
},
newCardInteractions: {
tagFilters: [],
pins: [],
clicks: [],
},
};
}

Expand Down

0 comments on commit 594e291

Please sign in to comment.