Skip to content

Commit 056cf46

Browse files
Give the downloads chart most of the card's vertical real estate
The hero stat sat above the chart, pinning the chart area into the middle-lower band (y=360..760 of a 900-tall card). Even with the y axis tightened to "current + 1k" the dot landed at cy≈395, ~44% from the top of the card — visually the line "only reached the middle". Restack the card so the chart owns the upper two thirds: 0..130 header (title + "cumulative · N weeks") 130..730 chart area (600 tall — was 400) 730..780 date labels at start / middle / end 790..880 hero stat ("10.3k" + delta) moved below the chart 890 "through {date}" footer The latest dot now lands at cy≈183 (~20% from the top of the card), so the rising line visually reaches the top of the card the way a growth metric should. Co-authored-by: Open Codex <hff582580@gmail.com>
1 parent c25e67e commit 056cf46

2 files changed

Lines changed: 38 additions & 29 deletions

File tree

.github/npm-total-downloads.svg

Lines changed: 21 additions & 21 deletions
Loading

.github/scripts/update_npm_download_chart.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,20 @@ def generate_svg(package_name, cumulative_rows):
193193
# README 8:2 row. The banner is ~16:9 at 760 wide → ~427 tall on render;
194194
# this card's SVG is 400×900 so at the README's 190 display width it
195195
# comes out ~427 tall and lines up with the banner edge.
196+
#
197+
# Layout (chart given most of the vertical real estate so the trend
198+
# line visually reaches the top of the card, not just the top of a
199+
# tiny middle band):
200+
# 0..130 header (title + subtitle)
201+
# 130..730 chart area (600 tall)
202+
# 730..780 date labels
203+
# 790..870 hero stat ("10.3k" + delta)
204+
# 870..900 footer (through {date})
196205
width = 400
197206
height = 900
198207
pad = 32
199-
chart_top = 360
200-
chart_bottom = 760
208+
chart_top = 130
209+
chart_bottom = 730
201210
chart_w = width - 2 * pad
202211
chart_h = chart_bottom - chart_top
203212

@@ -297,17 +306,17 @@ def y_for(value):
297306
<rect width="{width}" height="{height}" rx="22" fill="#0b1020" />
298307
<rect x="1" y="1" width="{inner_w}" height="{inner_h}" rx="21" fill="none" stroke="#26324a" />
299308
<g font-family="Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif">
300-
<text x="{cx}" y="80" font-size="32" font-weight="700" fill="#f8fafc" text-anchor="middle">npm downloads</text>
301-
<text x="{cx}" y="118" font-size="22" fill="#8b9ab8" text-anchor="middle">cumulative · {weeks} weeks</text>
302-
<text x="{cx}" y="240" font-size="96" font-weight="800" fill="#f8fafc" text-anchor="middle">{latest_fmt}</text>
303-
<text x="{cx}" y="290" font-size="24" fill="#22d3ee" text-anchor="middle">+{delta_fmt} since {first_fmt}</text>
309+
<text x="{cx}" y="60" font-size="32" font-weight="700" fill="#f8fafc" text-anchor="middle">npm downloads</text>
310+
<text x="{cx}" y="98" font-size="22" fill="#8b9ab8" text-anchor="middle">cumulative · {weeks} weeks</text>
304311
{grid}
305312
<line x1="{pad}" y1="{baseline:.1f}" x2="{right}" y2="{baseline:.1f}" stroke="#3a4867" stroke-width="1.4" />
306313
<path d="{area_path} L {last_x:.1f} {baseline:.1f} L {first_x:.1f} {baseline:.1f} Z" fill="url(#fill)" />
307314
<path d="{path}" fill="none" stroke="url(#line)" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" />
308315
{dots}
309316
{labels}
310-
<text x="{cx}" y="{footer_y}" font-size="22" fill="#5d6b88" text-anchor="middle">through {through}</text>
317+
<text x="{cx}" y="830" font-size="56" font-weight="800" fill="#f8fafc" text-anchor="middle">{latest_fmt}</text>
318+
<text x="{cx}" y="862" font-size="20" fill="#22d3ee" text-anchor="middle">+{delta_fmt} since {first_fmt}</text>
319+
<text x="{cx}" y="{footer_y}" font-size="16" fill="#5d6b88" text-anchor="middle">through {through}</text>
311320
</g>
312321
</svg>
313322
""".format(
@@ -326,7 +335,7 @@ def y_for(value):
326335
cx=width / 2.0,
327336
baseline=chart_bottom,
328337
right=width - pad,
329-
footer_y=height - 32,
338+
footer_y=890,
330339
grid="\n ".join(grid_lines),
331340
path=path,
332341
area_path=path,

0 commit comments

Comments
 (0)