corrections from ninja check

This commit is contained in:
junlu592 2025-12-10 12:52:56 +01:00
parent 8ab9e54a62
commit ce9b087190

View file

@ -134,12 +134,11 @@ export function renderReviews(
const sourceMap = showTime ? sourceData.reviewTime : sourceData.reviewCount; const sourceMap = showTime ? sourceData.reviewTime : sourceData.reviewCount;
// Create bins using the thresholds: each bin contains data points between consecutive thresholds // Create bins using the thresholds: each bin contains data points between consecutive thresholds
let bins = bin() const bins = bin()
.value((m) => m[0]) // Extract the day number from each map entry [day, data] .value((m) => m[0]) // Extract the day number from each map entry [day, data]
.domain(x.domain() as any) // Bins are constrained to this domain [xMin, xMax] .domain(x.domain() as any) // Bins are constrained to this domain [xMin, xMax]
.thresholds(thresholds)(sourceMap.entries() as any); // Use computed thresholds to split data into bins .thresholds(thresholds)(sourceMap.entries() as any); // Use computed thresholds to split data into bins
// empty graph? // empty graph?
const totalDays = sum(bins, (bin) => bin.length); const totalDays = sum(bins, (bin) => bin.length);
if (!totalDays) { if (!totalDays) {