mirror of
https://github.com/tiennm99/ghglance.git
synced 2026-10-17 04:15:06 +00:00
fix(card): donut legend caps at 7 rows (Other inclusive); add heatmap gutter (#20)
Two follow-ups: 1. "Top 7 languages" counts rows the reader sees, not "7 named + Other". Revert collapseOther to the original semantic: when the input has more than n entries, keep in[:n-1] named and fold the tail into a single "Other" row — 7 rows total with topN=7. Input with ≤7 real languages still passes through unchanged. Test and adversarial-profile updated to pin the cap (6 named + Other, Shell/Kotlin/Java collapse). 2. Contributions heatmap grid was touching the card right edge (leftPad 22 + 53*6 = 340 exactly). Shrink cells from 5×5 to 4×4 and bump leftPad to 30, giving 45 px of right gutter. Grid no longer reads as bleeding into the frame border; weekday label column also gets a few more pixels of breathing room on the left.
This commit is contained in:
1 parent
083be8d01c
commit
1e58d4c13a
4 files changed
+22
-24
No files matched your search
@@ -50,7 +50,7 @@ Cap rows at what fits: up to 7 rows per card. Stats splits commits into lifetime
|
||||
| Donut centre | `(250, 110)` |
|
||||
| Outer radius | 55 |
|
||||
| Inner radius | 30 |
|
||||
| Top-N entries shown | Up to 7 named languages, plus an "Other" row when the tail is non-zero (8 rows max) |
|
||||
| Top-N entries shown | 7 rows max, "Other" inclusive (6 named + "Other" when there's a tail, up to 7 named when there isn't) |
|
||||
| Slice stroke | `theme.Background`, 1.5 px (gap between slices) |
|
||||
| Legend origin | `(20, 55)` |
|
||||
| Legend row height | 20 px |
|
||||
@@ -78,7 +78,7 @@ When there's **exactly one slice** (one language at 100%), the renderer emits tw
|
||||
| Metric | Value |
|
||||
| --- | --- |
|
||||
| Grid | 7 rows × 53 columns (Sunday → Saturday, oldest week → newest) |
|
||||
| Cell size | 5 × 5 px, 1 px gap (exact fit: `leftPad(22) + 53 × 6 = 340`) |
|
||||
| Cell size | 4 × 4 px, 1 px gap. Grid footprint = `53 × 5 = 265 px`; `leftPad(30) + 265 = 295 px`, leaving a 45 px right gutter so the grid doesn't bleed into the frame border |
|
||||
| Cell colour | 5-bucket ramp `mixHex(Background, Accent, k/4)` for `k ∈ 0..4` — no dedicated ramp field on the theme schema |
|
||||
| Weekday labels | Mon / Wed / Fri only, right-anchored in the `leftPad` gutter |
|
||||
| Month labels | Printed above the first week where a 1st-of-month day falls; skipped when `x > width − 20` so `Dec` / `Apr` can't spill past the frame |
|
||||
|
||||
Reference in new issue
Block a user