documentation

Delivery, theming, per-component options, and adding a component.

Getting started

Two ways to serve a tile. Pick by whether anyone other than you needs to request it.

Static, from a CDN

Recommended. A scheduled Action renders the tiles, commits them to a tiles branch, and a CDN serves them as static files. No server, no quota, nothing that can be switched off.

<img src="https://cdn.jsdelivr.net/gh/AbdulSadath77/gitmatrix@tiles/activity.svg" width="100%" />

Rendered on demand

Only needed when you want ?username=anyone resolved at request time. Deploy the repo to any Node host; no environment variables are required.

<img src="https://YOUR-APP.vercel.app/api/activity?username=AbdulSadath77" width="100%" />

Where the data comes from

Tiles sharing a source share one fetch, so adding tiles costs no extra requests — 2 sources for every tile listed here. Each run starts from the tiles already published and overwrites only what it could fetch, so a profile tile that loses the rate-limit lottery keeps its last good render instead of disappearing.

Theming

Every token is independently overridable, so a preset is a starting point rather than a fixed look.

presetforeground / background
matrix#00FF41 on #0D1117
amber#FFB000 on #0D0B06
ice#7DF9FF on #06101A
dracula#BD93F9 on #282A36
nord#88C0D0 on #2E3440
rose#FF5C8A on #17090F
mono#E6EDF3 on #0D1117

Per-token overrides

paramcontrols
colorlines, headings, gridlines
bgbackground
areaarea fill
borderframe stroke, defaults to color
mutedaxis and footer text, defaults to color
?theme=nord&color=00FF41&area=003311

Colours are 3, 4, 6 or 8 hex digits, with or without #. Anything else falls back to the theme value, so a malformed colour can never reach the output.

Resolution and smoothing

Grouping matters more than smoothing.

A year at daily resolution is about 370 points. On an 800px chart that is roughly 2px per point, and no amount of smoothing is visible — the curve renders as a picket fence. group=week gives ~53 points and group=month ~13, which is where a curve reads as a curve. Weekly is the default.

Grouping changes resolution only: the total is preserved exactly, and the test suite asserts that across all three modes.

Smoothing

The curve is a monotone cubic Hermite spline, not Catmull-Rom. Catmull-Rom costs the same to write but overshoots around local extrema, which on contribution data means the curve dips below zero after a spike and the area fill paints under the baseline. Measured on a spike series bounded to [10, 100]:

methodrendered y range
monotone cubic[10.00, 100.00] — bounded
Catmull-Rom[10.00, 106.65] — 6.65px past the baseline

The suite samples the emitted Bézier curves and asserts the path stays inside the data range at every smoothing level.

Components

Every tile also accepts theme, title, border, radius and width. Out-of-range values clamp to the nearest bound; unparseable values fall back to the default, so a bad query degrades to a working tile rather than an error.

activity

Daily, weekly or monthly contributions as a smooth area + line chart

Endpoint

/api/activity?username=AbdulSadath77

Static file

https://cdn.jsdelivr.net/gh/AbdulSadath77/gitmatrix@tiles/activity.svg

Options

optionaccepts
widthpx, 320-1600 (default 800)
heightpx, 160-800 (default 320)
groupday | week | month — bucket resolution (default week)
smoothing0-1, 0 = straight segments, 1 = full curve (default 1)
daystrim to the most recent N days, 7-366 (default all)
pointsshow a dot per data point (default false)
gridshow horizontal reference lines (default true)
dotsradius of point markers, 1-5 (default 2)
filldraw the area under the line (default true)
borderdraw the outer frame (default true)
radiuscorner radius, 0-24 (default 6)
titleheading text, up to 80 chars

calendar

The contribution grid, one column per week

Endpoint

/api/calendar?username=AbdulSadath77

Static file

https://cdn.jsdelivr.net/gh/AbdulSadath77/gitmatrix@tiles/calendar.svg

Options

optionaccepts
cellpx square size, 6-20 (default 11)
gappx between cells, 1-6 (default 3)
levelsshade steps, 3-6 (default 5)
labelsshow month and weekday labels (default true)
borderdraw the outer frame (default true)
radiuscorner radius, 0-24 (default 6)
titleheading text, up to 80 chars

streak

Total contributions, current streak and longest streak

Endpoint

/api/streak?username=AbdulSadath77

Static file

https://cdn.jsdelivr.net/gh/AbdulSadath77/gitmatrix@tiles/streak.svg

Options

optionaccepts
widthpx, 320-1600 (default 760)
heightpx, 160-800 (default 240)
borderdraw the outer frame (default true)
radiuscorner radius, 0-24 (default 6)
titleheading text, up to 80 chars

languages

Language split across public repositories, as a stacked bar

Endpoint

/api/languages?username=AbdulSadath77

Static file

https://cdn.jsdelivr.net/gh/AbdulSadath77/gitmatrix@tiles/languages.svg

Options

optionaccepts
widthpx, 320-1600 (default 460)
tophow many languages to list, 3-12 (default 6)
forksinclude forked repos (default false)
borderdraw the outer frame (default true)
radiuscorner radius, 0-24 (default 6)
titleheading text, up to 80 chars

stats

Repositories, stars, forks, followers and account age

Endpoint

/api/stats?username=AbdulSadath77

Static file

https://cdn.jsdelivr.net/gh/AbdulSadath77/gitmatrix@tiles/stats.svg

Options

optionaccepts
widthpx, 320-1600 (default 460)
forkscount forked repos as your own (default false)
borderdraw the outer frame (default true)
radiuscorner radius, 0-24 (default 6)
titleheading text, up to 80 chars

Adding a component

Three steps. No routing changes — the API route, the static build and both pages of this site all read the registry.

1. A data source, if nothing else provides it

// lib/github.js
export const FETCHERS = {
  async mySource(login, token) { /* ... */ },
};

2. The tile

// lib/tiles/mytile.js
export const options = { width: 'px, 320-1600 (default 800)' };

export function render(data, theme, q) {
  return tile({ /* ... */ });
}

render must be pure — data in, string out, no IO. That is what lets the suite test every component without a token or a network.

3. The registry

// lib/tiles/index.js
export const TILES = {
  mytile: {
    slug: 'mytile',
    summary: 'What it shows',
    data: 'mySource',
    options: mytile.options,
    render: mytile.render,
  },
};

The suite then checks it automatically: the slug matches its key, render is a function, the declared data source has a fetcher, options are documented, and the tile renders across all 7 themes, on empty data, and with an injected title.