Skip to content

Commit

Permalink
feat: nice ticks everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 committed Mar 23, 2021
1 parent 282082b commit fe47338
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/scales/scale_continuous.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
ScaleLogarithmic,
ScalePower,
ScaleTime,
ScaleContinuousNumeric,
} from 'd3-scale';
import { $Values, Required } from 'utility-types';

Expand Down Expand Up @@ -285,6 +286,10 @@ export class ScaleContinuous implements Scale {
}

this.d3Scale.domain(this.domain);
if (type !== ScaleType.Time) {
(this.d3Scale as ScaleContinuousNumeric<PrimitiveValue, number>).domain(this.domain).nice();
this.domain = this.d3Scale.domain();
}

const safeBarPadding = maxValueWithUpperLimit(barsPadding, 0, 1);
this.barsPadding = safeBarPadding;
Expand Down

0 comments on commit fe47338

Please sign in to comment.