Skip to content

Commit dce0125

Browse files
stephanwleenfelt
authored andcommitted
Revert category pane behavior to 1.10 (#1455)
This reverts the new behavior introduced as part of #1324. It used to remove pane that has no matching tag/run.
1 parent 5e4a8bd commit dce0125

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

tensorboard/components/tf_categorization_utils/categorizationUtils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,16 @@ export function categorizeTags(
124124
runToTag: RunToTag,
125125
selectedRuns: string[],
126126
query?: string): TagCategory[] {
127-
runToTag = _.pick(runToTag, selectedRuns);
128127
const tags = tf_backend.getTags(runToTag);
129128
const categories = categorize(tags, query);
130-
const tagToRuns = createTagToRuns(runToTag);
129+
const tagToRuns = createTagToRuns(_.pick(runToTag, selectedRuns));
131130

132131
return categories.map(({name, metadata, items}) => ({
133132
name,
134133
metadata,
135134
items: items.map(tag => ({
136135
tag,
137-
runs: tagToRuns.get(tag).slice(),
136+
runs: (tagToRuns.get(tag) || []).slice(),
138137
})),
139138
}));
140139
}

tensorboard/plugins/scalar/tf_scalar_dashboard/tf-scalar-dashboard.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ <h3>No scalar data was found.</h3>
197197
const PLUGIN_NAME = 'scalars';
198198
const USE_DATA_SELECTOR = tf_globals.getEnableDataSelector();
199199
const SelectionType = tf_data_selector.Type;
200-
const NUM_DEFAULT_OPENED_PANE = 2;
200+
const NUM_DEFAULT_OPENED_PANE = 3;
201201

202202
Polymer({
203203
is: 'tf-scalar-dashboard',
@@ -377,9 +377,7 @@ <h3>No scalar data was found.</h3>
377377
query = tagRegex;
378378
selectedRuns = runs.map(({name}) => name);
379379
}
380-
const runToTag = _.mapValues(
381-
_.pick(runToTagInfo, selectedRuns),
382-
x => Object.keys(x));
380+
const runToTag = _.mapValues(runToTagInfo, x => Object.keys(x));
383381
categories = tf_categorization_utils.categorizeTags(
384382
runToTag, selectedRuns, query);
385383
categories.forEach(category => {

0 commit comments

Comments
 (0)