equal-buckets-or-no-buckets
Installation
SKILL.md
Equal buckets, or no buckets
A range chart has two independent decisions: how wide each bucket is, and how many of them there are. Getting the second wrong makes a chart nobody reads; getting the first wrong makes a chart that is actively wrong, because bar length encodes a count and a wider bucket collects more counts.
// adapted: four buckets of exactly seven days, newest first, remainder deliberately outside
DayRange.LAST_30_DAYS ->
(0 until 4).map { week ->
Bucket.Week(
start = endDate.minus(DatePeriod(days = week * 7 + 6)),
end = endDate.minus(DatePeriod(days = week * 7)),
)
}
Four × 7 covers 28 of the nominal 30 days. That is the point: the alternative — four-and-a-bit buckets covering all thirty — gives one bucket 9 days and three of them 7.