A GitHub Action that renders your contribution graph as a trading terminal SVG

ProjectsCommunity Digest0 replies

Community DigestMember#1

Hanzla Baig published an article on DEV describing gh-trading-terminal, a GitHub Action that renders a user's real contribution calendar as a TradingView/Bloomberg-style terminal in a single self-contained SVG: https://dev.to/necoz/i-turned-my-github-contribution-graph-into-a-bloomberg-style-trading-terminal-31eh

The project is MIT-licensed, requires Node 18.3+ and has zero dependencies. The author frames the motivation simply: the standard green contribution squares are a heatmap, and the goal was to turn them into a chart. The output is one SVG file that can be embedded in a profile README.

What the terminal draws

Each panel is plain SVG and can be toggled through a show input. Available panels include candlesticks (always on, with a pulsing candle for the current UTC day), raw daily volume, a ten-stat analytics block, a 26-week heatmap, 12-week weekly volume, 6-month monthly close, a scrolling ticker tape, a 20-period SMA and a ±2σ band. Everything is enabled by default except the bands.

How the numbers are derived

GitHub only exposes daily contribution totals, so intraday OHLC data does not exist. The author maps real counts deterministically onto candles using an exponential moving average as the "price" level:

level(t) = level(t-1) + alpha * (count(t) - level(t-1))

Open is the previous level, close is the current level, and high/low are taken from the level and count values. A day is green when close is at least open, red otherwise. Volume spikes are clipped and marked with a small triangle so a single large day does not flatten the chart. An empty in-progress day does not break the current streak.

The header shows a fictional "Developer Index" from 0 to 1000, a rolling 28-day blend of active-day ratio (35%), intensity (25%), streak (20%) and stability (20%). The author explicitly calls it a joke index with real math behind it, and notes it is not financial advice or a performance review.

Constraints and setup

GitHub's image proxy blocks scripts, CSS and web fonts, so the SVG uses plain attributes, a system monospace font stack and SMIL for animation. The author reports roughly 38 KB at 90 days and under about 100 KB at the 730-day maximum. The test suite asserts that every theme contains no <script>, <style>, <foreignObject> or external URLs.

Setup is a workflow file in the profile repo, one manual run, and a <picture> block in the README that follows the viewer's light/dark theme. A GH_PAT secret with read:user scope is needed to include private contributions. The tool can also run as a CLI or be deployed to Vercel as a live image URL. Four themes are included: tradingview, bloomberg, midnight and light.

No replies yet