Skip to content

Commit 9d1567a

Browse files
committed
Only open first two panes by default
This will prevent TensorBoard from using too many resources for anyone with a large number of tags. In the near future we might want to solve this in a smarter way, possibly by not rendering things outside the viewport. See also #728
1 parent d0e4967 commit 9d1567a

File tree

7 files changed

+33
-7
lines changed

7 files changed

+33
-7
lines changed

Diff for: tensorboard/plugins/audio/tf_audio_dashboard/tf-audio-dashboard.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ <h3>No audio data was found.</h3>
7272
<iron-icon prefix icon="search"></iron-icon>
7373
</paper-input>
7474
<template is="dom-repeat" items="[[_categories]]" as="category">
75-
<tf-category-pane category="[[category]]">
75+
<tf-category-pane category="[[category]]" opened="[[_shouldOpen(index)]]">
7676
<tf-paginated-view
7777
items="[[category.items]]"
7878
pages="{{category._pages}}"
@@ -160,6 +160,10 @@ <h3>No audio data was found.</h3>
160160
});
161161
},
162162

163+
_shouldOpen(index) {
164+
return index <= 2;
165+
},
166+
163167
_makeCategories(runToTagInfo, selectedRuns, tagFilter) {
164168
const runToTag = _.mapValues(runToTagInfo, x => Object.keys(x));
165169
const baseCategories =

Diff for: tensorboard/plugins/distribution/tf_distribution_dashboard/tf-distribution-dashboard.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ <h3>No distribution data was found.</h3>
8484
<template is="dom-if" if="[[!_dataNotFound]]">
8585
<tf-tag-filterer tag-filter="{{_tagFilter}}"></tf-tag-filterer>
8686
<template is="dom-repeat" items="[[_categories]]" as="category">
87-
<tf-category-pane category="[[category]]">
87+
<tf-category-pane category="[[category]]" opened="[[_shouldOpen(index)]]">
8888
<tf-paginated-view
8989
items="[[category.items]]"
9090
pages="{{category._pages}}"
@@ -184,6 +184,10 @@ <h3>No distribution data was found.</h3>
184184
});
185185
},
186186

187+
_shouldOpen(index) {
188+
return index <= 2;
189+
},
190+
187191
_makeCategories(runToTag, selectedRuns, tagFilter, categoriesDomReady) {
188192
return tf_categorization_utils.categorizeRunTagCombinations(runToTag, selectedRuns, tagFilter);
189193
},

Diff for: tensorboard/plugins/histogram/tf_histogram_dashboard/tf-histogram-dashboard.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ <h3>No histogram data was found.</h3>
9191
<template is="dom-if" if="[[!_dataNotFound]]">
9292
<tf-tag-filterer tag-filter="{{_tagFilter}}"></tf-tag-filterer>
9393
<template is="dom-repeat" items="[[_categories]]" as="category">
94-
<tf-category-pane category="[[category]]">
94+
<tf-category-pane category="[[category]]" opened="[[_shouldOpen(index)]]">
9595
<tf-paginated-view
9696
items="[[category.items]]"
9797
pages="{{category._pages}}"
@@ -197,6 +197,10 @@ <h3>No histogram data was found.</h3>
197197
});
198198
},
199199

200+
_shouldOpen(index) {
201+
return index <= 2;
202+
},
203+
200204
_makeCategories(runToTag, selectedRuns, tagFilter, categoriesDomReady) {
201205
return tf_categorization_utils.categorizeRunTagCombinations(runToTag, selectedRuns, tagFilter);
202206
},

Diff for: tensorboard/plugins/image/tf_image_dashboard/tf-image-dashboard.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ <h3>No image data was found.</h3>
115115
<template is="dom-if" if="[[!_dataNotFound]]">
116116
<tf-tag-filterer tag-filter="{{_tagFilter}}"></tf-tag-filterer>
117117
<template is="dom-repeat" items="[[_categories]]" as="category">
118-
<tf-category-pane category="[[category]]">
118+
<tf-category-pane category="[[category]]" opened="[[_shouldOpen(index)]]">
119119
<tf-paginated-view
120120
items="[[category.items]]"
121121
pages="{{category._pages}}"
@@ -270,6 +270,10 @@ <h3>No image data was found.</h3>
270270
});
271271
},
272272

273+
_shouldOpen(index) {
274+
return index <= 2;
275+
},
276+
273277
_resetBrightness() {
274278
this._brightnessAdjustment = this._defaultBrightnessAdjustment;
275279
},

Diff for: tensorboard/plugins/pr_curve/tf_pr_curve_dashboard/tf-pr-curve-dashboard.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ <h3>No precision–recall curve data was found.</h3>
9292
<template is="dom-if" if="[[!_dataNotFound]]">
9393
<tf-tag-filterer tag-filter="{{_tagFilter}}"></tf-tag-filterer>
9494
<template is="dom-repeat" items="[[_categories]]" as="category">
95-
<tf-category-pane category="[[category]]">
95+
<tf-category-pane category="[[category]]" opened="[[_shouldOpen(index)]]">
9696
<tf-paginated-view
9797
items="[[category.items]]"
9898
pages="{{category._pages}}"
@@ -194,6 +194,9 @@ <h3>No precision–recall curve data was found.</h3>
194194
this._reloadCards();
195195
});
196196
},
197+
_shouldOpen(index) {
198+
return index <= 2;
199+
},
197200
_fetchTags() {
198201
const url = tf_backend.getRouter().pluginRoute('pr_curves', '/tags');
199202
return this._requestManager.request(url).then(runToTagInfo => {

Diff for: tensorboard/plugins/scalar/tf_scalar_dashboard/tf-scalar-dashboard.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ <h3>No scalar data was found.</h3>
121121
<template is="dom-if" if="[[!_dataNotFound]]">
122122
<tf-tag-filterer tag-filter="{{_tagFilter}}"></tf-tag-filterer>
123123
<template is="dom-repeat" items="[[_categories]]" as="category">
124-
<tf-category-pane category="[[category]]">
124+
<tf-category-pane category="[[category]]" opened="[[_shouldOpen(index)]]">
125125
<tf-paginated-view
126126
items="[[category.items]]"
127127
pages="{{category._pages}}"
@@ -245,6 +245,10 @@ <h3>No scalar data was found.</h3>
245245
return _smoothingWeight > 0;
246246
},
247247

248+
_shouldOpen(index) {
249+
return index <= 2;
250+
},
251+
248252
ready() {
249253
this.reload();
250254
},

Diff for: tensorboard/plugins/text/tf_text_dashboard/tf-text-dashboard.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h3>No text data was found.</h3>
6464
<template is="dom-if" if="[[!_dataNotFound]]">
6565
<tf-tag-filterer tag-filter="{{_tagFilter}}"></tf-tag-filterer>
6666
<template is="dom-repeat" items="[[_categories]]" as="category">
67-
<tf-category-pane category="[[category]]">
67+
<tf-category-pane category="[[category]]" opened="[[_shouldOpen(index)]]">
6868
<tf-paginated-view
6969
items="[[category.items]]"
7070
pages="{{category._pages}}"
@@ -128,6 +128,9 @@ <h3>No text data was found.</h3>
128128
this._reloadTexts();
129129
});
130130
},
131+
_shouldOpen(index) {
132+
return index <= 2;
133+
},
131134
_fetchTags() {
132135
const url = tf_backend.getRouter().pluginRoute('text', '/tags');
133136
return this._requestManager.request(url).then(runToTag => {

0 commit comments

Comments
 (0)