chassis: bundle the US states sub-map (50 states + DC)#475
Closed
ChBrain wants to merge 1 commit into
Closed
Conversation
us.geo.json carries the 51 subdivision outlines (us-atlas states-albers-10m: Census Bureau cartographic boundaries pre-projected with d3.geoAlbersUsa, so Alaska and Hawaii arrive already inset), rekeyed from FIPS to ISO 3166-2 US-XX and rescaled into a pseudo-degree frame centred on lat 0 — there the loader's cos(meanLat) width fit is a no-op and its y flip restores the pre-flipped axis, so de-map.ts renders the Albers composite without any code change. The world map drills into the US page once a state culture ships; until then the entry is dormant. Source data is public domain (US Census Bureau) via us-atlas (ISC). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012AfbYrfJH4i991Uu8XeHrF
Owner
Author
|
Superseded by #476. Same diff, rebased onto the Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Bundles the United States subdivision geometry so the cultures map can drill into the US the way it already drills into Germany and the UK. Two files, the same shape as the Germany change:
src/lib/us.geo.json— the 50 states + the District of Columbia as ISO 3166-2 (US-XX) features.src/lib/de-map.ts— one line registeringUSinSUBMAPS, plus a comment documenting the source and coordinate convention.How the Alaska/Hawaii problem is solved
The naive path — Natural Earth admin-1 in raw lon/lat — breaks: Alaska crosses the antimeridian (its Aleutians run to +179.8°), so the existing bbox-fit loader would blow the frame up to span the globe. Instead the geometry comes from us-atlas
states-albers-10m(US Census Bureau cartographic boundaries, pre-projected withd3.geoAlbersUsa, so Alaska and Hawaii arrive already inset and rescaled).The build step:
06→US-CA).Centring on lat 0 makes the loader's
cos(meanLat)width compression a no-op, and the pre-flip cancels the loader's own y-flip — sode-map.tsrenders the canonical Albers USA composite with zero runtime code change. The coordinates are projection space, not real lon/lat; theSUBMAPScomment says so.Verification
de-map.tsloader under Node type-stripping:subMapFor("US")returns 51 outlines, no empty paths;US-DC,US-AK,US-HIall present; every code matchesUS-XX;DE/GBunaffected.Full
npm test(Astro build) wasn't run here — this sandbox can't reach the@chbrainGitHub Packages registry — so CI is the first full build.Dormant until content lands
With no state cultures yet, the US node has no children and nothing drills in. When the first
US-XXculture ships in khai-cultures, the culture-tree derives its nesting from the code, the world map's US marker flips from "download" to "open map", and this sub-map lights up — the state outline itself becomes the clickable link, so no marker-placement work remains.Source / licensing
Data is US Census Bureau (public domain) via us-atlas (ISC). No new runtime dependency — the geojson is vendored, matching how
de.geo.json/gb.geo.jsonalready live in the repo.chassis/*lane, but it was developed on the session's mandatedclaude/*branch — so thekhai-guard branch-checkgate will flag the branch name. The fix is a local rename tochassis/us-submapfrom this same commit; happy to prepare that handoff.🤖 Generated with Claude Code
https://claude.ai/code/session_012AfbYrfJH4i991Uu8XeHrF
Generated by Claude Code