mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
Omit zero interval, and don't nice the values
* to keep promise of radio buttons: * 1 month should mean 30/31 days
This commit is contained in:
parent
97e3bfe1c0
commit
e89996bc27
1 changed files with 2 additions and 3 deletions
|
@ -84,13 +84,12 @@ export function prepareIntervalData(
|
||||||
case IntervalRange.All:
|
case IntervalRange.All:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const xMin = 0;
|
const xMin = 1;
|
||||||
xMax = xMax! + 1;
|
xMax = xMax! + 1;
|
||||||
|
|
||||||
// cap bars to available range
|
// cap bars to available range
|
||||||
const desiredBars = Math.min(70, xMax! - xMin!);
|
const desiredBars = Math.min(70, xMax! - xMin!);
|
||||||
|
const scale = scaleLinear().domain([xMin!, xMax!]);
|
||||||
const scale = scaleLinear().domain([xMin!, xMax!]).nice();
|
|
||||||
const bins = histogram()
|
const bins = histogram()
|
||||||
.domain(scale.domain() as any)
|
.domain(scale.domain() as any)
|
||||||
.thresholds(scale.ticks(desiredBars))(allIntervals);
|
.thresholds(scale.ticks(desiredBars))(allIntervals);
|
||||||
|
|
Loading…
Reference in a new issue