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:
Henrik Giesel 2021-01-08 00:09:12 +01:00
parent 97e3bfe1c0
commit e89996bc27

View File

@ -84,13 +84,12 @@ export function prepareIntervalData(
case IntervalRange.All:
break;
}
const xMin = 0;
const xMin = 1;
xMax = xMax! + 1;
// cap bars to available range
const desiredBars = Math.min(70, xMax! - xMin!);
const scale = scaleLinear().domain([xMin!, xMax!]).nice();
const scale = scaleLinear().domain([xMin!, xMax!]);
const bins = histogram()
.domain(scale.domain() as any)
.thresholds(scale.ticks(desiredBars))(allIntervals);