A lightweight macro dashboard for multi-country, long-range comparison (1960–2025), with fast local snapshot loading and automated weekly data checks.
- 4 metric modules: Economy, Demographics, Trade, Fiscal
- 11 economies: CHN, USA, IND, JPN, KOR, TWN, GBR, DEU, RUS, AUS, NZL
- Dual chart modes: line (multi-country) and bar (single country)
- Time range slider: adjustable start/end year
- Right-edge interactions:
- click country label/end-point to toggle that series
- hide tooltip when cursor moves beyond line-end area
- High-resolution chart export:
Download Chart Image - Fast open: prebuilt local snapshot (
gdp-local-data.js) + live fallback pipeline
- GDP per capita (nominal USD)
- GDP per capita (PPP USD)
- GDP total (nominal USD)
- GDP total (PPP USD)
- Disposable income per capita (USD)
- Total population
- Population increment
- Population growth rate
- Aging rate (65+ share)
- Fertility rate
- Imports
- Exports
- Total trade
- Trade balance
- Fiscal revenue
- Fiscal expenditure
- Fiscal deficit
- Military expenditure
- World Bank API
- IMF WEO / DataMapper
- OECD NAAG
- OWID (incl. SIPRI military series)
- UN WPP
- FRED / BEA (US series)
- National official sources used for overrides where needed (e.g., Taiwan DGBAS/CBC, China NBS)
Notes: some latest-year values use official budget/provisional/derived methods when full finalized data are not yet available. Each point has source metadata in the dataset.
No build system is required for viewing.
# from repo root
python3 -m http.server 8000Open: http://127.0.0.1:8000/index.html
This repo includes a GitHub Actions workflow:
- File:
.github/workflows/weekly-data-refresh.yml - Schedule: every Monday
02:00 UTC - Also supports manual trigger (
workflow_dispatch)
Workflow behavior:
- Runs
node scripts/build-local-data.mjs - Checks if
gdp-local-data.jschanged - If changed, bumps
gdp-local-data.js?v=...inindex.html - Commits and pushes to
main - If unchanged, exits without commit
Requires Node.js 20+.
node scripts/build-local-data.mjs
LOCAL_DATA_VERSION=auto-$(date -u +%Y%m%d%H%M) node scripts/bump-local-data-version.mjs.
├── index.html # UI layout and controls
├── gdp-style.css # visual style
├── gdp-script.js # data loading, fallback logic, chart interactions
├── gdp-local-data.js # prebuilt local snapshot for fast load
├── scripts/
│ ├── build-local-data.mjs # generate local snapshot from pipeline
│ └── bump-local-data-version.mjs # update local snapshot asset version in index.html
└── .github/workflows/
└── weekly-data-refresh.yml # scheduled auto update job
- The dashboard is intentionally framework-free (vanilla JS + Chart.js) for portability.
- If Node is unavailable locally, you can still run the dashboard with existing snapshot data.
- Keep
mainas the deployment branch if using the built-in auto-refresh workflow.