fix: install-trend sparkline stops mixing metric scales (cliff artifact) - #143
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 lackedestimatedDailyInstalls(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