Skip to content

Add 120th Congress district maps and tables - #41

Merged
DTrim99 merged 11 commits into
PolicyEngine:mainfrom
DTrim99:cd120-districts
Nov 24, 2026
Merged

DTrim99 merged 11 commits into
PolicyEngine:mainfrom
DTrim99:cd120-districts

Conversation

@DTrim99

@DTrim99 DTrim99 commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Adds 120th Congress district maps beside the 119th ones. The 120th Congress is seated on January 3, 2027. Part of PolicyEngine/microcosm#1526, which tracks moving PolicyEngine's district data and maps to the 120th Congress.

What changes

  • The two loaders take an optional Congress, 119 by default:
    • loadCongressionalDistrictsGeo(congress?: CongressNumber)
    • loadCongressionalDistrictsHex(congress?: CongressNumber)
  • The map component. USDistrictChoroplethMap takes congress (119 by default) and loads the matching map.
  • New exported types: CongressNumber = 119 | 120, plus CongressionalDistrictMember and CongressionalDistrictMembers.
  • Members-elect. loadCongressionalDistrictMembers120() loads each district's member-elect and party letter, or "not yet called". The file is a snapshot of race calls, read from Wikipedia's 2026 House elections page, with its read time and page revision recorded. The first snapshot (November 5) has 406 races called (253 D, 153 R) and 30 not yet called, within a few seats of the news totals that morning (252 D, 158 R, 25 uncalled). fetch_members.py refreshes it.
  • New data files in src/visualization/data/, loaded only when asked for:
    • congressionalDistrictsGeo120.json: 851 KB, 437 features;
    • congressionalDistrictsHex120.json: 489 KB, 436 features;
    • congressionalDistrictMembers120.json: 436 districts.
  • Existing callers see no change. They still get the 119th files.

District IDs (ST-NN) follow each state's new numbering: in the 120th files, TX-35 is the area Texas's new map numbers 35. The list of IDs is the same in both Congresses, because seat counts come from the 2020 apportionment.

In the nine redrawn states, an ID now names a different area. For example, 40% of the new TX-35's 2020 population was in the old TX-28, and only 10% was in the old TX-35. So callers should draw each result on the boundaries it was computed with. The congress prop says which.

The 120th data

Nine states redrew for the 2026 elections: AL, CA, FL, LA, NC, OH, TN, TX and UT, 173 seats in all.

  • Block files. I compared Census's 120th and 119th block equivalency files block by block: 8,174,955 blocks with the same IDs in both.
    • Those nine states are the only ones where any block changed district.
    • Missouri keeps its 2022 map: Census regenerated the file on October 7, and the November referendum on the 2025 map failed.
    • Virginia's new map was struck down.
  • Boundaries.
    • The nine states come from TIGER/Line 2026, clipped to the shoreline.
    • Every other state, DC and Puerto Rico keep their 1:500k 119th boundaries.
    • The layer is simplified as one topology, so borders with unchanged neighbors stay aligned.
  • Hexes. The Downballot's hexmap v3.2 (2026) moves CA, FL, NC, OH, TN, TX and UT. The 119th hexes stay for every other state. The Downballot didn't move Alabama, Louisiana or Missouri. The hexmap is CC BY 4.0, so callers should credit "The Downballot" where it's shown.

