nice method

void nice([
  1. num count = 0
])
inherited

Like ScaleLinear.nice, except extends the domain to integer powers of base.

final x = ScaleLog(
  domain: [0.201479, 0.996679],
  range: [0, 960],
  interpolate: interpolateNumber,
)..nice();
x.domain; // [0.1, 1]

If the domain has more than two values, nicing the domain only affects the first and last value. Nicing a scale only modifies the current domain; it does not automatically nice domains that are subsequently set. You must re-nice the scale after setting the new domain, if desired.

Implementation

void nice([num count = 0]) {
  domain = nicee(domain, (
    floor: (num x) => _pows(_logs(x).floorToDouble()),
    ceil: (num x) => _pows(_logs(x).ceilToDouble())
  ));
}