Skip to content

Commit

Permalink
scalar: fix axis label on Firefox (#5078)
Browse files Browse the repository at this point in the history
Please see #5077 for more details. Because of the tight tolerance,
Plottable was setting `visibility: hidden` on the axis label when it
really shouldn't since we have sufficient space.
  • Loading branch information
stephanwlee authored Jun 21, 2021
1 parent c34a593 commit 34877f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tensorboard/components/vz_line_chart2/line-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ export class LineChart {
this.xAccessor = xComponents.accessor;
this.xScale = xComponents.scale;
this.xAxis = xComponents.axis;
(this.xAxis.margin(0) as Plottable.Axes.Numeric).tickLabelPadding(3);
// Default margin is 15 pixels but we do not need it. Setting it to zero
// makes space calculation a bit too tight and hide axis label by mistake.
// To workaround the tight tolerance issue, we add 1px of margin.
// See https://github.com/tensorflow/tensorboard/issues/5077.
(this.xAxis.margin(1) as Plottable.Axes.Numeric).tickLabelPadding(3);
if (xAxisFormatter) {
this.xAxis.formatter(xAxisFormatter);
}
Expand Down

0 comments on commit 34877f1

Please sign in to comment.