data-sources/congressional-districts/ holds the build. It isn't in the package's files, so it isn't published:

  • sources.json, with all 66 inputs and their SHA-256s;
  • the download and build scripts;
  • a README covering method and checks;
  • tables built from 2020 block populations:
    • district keys in every format we use (ST-NN, Census GEOID, and policyengine-us's congressional_district_geoid), with labels;
    • district populations;
    • county → district and tract → district shares;
    • 119th → 120th overlaps;
    • a per-state change summary.

Checks

  • Population. The 2020 block populations sum to 331,449,281 people in 5,769,942 populated blocks, which matches the national total.

    • All 436 districts are present.
    • Every district's population is close to its state's ideal. The exceptions are states that count incarcerated people at their home address when they draw districts. California's largest is +2.34%, against +2.88% for the 119th map.
  • Boundaries against Census's block assignments. Take every tract wholly inside one district. Its internal point should fall in that district's shape.

    Points that land in another district
    120th file, redrawn states 1.02%
    120th file, other states 0.94%
    This package's current 119th file, same test (redrawn / other states) 2.51% / 1.97%

    Per state, the 120th file does as well as or better than the 119th baseline. Alabama is 2 of 1,382 tracts, so TIGER/Line carries its June 2026 map.

  • Data tests (tests/visualization/congressionalDistrictData.test.ts):

    • the 120th files have the same district IDs as the 119th files;
    • every boundary carries CONGRESS 120 and a 5002000US GEOID;
    • at-large districts and DC are -01;
    • hexes outside the seven moved states are unchanged;
    • the key table lists the map's districts;
    • the members file has an entry for every district, with a name and party for each called race.
  • Loader tests. The component asks for 119 by default and 120 when congress={120} is set, for both views.

  • Local runs.

    • bun run typecheck and bun run build pass.
    • All 64 visualization tests pass.
    • The full suite's only failures are two generated-css tests. They fail on this Windows checkout because of CRLF line endings in src/theme/quarto.scss, which this PR doesn't touch.

Not in this PR

  • Refreshing the members file. Rerun fetch_members.py before release, until every race is called and certified. After January 3, switch to unitedstates/congress-legislators.
  • Census's own 120th cartographic boundary file, when it's published.
  • Switching app-v2 to congress={120}, which happens when its data moves to the 120th. Existing dashboards keep the 119th default unless their owner changes them, and new projects pass congress={120}.

🤖 Generated with Claude Code

The 120th Congress, seated January 3, 2027, has new districts in AL, CA,
FL, LA, NC, OH, TN, TX and UT. The map loaders and USDistrictChoroplethMap
take an optional Congress (119 by default), and the package ships 120th
boundaries and hexes beside the 119th ones, with the same district IDs.

The boundaries redraw the nine states from Census's 2026 TIGER/Line files
and keep every other state's 119th boundaries, which Census's block
equivalency files show are unchanged (Missouri keeps its 2022 map). The
hexes use The Downballot's hexmap v3.2 (CC BY 4.0).

data-sources/congressional-districts (not packaged) records every source
with its SHA-256, the build scripts, a boundary check against Census's
block assignments, and county, tract and 119th-to-120th tables.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 5, 2026

Copy link
Copy Markdown

@DTrim99 is attempting to deploy a commit to the PolicyEngine Team on Vercel.

A member of the Team first needs to authorize it.

DTrim99 and others added 3 commits November 5, 2026 16:13
congressionalDistrictMembers120.json lists each district's member-elect
(name and party letter) or "not yet called", read from Wikipedia's 2026
House elections page with the revision and time recorded.
loadCongressionalDistrictMembers120() loads it. The first snapshot has 406
races called and 30 not yet called; fetch_members.py refreshes it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@DTrim99

DTrim99 commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

@PavelMakarchuk could you review this? It adds the 120th Congress district maps and members-elect beside the 119th ones, chosen with a congress option that defaults to 119. (I can't request reviewers on this repo, since I only have read access.)

@PavelMakarchuk PavelMakarchuk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST_CHANGES (head cf2e5bd1a6)

PolicyEngine/policyengine-ui-kit PR #41, "Add 120th Congress district maps and tables", by DTrim99. Part of PolicyEngine/microcosm#1526.

Summary

The API change is small and backward compatible. The district tables are correct: I rebuilt the per-state block changes from Census's files, and they agree. But the two new map files do not draw. congressionalDistrictsGeo120.json has its polygon rings wound in the opposite direction from the 119th file. d3-geo reads each district as "the whole globe except this district". With congress={120}, the geographic map is one solid rectangle. The hex map has the same fault in the seven moved states. The tests and CI do not catch this. Also, the members snapshot is 18 days old, and its refresh script fails on the current Wikipedia page. A merge to main publishes to npm at once, so the PR's plan to "refresh before release" has no step to happen in.

CRITICAL

C1. The 120th geographic map renders as a solid block; 160 hexes do the same

  • Where: src/visualization/data/congressionalDistrictsGeo120.json (all 437 features), src/visualization/data/congressionalDistrictsHex120.json (160 features: CA, FL, NC, OH, TN, TX, UT). The cause is the mapshaper GeoJSON output in data-sources/congressional-districts/scripts/build_geometry.sh:46 and the v3.2 hexes copied in scripts/build_hex.py:36-41.
  • What: All exterior rings in Geo120 are counterclockwise (RFC 7946 order). The 119th files and the unmoved hexes are clockwise, which is the order d3-geo needs. d3-geo uses spherical winding, so a counterclockwise ring encloses the rest of the sphere.
  • Failure case: <USDistrictChoroplethMap data={...} congress={120} /> with the same code path as the component (geoAlbersUsa().fitExtent(...), then geoPath):
    • d3.geoArea(feature) > 2π for 437 of 437 features in Geo120 and 160 of 436 in Hex120. The 119th files have 0.
    • Each district path covers the full SVG. For example, AK-01 has a path area of 45,301,166 px² on an 800×500 canvas.
    • The map draws as one filled rectangle. Tooltips and colors are wrong, because the last painted district covers all others.
    • focusState="TX" does not zoom. The TX bounds equal the full canvas.
    • The hex view at congress={120} is one green rectangle with a few hexes on top.
  • Check: I reversed the rings of only the counterclockwise exteriors. After that, both files draw correctly, and their bounds match the 119th files. Thus a rewind is the full fix (for example mapshaper ... -o ... geojson followed by a rewind to clockwise, or @turf/rewind with reverse: true).
  • Why CI passed: tests/visualization/mapLoaders.test.tsx mocks the loaders. tests/visualization/congressionalDistrictData.test.ts checks only IDs and properties. The hex test at lines 42-51 skips the moved states. The PR's own boundary check (check_geometry.py) does point-in-polygon tests, which do not depend on winding.

SHOULD ADDRESS

S1. No test checks that the map files render

  • Where: tests/visualization/congressionalDistrictData.test.ts:21-51.
  • Failure case: C1 passes every current test. Add a test that, for every feature in all four files, geoArea(feature) < 2π. You can also assert that geoPath(geoAlbersUsa().fitExtent(...)).bounds(collection) of the 120th file is close to that of the 119th file.

S2. The members snapshot is stale, and fetch_members.py now fails, so it cannot be refreshed

  • Where: src/visualization/data/congressionalDistrictMembers120.json:3 (as_of 2026-11-05 4:11pm EST, revision 1383960101); data-sources/congressional-districts/scripts/fetch_members.py:85-87 (winner_party) and :126 (raise SystemExit).
  • Reproducibility is good: I ran the PR's parse() on the cited revision. It gives the shipped file exactly: 406 called (253 D, 153 R), 30 not yet called, 0 differences.
  • Stale: On the current revision (1387342200, read November 23, 2026 at about 9:45am EST), 27 of the 30 "not yet called" races are marked as called. Examples: AK-01 (Nick Begich III, R), ME-02 (Paul LePage, R), CA-07 (Doris Matsui, D), TN-09 (Brent Taylor, R). Only 3 stay uncalled.
  • The script fails on the current page. It cannot read the party for 17 called rows, and it exits:
    • fusion tickets, such as (Democratic/WFP) (CT-05, NY-07, NY-10, NY-13, NY-14, NY-17 and more) and (Republican/Cons.) (NY-01, NY-02, NY-11, NY-23, NY-24);
    • a trailing ''Uncontested'' (FL-10).
  • Why it matters now: The push workflow publishes to npm on every merge to main that has a changelog fragment. The PR body says "Rerun fetch_members.py before release", but merge is release. If it merges as is, the package ships a November 5 snapshot that marks 27 decided races as "not yet called". The README's refresh step cannot run until the parser handles fusion parties.
  • Fix: Map the first party in a A/B label (Democratic/WFP to D, Republican/Cons. to R). Allow a trailing ''Uncontested''. Rerun the script just before merge.

S3. Source hashes no longer match

  • Where: data-sources/congressional-districts/sources.json, scripts/download_sources.sh.
  • What: Census republished all nine tl_2026_*_cd120.zip files on November 9, 2026 at 3:30pm EST. The .shp files inside are unchanged (dated September 27), but the zip SHA-256s differ (for example TX: pinned 3edba357…, now 0d700a7f…). download_sources.sh exits on the first mismatch, so the documented rebuild fails today. The geometry is the same: I compared the new AL, TX and UT shapes with Geo120 and found only shoreline-clip and simplification differences. Hash the .shp and .dbf files, not the zip, or keep a mirror.

S4. The README says the 120th file has the 119th file's properties and keys

  • Where: data-sources/congressional-districts/README.md:92.
  • What: The README says the 120th file "has the 119th file's properties and keys" (data-sources/congressional-districts/README.md:92). It does not. Geo120 drops ALAND, AWATER, CD119FP and LSAD, and it adds STUSPS, STATE_NAME, CD120FP and CONGRESS. A caller that reads properties.ALAND gets undefined after a switch to congress={120}. Correct the text, or keep the old fields (TIGER/Line has ALAND, AWATER and LSAD).

SUGGESTION

  1. Three invalid geometries. GA-14, TX-16 and UT-04 in congressionalDistrictsGeo120.json self-intersect (shapely is_valid is false). GA is an unchanged state, so the simplification step added the fault. The 119th file has none. d3 SVG fills usually tolerate this, but downstream GIS use (for example a point-in-polygon lookup) can fail. Run -clean after the final simplify step and check is_valid in the build.
  2. The hex v3.2 source is a Google Drive link with confirm=t (sources.json, hex/hexcd_v32.zip). The SHA-256 pins it, but the link can stop working. Record the landing page and keep a copy.
  3. Untyped callers fall back to 119 silently. A JavaScript caller that passes congress="120" or 121 gets the 119th map with no error (loaders.ts:10-15, :21-26). A runtime check or a console warning would help.
  4. API shape. loadCongressionalDistrictMembers120() puts the Congress in the name, while the map loaders take a parameter. loadCongressionalDistrictMembers(congress) would match and leave room for the 121st.
  5. Hexes for Alabama and Louisiana. The Downballot did not move them, but every Louisiana district and 4 of 7 Alabama districts changed. Those hexes now sit in their 119th positions. The README says this; the loader JSDoc could say it too, because callers see only the JSDoc.

What I checked

  • Code, line by line: loaders.ts, types.ts, data/index.ts, visualization/index.ts, USDistrictChoroplethMap.tsx and both test files.
    • Default stays 119 in both loaders and the component. Existing callers see no change.
    • Each Congress uses its own dynamic import(), so the 120th files load only when asked. There is no module-level cache, so a 119 result cannot leak into a 120 call. The effect resets geoData and depends on congress, so a prop change reloads. The isMounted guard drops a late response.
    • The new types are exported from @policyengine/ui-kit/visualization.
  • Build, typecheck and tests (bun 1.3.9):
    • Main a315f45: build, typecheck and tests pass (346 tests).
    • Head cf2e5bd: all pass (354 tests).
    • Head merged into main: merges with no conflict; all pass (354 tests).
    • The repo's lint script is the same as typecheck.
  • CI on GitHub: "Tests" and "Changelog fragment" passed on November 5, 2026 at 5:10pm EST. The Vercel check failed only because the deploy needs team authorization for a fork. It is not a code failure.
  • Package size: The new files ship as lazy chunks, in ES and CJS copies: Geo120 851 KB, Hex120 489 KB, Members 60 KB. npm pack grows by about 0.7 MB compressed and 2.8 MB unpacked (to 14.1 MB and 51.2 MB). data-sources/ is not in the package (0 entries).
  • Data:
    • Geo120 has 437 features: 436 districts plus PR-98, the same as the 119th file. Hex120 has 436, the same as Hex119 (no Puerto Rico hex). The members file and district_keys_cd120.csv have the 436 IDs with no Puerto Rico.
    • Every ID in the members file is on both maps. State FIPS codes match the 119th file for all 52 state codes. DISTRICT_ID agrees with CD120FP (at-large 00 and DC 98 become -01).
    • Seats per state match the 2020 apportionment (for example CA 52, TX 38, FL 28, NC 14, OH 15, UT 4, MO 8).
    • The tables agree with each other. Totals are 331,449,281 in the keys, overlap, county and tract tables. County shares and 120th overlap shares sum to 1. model_geoid is state FIPS × 100 + district (0 for at-large and DC). The TX-35 claim (40% from old TX-28, 10% from old TX-35) is correct.
  • Sources:
    • I downloaded Census's cd119.zip and cd120.zip. The SHA-256s match sources.json.
    • Block by block, 8,174,955 blocks in both files, none missing. Blocks changed district only in AL, CA, FL, LA, NC, OH, TN, TX and UT. Missouri and Virginia have 0 changed blocks. This confirms the README's nine-state list.
    • cb_2024_us_cd119_500k.zip matches its pin. For unchanged states, Geo120 is closer to this file than the shipped 119th file is (mean area error 3.7% against 7.2%).
  • Members: the cited revision parses to the shipped file exactly (see S2). "Not yet called" is a clear status value with null name and party, and the file carries as_of (UTC, documented in the type) and the revision URL.
  • Scripts: no secrets and no hard-coded local paths. WORK and OUT can be overridden. mapshaper is pinned to 0.7.101. The Wikipedia fetch is not pinned by design, but the output records the revision.
  • Changelog: changelog.d/cd120-districts.added.md is a top-level fragment with a valid type. A towncrier draft renders it as one entry with nested bullets.
  • Overlap: The only other open PR is #38 ("Add MIT license"), which changes only LICENSE. No overlap.

Not verified

  • A browser render of the real component. I rendered the four files with the component's own projection and d3-geo calls in Node, and converted the result to an image. I did not run the demo app.
  • Each member-elect against news or certified results. I checked only that the file matches the cited Wikipedia revision, and compared it with the current revision.
  • The 2026 legal events (Missouri referendum, Virginia ruling, Alabama June map). I confirmed only their effect in the Census block files.
  • A full rebuild with the PR's scripts (about 1.4 GB of downloads). I checked the hashes of 6 sources and reran only the members parser.
  • The hex positions inside the nine redrawn states against their new maps (an open item in microcosm#1526).

DTrim99 and others added 6 commits November 23, 2026 09:56
mapshaper writes exterior rings counterclockwise (RFC 7946), and d3-geo reads
those as the whole globe except the district, so the 120th geographic map drew
as one rectangle and 160 hexes in the seven moved states did the same.
rewind_for_d3.py winds exteriors clockwise, as in the 119th files; the build
scripts now run it, and the shipped files are rewound (ring order only, same
bytes otherwise). New tests check every shape in all four map files with
geoArea and compare the 120th maps' bounds with the 119th maps'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The current Wikipedia page writes New York and Connecticut fusion tickets as
"Democratic/WFP" or "Republican/Cons." and FL-10 ends with ''Uncontested'',
so the script stopped on 17 called rows. It now takes the first party of a
fusion label and allows a trailing italic note; the November 5 revision still
parses to the old file exactly. Refreshed from revision 1387342200: 433 called
(260 D, 173 R), 3 not yet called (LA-05, LA-06, MN-01).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Census republished the nine TIGER/Line 2026 cd120 zips on November 9 with new
timestamps, which changed every zip hash and stopped download_sources.sh. The
shapefile entries now pin the .shp, .shx, .dbf and .prj inside each zip. A
rebuild from the republished files matches the shipped boundaries except for
one shared CA-38/CA-40 vertex. The hex entry records The Downballot's data page
as the fallback if the Google Drive link stops working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nknown maps

loadCongressionalDistrictMembers(congress = 120) replaces
loadCongressionalDistrictMembers120(), matching the map loaders, and throws for a
Congress with no file. The map loaders read a Congress passed as a string and
warn before falling back to the 119th map for any other value. The loader docs
list the 120th file's properties and say Alabama's and Louisiana's hexes keep
their 119th positions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README said the 120th boundary file has the 119th file's properties. It
shares the key but drops ALAND, AWATER, LSAD and CD119FP and adds CD120FP,
CONGRESS, STUSPS and STATE_NAME. Also document the ring winding, the three
rounding bow-ties (GA-14, TX-16, UT-04), the in-zip hashes, fusion tickets, and
rerunning the members script before every merge, since a merge publishes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PavelMakarchuk PavelMakarchuk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE (head 94fc389a25)

PolicyEngine/policyengine-ui-kit PR #41, "Add 120th Congress district maps and tables", by DTrim99. Re-review after the REQUEST_CHANGES review at cf2e5bd1a6 (November 23, 2026, 9:49am EST). The head is 94fc389a25, pushed at 10:08am EST.

Summary

All four required items and the five suggestions are resolved or now documented. The new geographic and hex files are the old files with their rings reversed, byte for byte. The geometry is otherwise unchanged. Both 120th maps now draw correctly with the component's projection, and the focusState="TX" zoom works. The two new map tests fail on the old data and pass on the new data. The fixed members parser reads the cited revision and the current revision with no problems, and both give the shipped file exactly. The removed loadCongressionalDistrictMembers120 was never published, so the rename breaks no user. Build, typecheck and 360 tests pass. CI passes, except for the Vercel fork-authorization check. I found no new CRITICAL or SHOULD ADDRESS items.

Resolved since the last review

Item Status Evidence
C1. Counterclockwise rings: the 120th map draws as a solid block Resolved d3.geoArea is less than 2π for all features in all four files (437, 437, 436, 436), and for every polygon part. With geoAlbersUsa().fitExtent and geoPath, the collection bounds of Geo120 equal Geo119 ([20,28]–[780,472]), and Hex120 equals Hex119 ([78,20]–[722,480]). The focusState="TX" bounds are [166,20]–[634,480] for both Congresses (it was the full canvas before). No district path covers more than 25% of the SVG. A rendered image shows a normal map in both views.
S1. No render test Resolved tests/visualization/congressionalDistrictData.test.ts:31-66 checks geoArea < 2π for every feature in all four files. It also checks that the 120th bounds are within 2 px of the 119th bounds, with the component's projection for each view. With the old cf2e5bd1a6 data put back, both tests fail (the geographic bounds are 34.6 px off).
S2. Stale members snapshot; parser fails on fusion tickets and "Uncontested" Resolved The snapshot cites revision 1387342200, read at 9:58am EST. main_party() (fetch_members.py:92-98) and the '' alternative (:88) handle Democratic/WFP, Republican/Cons. and FL-10's ''Uncontested''. The parser gives 0 problems on the cited revision and on revision 1387409897 (3:55pm EST). Both give 433 called (260 D, 173 R) and 3 uncalled (LA-05, LA-06, MN-01), with 0 differences from the shipped file. The README now says to rerun the script before every merge.
S3. Census zip hashes no longer match Resolved download_sources.sh now checks the .shp, .shx, .dbf and .prj files inside each shapefile zip. I downloaded all 11 shapefile zips again: every inner hash matches. The TX zip hash is 0d700a7f…, which is the republished zip. The tract Gazetteer and the hex v3.2 zip match their whole-file pins. The block equivalency zips are unchanged on Census's server (Last-Modified October 7, 2026 and July 29, 2024).
S4. README says the 120th file keeps the 119th properties Resolved README.md:101-109 now lists the properties that are the same, new and not carried over (ALAND, AWATER, LSAD, CD119FP). The loadCongressionalDistrictsGeo JSDoc (loaders.ts:20-27) says the same.
Suggestion 1. Invalid geometry in GA-14, TX-16 and UT-04 Documented, not fixed The three self-intersections remain (shapely is_valid is false). The README (:110-117) explains them and gives a repair. I measured them: make_valid changes the area by 0.00005%, 0.00016% and 0.000002%. They do not change the render.
Suggestion 2. Google Drive hex source Resolved The README now names The Downballot's data page as the fallback. The SHA-256 pin still matches.
Suggestion 3. Untyped callers fall back to 119 silently Resolved mapCongress() (loaders.ts:5-17) reads "120" as 120 and warns for other values. tests/visualization/congressionalDistrictLoaders.test.ts tests both cases.
Suggestion 4. Members loader name Resolved Now loadCongressionalDistrictMembers(congress = 120). It throws for other values (loaders.ts:58-67).
Suggestion 5. AL and LA hexes note Resolved The loadCongressionalDistrictsHex JSDoc (loaders.ts:38-43) says it.

CRITICAL

None.

SHOULD ADDRESS

None.

SUGGESTION

  1. Rerun fetch_members.py just before merge. A merge with this changelog fragment publishes 0.14.0 to npm. The snapshot is current now: revision 1387409897 (3:55pm EST) gives the same file. But LA-05, LA-06 and MN-01 are still uncalled, and any call between now and the merge is missing from the release. The README already says this (README.md:89). This is a reminder at merge time, not a code change.
  2. Update the PR description. It still names loadCongressionalDistrictMembers120() and describes only the November 5 snapshot (406 called, 30 uncalled). If the squash commit uses the PR body, the history names an API that does not exist. Change it to loadCongressionalDistrictMembers(120) and the November 23 snapshot.
  3. The two loader families handle an unknown Congress differently. The map loaders warn and load the 119th map. The members loader throws. Each choice is defensible, because there is no 119th members file. A sentence in the changelog or JSDoc that names this difference would help callers who use both.

What I checked

  • Head and history: 7 commits since cf2e5bd1a6. One merges main (a315f45, "Release @policyengine/ui-kit", 0.13.0). Five fix the review items. The merge brings only main's 0.13.0 release: CHANGELOG.md, package.json and the consumed fragments.
  • Release and backward compatibility:
    • npm has 0.13.0, published November 18, 2026 at 2:25pm EST. Its tarball has no 120th file and no loadCongressionalDistrictMembers symbol. Thus #41 is not published, and the old name loadCongressionalDistrictMembers120 was never released. The rename breaks no user.
    • CHANGELOG.md has no #41 text. changelog.d/cd120-districts.added.md is still a top-level added fragment, so the next release is 0.14.0 (minor). The fragment names the new loader signature and the warning behavior.
    • The built dist/ exports only loadCongressionalDistrictMembers. The 120th files are still separate lazy chunks.
  • Map data:
    • The new Geo120 and Hex120 files are byte-identical to the result of running rewind_for_d3.py on the old files. Properties are unchanged for all features. A second run of the script changes 0 features.
    • Hex120 rewinds 160 features (the 7 moved states) and leaves the other 276 unchanged.
    • No file has holes, so the hole branch of the script does not run on this data. No polygon part covers more than half the sphere.
    • I rebuilt Geo120 with build_geometry.sh (mapshaper 0.7.101) from the republished Census files. It differs from the shipped file only in CA-38 and CA-40 (0.53% and 0.12% symmetric difference), as the README says. The rebuild also passes the winding check.
  • rewind_for_d3.py: it uses planar signed area, with exterior rings clockwise and holes counterclockwise. It keeps mapshaper's one-feature-per-line layout. The script comment correctly says that planar winding equals d3's spherical winding only because no ring spans 180° of longitude. The geoArea test guards that assumption.
  • Loaders and component: USDistrictChoroplethMap passes congress straight to the loader, so the string handling applies to the prop too. Default behavior (no argument) is unchanged.
  • Build, typecheck and tests (bun 1.3.9, frozen lockfile): all pass at 94fc389a25, with 360 tests in 33 files (354 at cf2e5bd1a6).
  • CI on GitHub: "Tests" and "Changelog fragment" passed at 10:09am EST on the head. "Vercel" fails because a team member must authorize a deploy from a fork. That is not a code failure.
  • Mergeable state: MERGEABLE, UNSTABLE (only the Vercel status). The head already contains main's tip a315f45.
  • Overlap: the only other open PR is #38 ("Add MIT license", LICENSE only).

Not verified

  • A browser render of the real component. I rendered the four files in Node with the component's own projection and d3-geo calls, and viewed the result as an image.
  • A rebuild of Hex120 with build_hex.py. I confirmed only that it equals the old file rewound.
  • Each member-elect against news or certified results. I checked only that the file matches the cited revision and the current revision.
  • A full run of download_sources.sh. I checked the 11 shapefile zips, the Gazetteer and the hex zip, and the server dates of the block equivalency zips. I did not download the 51 P.L. 94-171 zips again.

Wikipedia moved the per-state sections to level 3 under "Elections in
individual states", so fetch_members.py found no state sections. Sections
are now matched at either level; revision 1387342200 still parses to the
previous file exactly.

The page now marks MN-01 for Jake Johnson (DFL), 50.0% to 49.9%, but the
AP has not called it and a recount is set for November 30, so a HOLD list
keeps it not_yet_called. The refreshed file (revision 1387547895) has the
same calls as before: 433 called, 3 not yet called.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DTrim99

DTrim99 commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the approval @PavelMakarchuk. I pushed one commit after it (97c89a2), the members-elect refresh the README calls for before a merge:

  • Parser. Wikipedia moved the per-state sections under a new "Elections in individual states" heading, so fetch_members.py found none. It now reads either layout, and the November 23 revision still parses to the old file exactly.
  • MN-01. The page now marks Jake Johnson (DFL) as the winner, 50.0% to 49.9%. The AP hasn't called the race, though, and a recount is set for November 30. A documented HOLD list keeps it not_yet_called.
  • Data. The refreshed file has the same calls as the one you reviewed: 433 called and 3 not yet called (LA-05, LA-06, MN-01). Only as_of and the source revision changed.

Tests (360) and typecheck pass locally. I only have read access here, so could you merge when CI is green? The Vercel check still needs a team member to authorize the fork preview.

@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
policyengine-ui-kit Ready Ready Preview Nov 24, 2026 7:18pm UTC

Request Review

@DTrim99
DTrim99 merged commit 422501b into PolicyEngine:main Nov 24, 2026
4 checks passed
DTrim99 added a commit to PolicyEngine/state-legislative-tracker that referenced this pull request Nov 24, 2026
ui-kit 0.15.0 (PolicyEngine/policyengine-ui-kit#41) ships the 120th
Congress boundaries, so analyses tagged 120 now draw on them instead of
falling back to the district list. Other Congresses still fall back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 97c89a24 Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants