From d1034e688367a657b3cf26e989aa92f83cc526f3 Mon Sep 17 00:00:00 2001 From: Tien Nguyen Minh Date: Sun, 19 Apr 2026 10:13:07 +0700 Subject: [PATCH] feat(card): show top 7 languages on donut cards instead of top 5 (#14) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Legend at x=20-155 fits 7 rows (y=55 to y=175); donut at cx=250, cy=110 is unaffected. Update the design-guidelines table to match. Stress test still passes — the legend column never leaves its left-side gutter. --- docs/design-guidelines.md | 2 +- internal/card/donut_chart.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/design-guidelines.md b/docs/design-guidelines.md index 89f1da8e..67acd95d 100644 --- a/docs/design-guidelines.md +++ b/docs/design-guidelines.md @@ -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 | 5 (overflow collapses into "Other") | +| Top-N entries shown | 7 (overflow collapses into "Other") | | Slice stroke | `theme.Background`, 1.5 px (gap between slices) | | Legend origin | `(20, 55)` | | Legend row height | 20 px | diff --git a/internal/card/donut_chart.go b/internal/card/donut_chart.go index 0c2aaa9d..3aad4365 100644 --- a/internal/card/donut_chart.go +++ b/internal/card/donut_chart.go @@ -16,7 +16,7 @@ func renderDonutCard(title string, stats []github.LangStat, t theme.Theme) []byt const ( width = 340 height = 200 - topN = 5 + topN = 7 cx = 250 // donut centre x cy = 110 // donut centre y outerR = 55.0 // donut outer radius