Skip to content

Commit b92c9bb

Browse files
authored
Remove properties from tf-scalar-card (#627)
PR #626 had added default properties to vz-line-chart, and so we no longer have to specify them in tf-scalar-card. Specifically, we remove yValueAccessor and tooltipColumns but keep the binding for xComponentsCreationMethod. We keep the latter to let the user change the value on the horizontal axis. Test Plan: Note that TensorBoard WAI on scalars demo data. Changing horizontal axis (to wall time or relative) still works.
1 parent ce6b17f commit b92c9bb

File tree

1 file changed

+0
-51
lines changed

1 file changed

+0
-51
lines changed

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

-51
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
<tf-line-chart-data-loader
4040
x-type="[[xType]]"
4141
x-components-creation-method="[[_xComponentsCreationMethod]]"
42-
y-value-accessor="[[_yValueAccessor]]"
43-
tooltip-columns="[[_tooltipColumns]]"
4442
smoothing-enabled="[[smoothingEnabled]]"
4543
smoothing-weight="[[smoothingWeight]]"
4644
tooltip-sorting-method="[[tooltipSortingMethod]]"
@@ -234,55 +232,6 @@
234232
type: Object,
235233
computed: '_computeXComponentsCreationMethod(xType)',
236234
},
237-
238-
_yValueAccessor: {
239-
type: Object,
240-
readOnly: true,
241-
value: () => {
242-
return d => d.scalar;
243-
},
244-
},
245-
246-
_tooltipColumns: {
247-
type: Array,
248-
readOnly: true,
249-
value: () => {
250-
const valueFormatter = ChartHelpers.multiscaleFormatter(
251-
ChartHelpers.Y_TOOLTIP_FORMATTER_PRECISION);
252-
const formatValueOrNaN =
253-
(x) => isNaN(x) ? 'NaN' : valueFormatter(x);
254-
return [
255-
{
256-
title: 'Name',
257-
evaluate: (d) => d.dataset.metadata().name,
258-
},
259-
{
260-
title: 'Smoothed',
261-
evaluate: (d, statusObject) => formatValueOrNaN(
262-
statusObject.smoothingEnabled ?
263-
d.datum.smoothed : d.datum.scalar),
264-
},
265-
{
266-
title: 'Value',
267-
evaluate: (d) => formatValueOrNaN(d.datum.scalar),
268-
},
269-
{
270-
title: 'Step',
271-
evaluate: (d) => ChartHelpers.stepFormatter(d.datum.step),
272-
},
273-
{
274-
title: 'Time',
275-
evaluate: (d) => ChartHelpers.timeFormatter(d.datum.wall_time),
276-
},
277-
{
278-
title: 'Relative',
279-
evaluate:
280-
(d) => ChartHelpers.relativeFormatter(
281-
ChartHelpers.relativeAccessor(d.datum, -1, d.dataset)),
282-
},
283-
]
284-
},
285-
},
286235
},
287236
reload() {
288237
this.$$('tf-line-chart-data-loader').reload();

0 commit comments

Comments
 (0)