mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-29 18:51:43 +02:00
fix(repo-stats): plot ghcr pulls on a linear axis so the trend is visible
The ghcr pulls chart used a symlog y axis with a hardcoded tick list, both copied from github-repo-stats, which builds the rest of the report. Those settings suit views and clones - small, spiky, frequently zero - but not container pulls, which sit in a tight band far above zero. Consequences on the published report: the series (7,946 to 16,160) lives entirely inside the top decade of the log scale, so a 2x swing rendered as a 14px wobble on a 200px chart and read as a flat line. Of the nine fixed ticks, six were squashed against the baseline and 50000 fell outside the domain and never drew, leaving a single usable gridline. Switch to a linear scale, drop the fixed ticks so Vega derives them from the actual domain, and format labels with SI prefixes (5k / 10k / 15k). The zero baseline and the 10% headroom are unchanged, so the axis stays honest; the same swing now spans 92px and the growth from ~9k to ~15k pulls/day is legible.
This commit is contained in:
@@ -181,11 +181,13 @@ def build_vega_spec(series: dict[str, int]) -> dict:
|
||||
"type": "temporal",
|
||||
},
|
||||
"y": {
|
||||
"axis": {"values": [1, 10, 50, 100, 500, 1000, 5000, 10000, 50000]},
|
||||
# Linear, not symlog: pulls sit in a tight band far above zero, so a log-ish
|
||||
# axis squeezes the whole series into its top decade and flattens the line.
|
||||
"axis": {"format": "~s"},
|
||||
"field": "daily_count",
|
||||
"scale": {
|
||||
"domain": [0, y_max * 1.1 if y_max > 0 else 1],
|
||||
"type": "symlog",
|
||||
"type": "linear",
|
||||
"zero": True,
|
||||
},
|
||||
"title": "container pulls per day",
|
||||
|
||||
Reference in New Issue
Block a user