Find your next open-source project

Search by name, purpose, or keyword, or paste a GitHub URL. Start with / to search agent skills (e.g. /pdf)

threeaus/chinaciv

Media & Design

Turns real Chinese geography and statistics into a hex-grid Civilization-style map for personal exploration and learning.

103
21
JavaScript
MIT
5 days old
+15 stars in 24h

What it is

chinaciv is a visualization project rather than a playable game: it renders China as a turn-based 4X-style hex map inspired by Civilization. The 25 km hex grid is built from ETOPO1 elevation and MODIS land cover, and 344 city banners carry population and output figures drawn from official statistics. Railways, expressways, airports, ports, power plants, mines, oil and gas fields, and designated wonders are placed on the map. Each figure can be traced through the in-app Almanac → Data Sources page. The project is a Chinese-localized fork of Andrej Karpathy's usaciv.

The map renders province boundaries, includes the South China Sea inset, labels Taiwan, Hong Kong, Macau, Hainan, and the relevant border regions, and offers a city panel with population, GDP, three-sector breakdown, transport, wonders, and peer comparisons. This first phase deliberately omits the "science" and "culture" yields because no national dataset covers at least 75% of cities.

Quick start

The quickest path uses the pre-generated data in web/data/ (about 3 MB). Install uv, then from the repository root run:

uv run python -m pipeline serve        # http://127.0.0.1:8765

Open http://127.0.0.1:8765, and use / to search cities and provinces or ? for keyboard shortcuts. To regenerate the data from the original publishers:

uv run python -m pipeline all
uv run python -m unittest discover -s tests

The first full pipeline run downloads roughly 600 MB into data/raw/ and reuses the cache afterward. Use --offline to work only from cached downloads. The project also exposes fetch, process, build, check, and package subcommands for step-by-step runs.

Constraints

  • The pipeline needs uv and Python 3.11+, with no other dependencies; the generated site itself is static and uses native ES modules plus Canvas 2D.
  • The first pipeline run needs network access and about 600 MB of disk; on macOS, one Overpass mirror may require pointing SSL_CERT_FILE at the system root certificate.
  • Every statistic is for 2023. Where a city lacks a 2023 figure, the field stays blank rather than being substituted with another year; some banners show 2020 census population in darker text.
  • Hong Kong and Macau GDP are converted to RMB; Taiwan GDP is not available in this version, so it is left blank rather than zero. Taiwan, Hong Kong, and Macau airports and ports are not yet included.
  • Positions are schematic: each hex is about 1,600 km², ports are placed at the county seat of the main port area, and rail and road lines are generalized.
  • The map is for personal study only and has no map approval number (审图号); it must not be used as an officially published map. Borders and the dashed line follow DataV.GeoAtlas data based on standard maps.
  • Code is MIT-licensed (original usaciv also MIT), but the datasets keep their own terms, including OSM ODbL 1.0 attribution and GEM CC BY 4.0; reuse must preserve those attributions.

HotRepo's take

The repository entered the new-project list on 2026-11-29 with 103 stars and 21 forks, adding 3 stars in a roughly one-hour growth window; there is no recorded all-language daily rank yet, so the data supports only that single snapshot and not a trend claim. What stands out technically is the data discipline: a same-year, same-definition yield rule, explicit blank values, published inclusion rules for resources and wonders, and a check step that validates the data contracts. Readers should treat it as a cartographic visualization to study and fork, not as a strategy game.

Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.