Fix '366 of 365 days studied' (#3182)

* Fix '366 of 365 days studied'

* Apply nicing when GraphRange.AllTime is selected
This commit is contained in:
Abdo 2024-05-06 16:50:27 +03:00 committed by GitHub
parent df004b0b0c
commit 50772eeece
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,8 +110,10 @@ export function renderReviews(
}
const desiredBars = Math.min(70, Math.abs(xMin!));
const x = scaleLinear().domain([xMin!, xMax]).nice(desiredBars);
x.domain([x.domain()[0], xMax]);
const x = scaleLinear().domain([xMin!, xMax]);
if (range === GraphRange.AllTime) {
x.nice(desiredBars);
}
const sourceMap = showTime ? sourceData.reviewTime : sourceData.reviewCount;
const bins = bin()