From 153b20bc15ceaa1fd1b2dfdb5046b118e7d17634 Mon Sep 17 00:00:00 2001 From: Jie-Wei Wu Date: Tue, 7 Mar 2023 18:52:26 -0800 Subject: [PATCH] re-arrange state --- .../webapp/metrics/store/metrics_types.ts | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/tensorboard/webapp/metrics/store/metrics_types.ts b/tensorboard/webapp/metrics/store/metrics_types.ts index 42b7925d3d..ff1b86c90d 100644 --- a/tensorboard/webapp/metrics/store/metrics_types.ts +++ b/tensorboard/webapp/metrics/store/metrics_types.ts @@ -161,14 +161,13 @@ export type CardToPinnedCard = Map; export type PinnedCardToCard = Map; export interface MetricsNamespacedState { + /* + * Date-related states: states below are drived from the server. + */ tagMetadataLoadState: LoadState; tagMetadata: TagMetadata; // A list of card ids in the main content area, excluding pinned copies. cardList: NonPinnedCardId[]; - cardToPinnedCopy: CardToPinnedCard; - // A map of card ids that previously pinned by the user. - cardToPinnedCopyCache: CardToPinnedCard; - pinnedCardToOriginal: PinnedCardToCard; /** * Pinned cards imported from storage that do not yet have a corresponding * card (e.g. tag metadata might not be loaded yet). Resolving an imported @@ -180,6 +179,19 @@ export interface MetricsNamespacedState { */ unresolvedImportedPinnedCards: CardUniqueInfo[]; cardMetadataMap: CardMetadataMap; + // Minimum and maximum step number across all TimeSeries data. + stepMinMax: { + min: number; + max: number; + }; + + /* + * Ui-related states: states below affects the dashboard appearance. + */ + cardToPinnedCopy: CardToPinnedCard; + // A map of card ids that previously pinned by the user. + cardToPinnedCopyCache: CardToPinnedCard; + pinnedCardToOriginal: PinnedCardToCard; cardStateMap: CardStateMap; cardStepIndex: CardStepIndexMap; tagFilter: string; @@ -193,11 +205,6 @@ export interface MetricsNamespacedState { // Empty Set would signify "show all". `filteredPluginTypes` will never have // all pluginTypes in the Set. filteredPluginTypes: Set; - // Minimum and maximum step number across all TimeSeries data. - stepMinMax: { - min: number; - max: number; - }; } export interface MetricsSettings {