# What VNciv changes

VNciv is a fork of [vnm-civ](https://github.com/jarektkaczyk/vnm-civ) (MIT © Jarek Tkaczyk), itself derived from [usaciv](https://karpathy.ai/usaciv/) (MIT © Andrej Karpathy). The MIT licence is unchanged. This page is the concrete list of what was modified, replaced, added or removed. The same text is in the encyclopedia under "What changed".

# VNciv đổi những gì

VNciv là bản fork của [vnm-civ](https://github.com/jarektkaczyk/vnm-civ) (MIT, Jarek Tkaczyk), bản thân vnm-civ được dựng từ [usaciv](https://karpathy.ai/usaciv/) (MIT, Andrej Karpathy). Giấy phép MIT giữ nguyên. Trang này liệt kê cụ thể phần nào được sửa, thay, thêm hoặc bỏ.

## Kept / Giữ lại

- The static site: ES modules, Canvas 2D, no npm build.
- The Python 3.11 pipeline (`uv run python -m pipeline`), standard library only.
- The hex map of Vietnam, including Hoàng Sa with Đà Nẵng and Trường Sa with Khánh Hòa.
- Public data already built into the hexes: elevation (ETOPO 2022), land cover (ESA WorldCover 2021), population per hex (WorldPop R2025A), typhoon tracks (IBTrACS), roads, rail, ports and airports.
- MIT `LICENSE`, plus the HydroSHEDS terms in `THIRD_PARTY_NOTICES`.

## Replaced / Thay

- **Name and address.** The product is VNciv. Canonical, Open Graph, share images and the sitemap use `https://vnciv.orangecloud.vn`. Upstream host names are not used except as attribution links.
- **Language.** `/` is Vietnamese. `/en/` is English. The choice is stored in `localStorage`. `web/i18n/en.json` sits beside `vi.json`. `pipeline check` fails if a string used on the page is missing from either file. Numbers use `vi-VN` or `en-US`.
- **Advisors.** Twelve present-day roles: Economy & Investment, Population & Labour, Energy & Resources, Infrastructure & Transport, Education & Science, Health, Culture & Tourism, Environment & Climate, Trade & Exports, Business climate (PCI), Defence & Maritime Security, Data Analyst. Marks are flat rounded squares, not medallions.
- **Look.** A separate shell, not a recolour of the upstream bar. A dark left rail holds search, equal 72px lens tiles and a 2×2 tool grid. The header is only the vnciv wordmark and the language switch. National figures are four equal KPI cards along the bottom. The province card is a full-height slide-over, and on a phone it is a bottom sheet that sits above the bar (safe-area insets included). The legend is its own card. Type is self-hosted Be Vietnam Pro, and only the sizes 12, 14, 16, 22 and 32. The map is a flat hex atlas: no terrain glyphs, no wave texture, no building sprites. Province borders are white and the 34 current names are the primary labels. Towns that still use a pre-merger province name are not labelled until the map is close.
- **Province names.** The map uses the current NSO names. Đồng Nai, Quảng Ninh and Bắc Ninh are centrally run cities (Resolutions 30, 36 and 39 of 2026). The province panel cites the resolution.
- **Lenses.** Province lenses show the published yearbook figure (density, urban share, growth, fertility, life expectancy, net migration, GRDP per person, income, poverty, HDI, unemployment, trained labour, productivity, FDI capital, firms per 1,000 people, rice, fishery, forest cover, pupils per teacher, public doctors per 10,000, health insurance, hygienic water, national heritages, travel-agency revenue, internet). PCI is the nine sub-indices plus the ranking group. There is no overall PCI score because the workbook has no such column.
- **Boundaries.** The 34 outlines are the geoBoundaries ADM1 polygons dissolved with `tests/fixtures/province_map_63_34.csv`. The HDX COD-AB link returned 403 and is not a dependency.

## Added / Thêm

- National defence panel (`web/data/defense.json`): World Bank `MS.MIL.XPND.GD.ZS`, `MS.MIL.XPND.CD` and `MS.MIL.TOTL.P1` (personnel year 2020, the latest year in that series), and the Viet Nam row of SIPRI Milex 1949–2025 v1.2 (1995–2002 left blank, as in the workbook). The 2019 defence white paper is linked, not quoted.
- Parser `pipeline/sources/yearbook_text.py` for the yearbook appendix text, with tests that every table has 34 provinces, that additive totals match the national row within rounding, and that the Hà Nội / Hồ Chí Minh / Lai Châu samples match `tests/fixtures/lens_sources.csv`. Table PL 110 leaves natural forest blank when it is zero; the coverage rate is still the rightmost figure (Hưng Yên 1.5%, Đồng Tháp 1.2%).
- `scripts/linkcheck.py`, run in CI. A URL fails only when every request method fails.
- `wrangler.jsonc` for Cloudflare Workers Static Assets and `docs/DEPLOY.md`. Nothing here is deployed automatically.
- `web/404.html`, `web/sitemap.xml`, `web/robots.txt`.

## Removed from the interface / Bỏ khỏi giao diện

- Any view, toggle, tooltip or table of the 63 provinces from before 1 July 2025. Those codes remain only inside the dissolve.
- Census-2019 migration and the tree-cover-loss lens that existed only for those 63 provinces.
- Court-style advisor titles and medallions.
- Elections, government rankings other than PCI, and a religion lens.
- Provincial energy lenses. The electricity workbook did not answer, so no energy total is shown or invented. Plants already on the resource layer stay.
- A military-region layer, bases, weapons imagery and power rankings.
- A peacekeeping headcount. The monthly country file sits behind a browser check and was not read, so the panel shows no number and links the UN pages.
- The upstream Pages deploy is not the production target. Production is the Workers static site named in `wrangler.jsonc`.

## Lens count / Số lớp

39 map lenses: 25 yearbook, 9 PCI sub-indices, 1 PCI ranking group, 4 hex layers (population, land cover, elevation, typhoons). Plus the national defence panel, which is not a lens.

## Responsive polish / Tinh chỉnh giao diện

- **Typography / Kiểu chữ.** SVN-Product Sans replaces Be Vietnam Pro. The four supplied faces are self-hosted as WOFF2, and the regular face is preloaded. The map waits for the fonts before measuring or drawing text. Province labels use the shared size scale and show full names as space permits.
- **Navigation / Điều hướng.** The search field moves into the header on phones and tablets and retains its translated hint and magnifier. The bottom toolbar uses equal touch targets and snaps as it scrolls. On desktop, the active thematic lens has its own visual treatment and the layer menu reports the toggle count through its accessible label. The capital marker is a simple diamond.
- **Cards / Thẻ.** KPI cards, legend controls and province rows use consistent spacing. In the mobile province sheet, a metric label takes the full row, with the province value below it and the national comparison aligned to the right. The header and toolbar account for device safe areas.
- **Cross-border rivers / Sông xuyên biên giới.** An optional map layer highlights the Red River (including the Đà tributary) and the Lancang–Mekong system. Its overview sketches the upstream paths and explains their relationship to Vietnam's deltas. The traces are generalized from the existing Natural Earth source.

## Brand and map guidance / Nhận diện và hướng dẫn

- **Identity.** A route-in-a-hex mark, a navy and lime shell and matching Vietnamese and English social cards. Myriad Pro is preferred when installed, with the existing Vietnamese-capable font available on every device.
- **Map guide and controls.** A six-step guide is available from the toolbar. The animation menu and timeline now occupy separate viewport panels on desktop and mobile.
- **City selection and comparisons.** Whole-city banners open the full city statistics and frame its boundaries. Province comparisons label the year of the national benchmark and show both endpoints of population growth.
