jiangshan-map README

The project's README from github.com/DeanChensj/jiangshan-map. As one markdown file: README.md.

Chronicles of the Realm · 江山时序

English · 简体中文 (Chinese) · 繁體中文 (Traditional Chinese) · 日本語 (Japanese)

An Interactive Historical Atlas of China from the Warring States (403 BCE) to the Present — Scrub Through Time, Trace Ancient Cities, and Walk in the Footsteps of History

Play Live Demo (English UI) → https://deanchen.me/jiangshan-map/?lang=en

The story behind it (in Chinese): From textbook maps to 1k GitHub stars

GitHub Trending · Repository of the Day #1

Chronicles of the Realm — 15s Interactive Overview (Warring States Unification, 2,400-Year Dynastic Scrubbing, Chang'an Place Genealogy & Su Shi's Exile Route)


Why It's Fun to Explore

Have you ever wondered while reading Chinese history or classical poetry:

Chronicles of the Realm (jiangshan-map) brings together 2,400+ years of Chinese history across 18 historical periods into a single interactive parchment atlas—featuring 200+ multi-stage territorial and prefecture snapshots, ancient cities, strategic mountain passes, poetic and battlefield landmarks, chronological milestones, and reigning monarchs & imperial eras. No heavy print atlases required—just drag the timeline and click any city to travel through space and time.


Feature 1: Scrub the Timeline to Watch Realms Rise & Fall, Track Monarchs, and Compare Ancient & Modern Borders

Try It Live: Ming Dynasty Yongle 13 (1415 CE) · Two Capitals, Thirteen Provinces & "Yingtian Fu" Inspection →

Ming Dynasty 1415 CE · Yingtian Fu Hover Preview


Feature 2: Click Any Ancient City or Strategic Pass to Uncover 2,400 Years of History (Trace Place)

Click any ancient city or mountain pass on the map (or double-click anywhere on the canvas) to open its Trace Place genealogy card:

Try It Live: High Tang Kaiyuan 29 (741 CE) · Open Chang'an's 2,400-Year Genealogy Card →

High Tang 741 CE · Chang'an Trace Place & Key Events


Feature 3: Person Chronicles — Trace Any Historical Figure Across Time & Space

Click the top-left Universal Search Box (with a rotatable e.g. figure preview and quick-search chips, or type any monarch, general, statesman, monk, or poet such as Cao Cao, Huo Qubing, Sima Qian, Yue Fei, or Zheng He) to open Person Chronicle (点人溯事), marking every milestone of their life with numbered pins across changing dynastic borders:

Each time you step to the next event (‹ / ›, ← / →, or Space to auto-play), the timeline year, reigning monarch, imperial era, and dynastic territories evolve in sync with their footsteps, highlighting the active transition arc alongside bilingual primary-source excerpts and poems written at that exact site.

Try It Live: Su Dongpo's Life & Exile Across Song China (1037–1101 CE) →

Person Chronicle · Su Shi's Life & Exile Route


Feature 4: Easter Egg · Map Pinpoint Challenge — What Imperial Court Rank Would You Earn?

Think you know Chinese historical geography? Click Quiz in the top toolbar (or type quiz in the Universal Search Box for Map Pinpoint · Ancient Place Quiz):

Try It Live: Western Han Emperor Wu, Yuanshou 2 (121 BCE) · Start the Map Pinpoint Challenge →

Western Han 121 BCE · Map Pinpoint Challenge Preview


Further Reading: Topic Guides

Prefer reading to dragging the map? The Topic Guides (in Chinese) turn the atlas into static pages you can read, search and share: major event storylines, poetic routes and famous battles, territory and administrative changes across the 18 eras, and chronicles of historical figures, cities and passes. Years, places and people on each page jump straight back to the matching view of the map.


Keyboard Shortcuts

Key / Action Effect
/ or Cmd/Ctrl + K Focus the Universal Search Box: search historical figures (Qin Shi Huang/Zhang Qian/Su Shi), ancient & modern cities (Xianyang/Chang'an/Luoyang/Kaifeng), reigning monarchs (Emperor Wu of Han/Taizong of Tang/Liu Che/Li Shimin), imperial eras (Zhenguan/Yongle/Kangxi), poetic & battlefield landmarks (Red Cliffs/Wuzhang Plains/Languan/Lanting), mountain passes (Hangu Pass/Jianmen Pass/Yumen Pass), historical events, or the Ancient Place Quiz
← / → or bottom ‹ / › Jump to the previous / next historical phase, milestone event, or person event stop (hold Shift + ← / → to step by 10 years)
Space Auto-play / pause timeline evolution (or auto-advance stops in Person Chronicle mode)
Esc Close active popups/cards, clear search highlights, or exit custom multi-stop routes
Single-click city / Double-click map Open the 18-era Trace Place & Key Events genealogy card for that location
Hover / Click legend swatch Hover to isolate & highlight that polity's territory; click to open its profile and zoom to its territory

Append query parameters to share any historical moment, battle, city genealogy, or multi-stop route:

Embed in Your Page

Put any view of the atlas into a blog post, Notion page, or course site:

  1. Open the atlas and set up the view you want (a year, a regime profile, a place card, or a person's trajectory). The address bar always mirrors what you see.
  2. Copy the URL and add &embed=1.
  3. Paste it into an <iframe>:
<iframe
  src="https://deanchen.me/jiangshan-map/?embed=1&year=1104&trace=101.778,36.617&from=1072&to=1126&lang=en"
  width="100%" height="480" loading="lazy" style="border:0"
  title="Chronicles of the Realm · 1104 CE, Northern Song"></iframe>

The embedded map hides the site chrome and keeps only the map, a compact timeline, a title chip, an "Open in Jiangshan Atlas ↗" link, and a note that historical borders are approximate. Readers click once to start panning and zooming, so scrolling your page never gets stuck on the map.

Parameter Effect
embed=1 Turn on embed mode (required)
year, polity, person, stop, trace, lang Same as the share links above
from=1072&to=1126 Limit the timeline to this range; the timeline zooms to show only it
lock=1 Freeze the map at year and hide the timeline
autoplay=1 Play a person's trajectory stop by stop (with person), or play the timeline

WeChat Official Accounts, Zhihu, and Xiaohongshu do not allow iframes; share the plain link there instead.


AI Agent, MCP & LLM Integration

Chronicles of the Realm works out of the box as a historical-geography visualization engine for LLMs, MCP Clients, and AI Agents. Models never need to guess latitude/longitude coordinates—simply extract two semantic parameters from a poem or historical text, year and place, and the atlas automatically resolves ancient/modern place names, centers the camera, renders dynastic borders and multi-stop trajectories, and opens the Trace Place genealogy card:

1. Zero-Coordinate Dual-Parameter URL Protocol (0D Pinpoint / 1D Same-Year Route / 4D Multi-Year Route)

Mode Example URL Automatic Rendering Behavior
Single-Point Pinpoint (0D) ?year=819&place=蓝关&lang=en
(Han Yu's 819 CE exile poem at Languan Pass)
Jumps to Tang Yuanhe 14 (819 CE), drops a pin on Languan Pass in the Qinling Mountains, and opens its 2,400-year administrative genealogy card
Same-Year Multi-Stop Route (1D) ?year=763&place=剑外,巴峡,巫峡,襄阳,洛阳&lang=en
(Du Fu's 763 CE poem on recapturing Henan & Hebei)
Plots numbered vermilion arcs 1 → 5 across the 763 CE Tang map and auto-fits the viewport; click any stop to inspect its genealogy
Multi-Year Space-Time Route (4D) ?year=1079,1080,1094,1097&place=湖州,黄州,惠州,儋州&lang=en
(Su Shi's career across Huzhou, Huangzhou, Huizhou & Danzhou)
Pairs year[i] with place[i], labeling stops with their historical years and switching the underlying dynastic map whenever you click a stop

2. CLI One-Command Screenshot & JSON Lookup (for Agent Tool Calls)

# Single-point poetic landmark screenshot
python3 skills/jiangshan-atlas/scripts/jiangshan.py --year 819 --place 蓝关 --out /tmp/languan_819.png

# Same-year multi-stop trajectory screenshot
python3 skills/jiangshan-atlas/scripts/jiangshan.py --year 763 --place 剑外,巴峡,巫峡,襄阳,洛阳 --out /tmp/dufu_763.png

# Multi-year space-time trajectory screenshot
python3 skills/jiangshan-atlas/scripts/jiangshan.py --year 1079,1080,1094,1097 --place 湖州,黄州,惠州,儋州 --out /tmp/sushi_exile.png

3. Browser JavaScript API (window.atlasAPI) & In-Browser WebMCP (navigator.modelContext)

In browser automation environments (Playwright) or WebMCP-enabled AI browsers (navigator.modelContext), the page automatically registers jiangshan_locate, jiangshan_inspect, and jiangshan_open_person, and exposes window.atlasAPI:


Run Locally

No dependencies or build steps required. Clone and serve with any static HTTP server:

git clone https://github.com/DeanChensj/jiangshan-map.git
cd jiangshan-map
python3 -m http.server 8000

Then open http://localhost:8000 in your browser. Static topic guides under topics/ are built on deploy; run node scripts/build_seo_topics.js --html-only first if you want to browse /topics/ locally.

Run with Docker

No local dependency needed. Build and start with Docker Compose:

docker compose up -d --build

Then open http://localhost:8008 (the port mapping 8008:80 is set in docker-compose.yml).

The Dockerfile uses a two-stage build: a node:20-alpine stage generates the static topics/*.html pages, and the final nginx:alpine image serves only the runtime static files (index.html, assets/, css/, js/, geojson/, topics/, and metadata files) from /usr/share/nginx/html. .dockerignore excludes .git, .github, docs/, skills/, workers/, unused data/ and scripts/ subdirectories, Markdown files, geojson/demo.html, and README demo images (assets/hero_demo_*.webp, assets/preview_*.webp).

To use another port, change the ports mapping in docker-compose.yml (e.g. "9000:80") and run docker compose up -d again.

After pulling upstream changes, rebuild with docker compose up -d --build. Without Compose: docker build -t jiangshan-map:latest . then docker run -d -p 8008:80 --name jiangshan-map jiangshan-map:latest.

Note: the image is built locally; it is not published to any registry.


GeoJSON Export (for Leaflet / MapLibre / QGIS)

The app ships its geometry as compact topology-deduplicated VLQ bundles. To use the vector layers in other projects, generate standard RFC 7946 GeoJSON (EPSG:4326, lon/lat) locally; the output goes to geojson/ and is not committed. The export covers 403 BCE to 1948; later years and the modern province layer are not included. The prefecture layer (郡 / 州 / 府) is left out by default because it derives from CHGIS, whose terms forbid redistribution; add --with-prefectures to include it for local academic, non-commercial use, and do not publish the result.

node scripts/export_geojson.js            # or: node scripts/export_geojson.js <outDir>
node scripts/export_geojson.js --with-prefectures   # adds the CHGIS-derived prefecture layer (local academic use only)

To look up a point without loading every phase, use geojson/jiangshan-locate.js: it loads index.json plus only the snapshot covering the year, then runs a bbox-filtered point-in-polygon test.

const atlas = JiangshanLocate.create(); // or create({ base: '<url of geojson/>' })
const hit = await atlas.locate(118.78, 32.06, 1415); // lon, lat, year
hit.polity.properties.title;     // 明
hit.region.properties.title;     // 南直隶
hit.prefecture;                  // null unless exported with --with-prefectures (then 应天府)

After exporting, serve the repository (python3 -m http.server 8000) and open http://localhost:8000/geojson/demo.html for a Leaflet example: drag the year slider, click the map, or open demo.html?year=1415&lon=118.78&lat=32.06 to load, highlight and zoom automatically. Historical borders are schematic approximations, not surveyed boundaries. The data is GPL-3.0 except the prefecture-level boundaries; see Data Sources & License.


Data Sources & License

Code and the data created by this project are released under GPL-3.0. One layer is not: the prefecture-level boundaries derived from CHGIS, which stay under CHGIS's own terms.

Layer Source License
Code (app, scripts, CLI, MCP server) This project GPL-3.0
Polity outlines (polity) Started from aourednik/historical-basemaps (GPL-3.0), then redrawn by hand against historical texts GPL-3.0
First-level divisions (region: 刺史部 / 道 / 路 / 省 …) Drawn by hand from historical texts; the source of early versions was not recorded GPL-3.0
Prefecture-level boundaries (prefecture: 郡 / 州 / 府, incl. Warring States and Qin commanderies) Derived from CHGIS V6 and the Robert M. Hartwell China Historical GIS, simplified to 0.01° and edited by hand Not GPL-3.0. Academic, non-commercial use only; do not redistribute. See below
Settlements, milestones, journeys, person chronicles, place lore Compiled by this project from historical texts GPL-3.0
Modern provinces DataV GeoAtlas (Alibaba Cloud) Subject to DataV GeoAtlas terms
Rivers, lakes, neighbouring countries Public-domain data Public domain
Terrain hillshade Rendered by scripts/build_terrain_tiles.py from AWS Terrain Tiles (public-domain SRTM, GMTED2010, ETOPO1); only shaded images at no finer than about 1 km per pixel are published GPL-3.0 (images)
Guqin audio Wikimedia Commons (Liu Shui, Pingsha Luoyan, Yangguan Sandie, Zuiyu Changwan, Jiu Kuang) Public domain

Scholarly references (not data sources). Boundaries are checked against historical texts and Tan Qixiang's The Historical Atlas of China (谭其骧主编《中国历史地图集》). No map images or data from that atlas are included in this repository.

Prefecture-level boundaries (CHGIS). This layer is not covered by GPL-3.0 and is shown here for non-commercial, educational use. Do not republish it from this repository; if you need prefecture boundaries, download CHGIS from its official distribution (Harvard Dataverse) under its terms. scripts/export_geojson.js leaves this layer out unless run with --with-prefectures. Cite it as: CHGIS, Version: 6. © Fairbank Center for Chinese Studies of Harvard University and the Center for Historical Geographical Studies at Fudan University, 2016. Provenance details: data/atlas/README.md.

Approximate boundaries. Historical territories and administrative boundaries are schematic approximations of broad jurisdictions, not surveyed borders. Do not cite them as precise or authoritative.

Reusing this project. For the GPL-3.0 layers, credit 江山时序 Jiangshan Atlas with a link to https://github.com/DeanChensj/jiangshan-map and cite the upstream sources above. Screenshots that show the prefecture layer carry the CHGIS terms as well.

Forks, mirrors and derivative projects. You are welcome to build on this project or deploy your own copy. Please:

Project name. The official site is https://deanchen.me/jiangshan-map/. Third-party deployments and derivative projects should not present themselves as the official 江山时序 / Chronicles of the Realm site. Wording such as "based on 江山时序" or "unofficial mirror of 江山时序" is fine.

Rights holders. If you hold rights in any material here and believe it is used improperly, please open an issue; we will respond and remove it if needed.

Contributing: see CONTRIBUTING.md (中文贡献指南) for repository structure, data conventions, and validation checks.

Report a data error: found a wrong year, place or description? Open a data correction issue and cite a source if you can.

Copyright © 2026 DeanChensj. Licensed under GPL-3.0 (see LICENSE), except as noted above.

jiangshan-map (DeanChensj/jiangshan-map)

china
Searching Database…

What is this?An interactive web atlas that lets you scrub a timeline from 403 BCE to the present and watch Chinese dynasties, borders, and administrative divisions change, with 164 territory snapshots, ancient cities, mountain passes, and historical figures mapped across 18 historical periods.
Is this a GIS editing tool or a ready-made map to explore?It's a pre-built interactive visualization you browse, not a GIS editor — you drag a timeline, click cities, and search figures on a parchment-styled map rather than draw or edit your own maps.
How do I start exploring it?Open the live demo in a browser and drag the timeline or click any city — nothing to install.
Does it simulate borders continuously or only at certain points in time?It's built on 164 discrete territory snapshots at major historical milestones, not a continuous simulation; clicking a milestone switches maps and overlays a dashed 'Ghost Boundary Diff' to show what changed versus the previous phase.
Who is this made for?Anyone interested in Chinese history, classical poetry, or historical geography who wants a visual, exploratory way to see how dynasties, cities, and borders changed over time.
What happens when I click a city on the map?It opens a 'Trace Place' card showing the city's name and administrative jurisdiction across all 18 historical eras, plus site-specific historical events and a poetic epigraph about the location.
What is the Person Chronicles feature?Searching a historical figure like Zhang Qian, Su Shi, or Xuanzang plots their life's journey step by step across changing dynastic borders, with primary-source excerpts and poems tied to each stop.
Is there a game mode?Yes, a 'Map Pinpoint Challenge' quiz hides city labels and gives you historical clues to guess an ancient city's location, scoring you by distance and awarding an imperial cartographer title after 10 rounds.
Can I link someone directly to a specific year or battle?Yes, you can share deep links with query parameters like ?year=-403&lang=en to jump straight to a specific year, battle, or city view.
Creator
DeanChensj
Size
221.8 MB
Stars
9.8K
Age
4mo
Commits · 90 Days