Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: nice ticks everywhere #1087

Merged
merged 18 commits into from
Apr 13, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: nice ticks everywhere
  • Loading branch information
markov00 committed Mar 23, 2021
commit fe47338e6f2a6c64daeba4cd0df68b27925f3de2
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