Skip to content

Commit c25e67e

Browse files
Tighten downloads chart y-axis to "current + 1k"
`nice_upper_bound` rounded the y-axis cap to 20k for a 10.3k cumulative total, squashing the trend line into the lower third of the card. Cap the axis at `max(current_cumulative + 1000, 1000)` instead so the latest point lands near the top of the chart area and the rise is visually obvious. Co-authored-by: Open Codex <hff582580@gmail.com>
1 parent 7e9e27e commit c25e67e

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

.github/npm-total-downloads.svg

Lines changed: 7 additions & 7 deletions
Loading

.github/scripts/update_npm_download_chart.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ def generate_svg(package_name, cumulative_rows):
202202
chart_h = chart_bottom - chart_top
203203

204204
max_downloads = max([downloads for _, downloads in cumulative_rows] or [0])
205-
upper = nice_upper_bound(max_downloads)
205+
# Cap the y-axis at "current cumulative + 1k" so the latest point sits
206+
# near the top of the trend area instead of getting squashed when
207+
# `nice_upper_bound` jumps to the next 2× / 5× / 10× tier.
208+
upper = max(max_downloads + 1000, 1000)
206209

207210
def x_for(index):
208211
if len(cumulative_rows) <= 1:

0 commit comments

Comments
 (0)