Skip to content

Commit f07a7db

Browse files
committed
Fix buttons for the scalars dashboard.
The scalars dashboard had been broken by #470 because the buttons had not been moved out of the tf-scalar-chart container. Furthermore, the tf-card-heading now must be block-positioned for the margin to take effect.
1 parent c27023e commit f07a7db

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

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

+33-23
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,27 @@
3636
display-name="[[tagMetadata.displayName]]"
3737
description="[[tagMetadata.description]]"
3838
></tf-card-heading>
39-
<tf-scalar-chart
40-
x-type="[[xType]]"
41-
x-components-creation-method="[[_xComponentsCreationMethod]]"
42-
y-value-accessor="[[_yValueAccessor]]"
43-
tooltip-columns="[[_tooltipColumns]]"
44-
smoothing-enabled="[[smoothingEnabled]]"
45-
smoothing-weight="[[smoothingWeight]]"
46-
tooltip-sorting-method="[[tooltipSortingMethod]]"
47-
ignore-y-outliers="[[ignoreYOutliers]]"
48-
request-manager="[[requestManager]]"
49-
runs="[[runs]]"
50-
tag="[[tag]]"
51-
tag-metadata="[[tagMetadata]]"
52-
active="[[active]]"
53-
data-url="[[_dataUrl]]"
54-
log-scale-active="[[_logScaleActive]]"
55-
process-data="[[_processData]]"
56-
>
39+
<div id="tf-scalar-chart-container">
40+
<tf-scalar-chart
41+
x-type="[[xType]]"
42+
x-components-creation-method="[[_xComponentsCreationMethod]]"
43+
y-value-accessor="[[_yValueAccessor]]"
44+
tooltip-columns="[[_tooltipColumns]]"
45+
smoothing-enabled="[[smoothingEnabled]]"
46+
smoothing-weight="[[smoothingWeight]]"
47+
tooltip-sorting-method="[[tooltipSortingMethod]]"
48+
ignore-y-outliers="[[ignoreYOutliers]]"
49+
request-manager="[[requestManager]]"
50+
runs="[[runs]]"
51+
tag="[[tag]]"
52+
tag-metadata="[[tagMetadata]]"
53+
active="[[active]]"
54+
data-url="[[_dataUrl]]"
55+
log-scale-active="[[_logScaleActive]]"
56+
process-data="[[_processData]]"
57+
>
58+
</tf-scalar-chart>
59+
</div>
5760
<div id="buttons">
5861
<paper-icon-button
5962
selected$="[[_expanded]]"
@@ -96,21 +99,28 @@
9699
</div>
97100
</template>
98101
</div>
99-
</tf-scalar-chart>
100102
<style>
101103
:host {
102-
height: 235px;
103-
width: 330px;
104104
margin: 5px;
105105
display: block;
106+
width: 330px;
106107
}
107108

108109
:host[_expanded] {
110+
width: 100%;
111+
}
112+
113+
:host[_expanded] #tf-scalar-chart-container {
109114
height: 400px;
115+
}
116+
117+
#tf-scalar-chart-container {
118+
height: 200px;
110119
width: 100%;
111120
}
112121

113122
tf-card-heading {
123+
display: block;
114124
margin-bottom: 10px;
115125
}
116126

@@ -158,7 +168,7 @@
158168
import * as ChartHelpers from '../vz-line-chart/vz-chart-helpers.js';
159169
import {getRouter} from '../tf-backend/router.js';
160170

161-
/**
171+
/**
162172
* Allows:
163173
* - "step" - Linear scale using the "step" property of the datum.
164174
* - "wall_time" - Temporal scale using the "wall_time" property of the
@@ -289,7 +299,7 @@
289299
this.set('_logScaleActive', !this._logScaleActive);
290300
},
291301
_resetDomain() {
292-
const chart = this.$$('vz-line-chart');
302+
const chart = this.$$('tf-scalar-chart');
293303
if (chart) {
294304
chart.resetDomain();
295305
}

0 commit comments

Comments
 (0)