Skip to content

fix: install-trend sparkline stops mixing metric scales (cliff artifact) - #143

Merged
msitarzewski merged 1 commit into
mainfrom
fix/install-trend-scale
Jul 12, 2026
Merged

msitarzewski merged 1 commit into
mainfrom
fix/install-trend-scale

Conversation

@msitarzewski

Copy link
Copy Markdown
Owner

Every package's Install trend sparkline showed the same cliff-then-flat shape. The chart fell back to count30d (a cumulative 30-day total, 100k–2M) when a point lacked estimatedDailyInstalls (per-day, tens–thousands) — the early "seed" points. Mixing the two scales pinned the first point to the top of the auto-scaled axis and flattened the real trend.

Plot only points with estimatedDailyInstalls (single consistent scale); seed points drop out. Both shells. Verified on live data: dominating first value 323,888→115 (wget), 1.2M→10k (git), 2.1M→12k (node).

🤖 Generated with Claude Code

https://claude.ai/code/session_01X9iMFjHE21ePTjcbHpTXt6

Every package's "Install trend" chart showed the same cliff-then-flat
silhouette. Cause: the sparkline fell back to `count30d` when a point had
no `estimatedDailyInstalls`. The first ~4 "seed"/bootstrap points of every
series carry only `count30d` — a cumulative 30-day total in the hundreds
of thousands to millions — while the rest carry a per-day estimate (tens
to low thousands). Mixing the two put a ~100–1000× larger value at the
left edge; the auto-scaled y-axis pinned it to the top and squashed the
real daily trend into a baseline line.

Plot only points that have `estimatedDailyInstalls` — a single consistent
scale — so the seed points drop out and the real daily trend shows. Both
shells (native `sparkValues`; Tauri filters the series before charting and
its length guard now counts daily points). Tauri's now-moot "Bootstrap +
daily snapshots" caption is simplified to "Daily install snapshots".

Verified on live data: the dominating first value drops from 323,888→115
(wget), 1.2M→10k (git), 2.1M→12k (node) — the series now spans its real
daily range with no cliff.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01X9iMFjHE21ePTjcbHpTXt6
@msitarzewski
msitarzewski merged commit eae4ffe into main Jul 12, 2026
@msitarzewski
msitarzewski deleted the fix/install-trend-scale branch July 12, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant