jiangshan-map README

README проекта с github.com/DeanChensj/jiangshan-map. Одним файлом markdown: 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 #2

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 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 Prefecture" Inspection →

Ming Dynasty 1415 CE · Yingtian Prefecture 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 corner of the Universal Search Box guide bar (or type quiz 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


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.

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 image is a plain nginx:alpine that serves this repository as static files: Dockerfile copies the working tree into /usr/share/nginx/html, and .dockerignore keeps the build context small by excluding .git, .github, data/, docs/, scripts/, skills/, workers/, Markdown files, geojson/demo.html and the README demo images (assets/hero_demo_*.webp, assets/preview_*.webp) — the site does not need any of them at runtime.

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.

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)

Ищем в базе…

Что это такое?Интерактивный веб-атлас, на котором можно перемещаться по шкале времени от 403 года до н. э. до наших дней и смотреть, как меняются китайские династии, границы и административное деление. На карте отмечены 164 снимка территорий, древние города, горные перевалы и исторические личности в рамках 18 исторических периодов.
Это редактор ГИС или готовая карта для изучения?Это готовая интерактивная визуализация для просмотра, а не редактор ГИС. Вы перетаскиваете шкалу времени, нажимаете на города и ищете личности на карте в стиле пергамента, но не рисуете и не редактируете собственные карты.
Как начать исследование?Откройте живую демонстрацию в браузере и перетаскивайте шкалу времени или нажмите на любой город. Ничего устанавливать не нужно.
Показывает ли это границы непрерывно или только в отдельные моменты времени?Атлас построен на 164 отдельных снимках территорий в ключевых исторических вехах, а не на непрерывной симуляции. При нажатии на веху карта переключается, а поверх неё выводится пунктирная «Ghost Boundary Diff», показывающая, что изменилось по сравнению с предыдущим этапом.
Для кого это сделано?Для всех, кто интересуется китайской историей, классической поэзией или исторической географией и хочет наглядно, в режиме исследования, увидеть, как со временем менялись династии, города и границы.
Что происходит, когда я нажимаю на город на карте?Открывается карточка «Trace Place» с названием города и его административной принадлежностью во всех 18 исторических эпохах, а также с историческими событиями, связанными именно с этим местом, и поэтическим эпиграфом о нём.
Что такое функция Person Chronicles?Поиск исторической личности, например Чжан Цяня, Су Ши или Сюаньцзана, пошагово показывает её жизненный путь на меняющихся границах династий. К каждой остановке привязаны выдержки из первоисточников и стихи.
Есть ли игровой режим?Да, викторина «Map Pinpoint Challenge» скрывает подписи городов и даёт исторические подсказки, по которым нужно угадать местоположение древнего города. Очки начисляются по расстоянию до верного ответа, а после 10 раундов вы получаете звание императорского картографа.
Можно ли отправить кому-то ссылку на конкретный год или битву?Да, можно делиться прямыми ссылками с параметрами запроса, например ?year=-403&lang=en, чтобы сразу перейти к конкретному году, битве или виду города.
Какие есть похожие проекты?MapStage, city-roads, prettymaps, maplibre-gl-js, Leaflet, vistep, algorithm-visualizer, openlayers
Автор
DeanChensj
Размер
188 MB
Звёзды
7.6K
Возраст
3 мес
Коммиты · 90 дней