Skip to content

Commit 19df7bb

Browse files
authored
Show only integer ticks in stepAxis (#1396)
A step is a discrete entity, not a contiguous one. Plottable, without a custom tick generator, tries to generate predefiend number of ticks which can result in decimal ticks when domain is small enough. Instead, we now show only ticks on integer values.
1 parent 208d81c commit 19df7bb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tensorboard/components/vz_chart_helpers/vz-chart-helpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ export let stepFormatter =
196196
Plottable.Formatters.siSuffix(STEP_FORMATTER_PRECISION);
197197
export function stepX(): XComponents {
198198
let scale = new Plottable.Scales.Linear();
199+
scale.tickGenerator(Plottable.Scales.TickGenerators.integerTickGenerator());
199200
let axis = new Plottable.Axes.Numeric(scale, 'bottom');
200201
axis.formatter(stepFormatter);
201202
return {

0 commit comments

Comments
 (0)