mirror of
https://github.com/tiennm99/ghstats.git
synced 2026-05-19 21:25:21 +00:00
docs: resync remaining stale references after S-tier + demo changes (#5)
- deployment-guide.md: embed example now lists all 14 cards (was 9). - codebase-summary.md: FetchProductive row includes Weekday / WeekdayAllTime; shared helpers list adds renderWeekday, renderHeatmap, mixHex/parseHex. - system-architecture.md: per-commit fetch diagram shows the weekday bucket alongside the hour bucket.
This commit is contained in:
@@ -59,7 +59,7 @@ All network I/O. Exposes a `*Client` with three fetchers; every call takes a `co
|
||||
| --- | --- | --- |
|
||||
| `FetchProfile(ctx, login, opts)` | username, visibility flags | Profile basics, totals, owned-repos aggregation, last-year daily calendar, `TopRepos` |
|
||||
| `FetchContributionsAllTime(ctx, p, opts)` | Profile | `SeedRepos`, `DailyContributionsAllTime`, `TotalCommitsAllTime` |
|
||||
| `FetchProductive(ctx, p, repos, loc, cap)` | Profile + seed + tz + cap | `Productive`, `CommitsByLanguage`, `ProductiveAllTime`, `CommitsByLanguageAllTime` |
|
||||
| `FetchProductive(ctx, p, repos, loc, cap)` | Profile + seed + tz + cap | `Productive`, `Weekday`, `CommitsByLanguage`, `ProductiveAllTime`, `WeekdayAllTime`, `CommitsByLanguageAllTime` |
|
||||
|
||||
Call order in `main.go`: Profile → AllTime → Productive. `Client.query` handles GitHub rate limits transparently — on 429 or 403 with `X-RateLimit-Remaining: 0`, it honors `Retry-After` / `X-RateLimit-Reset` (capped at 5 minutes) and retries once.
|
||||
|
||||
@@ -78,8 +78,11 @@ type Card interface {
|
||||
|
||||
Shared helpers:
|
||||
- `renderDonutCard` — language donut + legend (used by 3 language cards)
|
||||
- `renderProductiveTime` — 24h bar chart (used by both productive cards)
|
||||
- `renderProductiveTime` — 24h bar chart (used by both productive-time cards)
|
||||
- `renderWeekday` — 7-bar day-of-week chart (used by both productive-weekday cards)
|
||||
- `renderContributions` — smooth area chart (used by both contributions cards)
|
||||
- `renderHeatmap` — 7×N calendar grid with `mixHex`-derived intensity ramp
|
||||
- `mixHex` / `parseHex` — `#rrggbb` blending (used by heatmap, by-year, weekday for peak-vs-dim bars)
|
||||
- `header`, `footer` — SVG chrome
|
||||
- `niceTicks`, `formatTick` — axis math
|
||||
|
||||
|
||||
@@ -56,10 +56,16 @@ Create one at <https://github.com/settings/tokens> → "Generate new token (clas
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
```
|
||||
|
||||
The Action commits SVGs to `output/<theme>/` on the default branch. GitHub serves them from the raw URL the README references.
|
||||
|
||||
@@ -46,9 +46,11 @@ FetchContributionsAllTime(ctx, profile, opts)
|
||||
FetchProductive(ctx, profile, profile.SeedRepos, loc, commitsPerRepo)
|
||||
│ commitHistoryQuery × (#seeds × pages)
|
||||
│ per commit: t = committedDate in loc
|
||||
│ ProductiveAllTime[t.Hour]++ + language votes
|
||||
│ if t.After(yearAgo): Productive[t.Hour]++ + language votes
|
||||
│ yields: Productive, ProductiveAllTime,
|
||||
│ ProductiveAllTime[t.Hour]++
|
||||
│ WeekdayAllTime[t.Weekday]++ + language votes
|
||||
│ if t.After(yearAgo): Productive[t.Hour]++
|
||||
│ Weekday[t.Weekday]++ + language votes
|
||||
│ yields: Productive, Weekday, ProductiveAllTime, WeekdayAllTime,
|
||||
│ CommitsByLanguage, CommitsByLanguageAllTime
|
||||
│
|
||||
▼
|
||||
|
||||
Reference in New Issue
Block a user