← Work

Japan Immigration Dashboard

Japan's immigration statistics, made legible — thirteen charts, twelve languages.

Stack
Next.js 15 · React 19
Language
TypeScript, strict
Data
e-Stat API · GitHub Actions
Locales
12
Licence
MIT
Status
Live · v1.6.5
Year
2025

Japan publishes its immigration figures faithfully and in a form almost nobody can read: government spreadsheets, hundreds of thousands of rows, no way to ask them a question. This turns them into something you can actually look at — two datasets, thirteen charts, one address.

The first dataset is application processing across the Regional Immigration Bureaus: volume, completion rates, and how long an office is actually taking. The second is the resident population — roughly 202 nationalities across 43 residence statuses, in half-yearly snapshots back to December 2012. Both filter by office, category and period, and every filter is in the URL, so a view you have set up is a link you can send someone.

The hard part is upstream of the charts. Official exports arrive with regional totals that already contain their own branch offices, a residence-status hierarchy with the parent relationships wrong or missing, and rollup rows that double-count anything that sums them. A build-time transform deaggregates the branches, repairs the hierarchy, and drops the rollups and the zero rows, taking the resident table from roughly 191,000 rows to about 42,000 — then re-adds what it kept against the official totals and fails the build on any mismatch, so a chart can never look fine and be quietly wrong. A scheduled job probes the e-Stat API daily and only pulls and redeploys when the published survey date actually moves.

It runs in twelve languages, exports what it draws as CSV, and ships a plain data table alongside the charts so the content does not depend on being able to see an SVG.

  • Two datasets — application processing and resident population — filtered independently
  • Thirteen charts: Sankey flows, zoomable treemap, sunburst, ranked lollipop, two choropleths
  • Processing Time Estimator that shows its working in LaTeX and tracks queue position
  • Every filter and chart setting lives in the URL, so any view is a shareable link
  • Daily watcher that probes the official API and only deploys when the data moved
  • Build-time transform that deaggregates, repairs the hierarchy and checks itself against official totals
  • Policy events marked on the timeline, each linked to the government page that dates it
  • Twelve locales, with three width variants per label so names never truncate
  • CSV export and an accessible data table as the text alternative to the charts