From 573dce2ed0a85165970060b034c9bc3ec2317ba9 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 27 May 2026 21:41:26 +0300 Subject: showcase: extend rank history to 32 weeks, trim leading empty columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the graph was fixed at 5 weekly data points. Now: - rankHistoryPoints raised from 5 → 32 so the store accumulates up to 32 weekly snapshots and each project carries 32 history entries. - GenerateRankHistorySVG trims all leading all-zero columns before layout, so the graph only spans from the oldest week that any project actually has data — no empty space on the left when history is short. - displayPoints (trimmed width) drives all layout math: xPos(), xLabels, and the X-axis loop; numPoints is only used for the reversal placement. - xLabelStep() thins X-axis text labels when many columns are visible (step 1 for ≤6, 2 for ≤12, 4 for ≤24, 8 for >24 columns) while still drawing a grid line at every column and always labelling 'now'. - Test: give alpha a Spot at '4w' so trimming keeps that column and the time-axis label test still finds '4w ago' in the output. - New TestXLabelStep_ReturnsSensibleSteps covers the new helper. Co-Authored-By: Claude Sonnet 4.6 --- internal/showcase/rank_history.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/showcase/rank_history.go') diff --git a/internal/showcase/rank_history.go b/internal/showcase/rank_history.go index 559237f..ba8594d 100644 --- a/internal/showcase/rank_history.go +++ b/internal/showcase/rank_history.go @@ -11,7 +11,7 @@ import ( const ( rankHistoryFilename = ".gitsyncer-showcase-rank-history.json" - rankHistoryPoints = 5 + rankHistoryPoints = 32 // up to 32 weekly snapshots kept in history rankHistoryVersion = 1 ) -- cgit v1.2.3