Skip to content

Commit 835219d

Browse files
committed
feat: add detailed documentation for /graph query parameters and available options
1 parent d19e7aa commit 835219d

1 file changed

Lines changed: 93 additions & 0 deletions

File tree

docs/graph-params.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# `/graph` Query Parameters
2+
3+
## Required
4+
5+
| Param | Type | Description |
6+
|---|---|---|
7+
| `username` | `string` | GitHub username to fetch contribution data for |
8+
9+
---
10+
11+
## Optional
12+
13+
### Appearance
14+
15+
| Param | Type | Default | Description |
16+
|---|---|---|---|
17+
| `theme` | `string` | `default` | Named color theme. See [Graph Themes](#graph-themes). |
18+
| `bgColor` | `hex string` | *(from theme)* | Override background color |
19+
| `borderColor` | `hex string` | *(from theme)* | Override border/line color |
20+
| `textColor` | `hex string` | *(from theme)* | Override text color |
21+
| `titleColor` | `hex string` | *(from theme)* | Override title color |
22+
23+
### Layout
24+
25+
| Param | Type | Default | Description |
26+
|---|---|---|---|
27+
| `size` | `small` \| `medium` \| `default` \| `large` | `default` | Canvas size preset |
28+
| `show_title` | `boolean` | `true` | Show/hide the username + year heading. When `false`, remaining content is vertically centered. |
29+
| `show_total_contribution` | `boolean` | `true` | Show/hide the total contributions subtitle. When `false`, SVG height shrinks to fit. |
30+
| `show_background` | `boolean` | `true` | Show/hide the background gradient, stars, and grid lines. When `false`, background is transparent and SVG width shrinks to fit only the cells (+ 10 px margin). |
31+
32+
### Data
33+
34+
| Param | Type | Default | Description |
35+
|---|---|---|---|
36+
| `year` | `number` | *(last 365 days)* | 4-digit year to fetch contributions for |
37+
38+
### Animation
39+
40+
| Param | Type | Default | Description |
41+
|---|---|---|---|
42+
| `animate` | `glow` \| `wave` \| `pulse` \| `none` | `glow` | Cell animation mode |
43+
44+
---
45+
46+
## Size Presets
47+
48+
| Value | Canvas | Cell size |
49+
|---|---|---|
50+
| `small` | 800 × 400 | 9 px |
51+
| `medium` | 1000 × 500 | 12 px |
52+
| `default` | 1200 × 600 | 14 px |
53+
| `large` | 1400 × 700 | 16 px |
54+
55+
---
56+
57+
## Animate Modes
58+
59+
| Value | Description |
60+
|---|---|
61+
| `glow` | Active cells pulse with a soft glow *(default)* |
62+
| `wave` | Cells ripple in a wave pattern across columns |
63+
| `pulse` | ~16 random cells flash independently |
64+
| `none` | No animation — static render |
65+
66+
---
67+
68+
## Graph Themes
69+
70+
| Key | Description |
71+
|---|---|
72+
| `aurora` | 🌌 Purple-green aurora on near-black |
73+
| `matrix` | 💚 Bright green on black |
74+
| `inferno` | 🔥 Orange-red flame gradient |
75+
| `ocean` | 🌊 Cyan-blue ocean tones |
76+
| `neon` | 💜 Hot pink / violet neon |
77+
| `solar` | ☀️ Amber-yellow solar flare |
78+
| `galaxy` | 🌠 Deep blue starfield |
79+
| `github-dark` | 🐙 GitHub dark heatmap palette |
80+
81+
---
82+
83+
## Example URLs
84+
85+
```
86+
/graph?username=pphatdev
87+
/graph?username=pphatdev&year=2024
88+
/graph?username=pphatdev&theme=aurora&animate=wave
89+
/graph?username=pphatdev&theme=matrix&animate=pulse&size=large
90+
/graph?username=pphatdev&show_title=false&show_total_contribution=false
91+
/graph?username=pphatdev&show_background=false
92+
/graph?username=pphatdev&theme=ocean&size=small&animate=wave
93+
```

0 commit comments

Comments
 (0)