Skip to content

Commit

Permalink
Remove properties from tf-scalar-card (#627)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chihuahua committed Oct 6, 2017
1 parent ce6b17f commit b92c9bb
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions tensorboard/plugins/scalar/tf_scalar_dashboard/tf-scalar-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
<tf-line-chart-data-loader
x-type="[[xType]]"
x-components-creation-method="[[_xComponentsCreationMethod]]"
y-value-accessor="[[_yValueAccessor]]"
tooltip-columns="[[_tooltipColumns]]"
smoothing-enabled="[[smoothingEnabled]]"
smoothing-weight="[[smoothingWeight]]"
tooltip-sorting-method="[[tooltipSortingMethod]]"
Expand Down Expand Up @@ -234,55 +232,6 @@
type: Object,
computed: '_computeXComponentsCreationMethod(xType)',
},

_yValueAccessor: {
type: Object,
readOnly: true,
value: () => {
return d => d.scalar;
},
},

_tooltipColumns: {
type: Array,
readOnly: true,
value: () => {
const valueFormatter = ChartHelpers.multiscaleFormatter(
ChartHelpers.Y_TOOLTIP_FORMATTER_PRECISION);
const formatValueOrNaN =
(x) => isNaN(x) ? 'NaN' : valueFormatter(x);
return [
{
title: 'Name',
evaluate: (d) => d.dataset.metadata().name,
},
{
title: 'Smoothed',
evaluate: (d, statusObject) => formatValueOrNaN(
statusObject.smoothingEnabled ?
d.datum.smoothed : d.datum.scalar),
},
{
title: 'Value',
evaluate: (d) => formatValueOrNaN(d.datum.scalar),
},
{
title: 'Step',
evaluate: (d) => ChartHelpers.stepFormatter(d.datum.step),
},
{
title: 'Time',
evaluate: (d) => ChartHelpers.timeFormatter(d.datum.wall_time),
},
{
title: 'Relative',
evaluate:
(d) => ChartHelpers.relativeFormatter(
ChartHelpers.relativeAccessor(d.datum, -1, d.dataset)),
},
]
},
},
},
reload() {
this.$$('tf-line-chart-data-loader').reload();
Expand Down

0 comments on commit b92c9bb

Please sign in to comment.