尚未收集儲存庫資訊。
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
US election results: share of the vote against share of the seats, 1976-2024
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗US election results explorer: maps and lists of past results, comparing each party's share of the vote with its share of the seats won. Static site for GitHub Pages: https://orangeandgreen.github.io/SeatShare/
scripts/build_data.py turns the MIT Election Data and Science Lab returns and Klarner's
state legislative returns into the
small JSON files in public/data/, which are committed so the site builds without them.
File in data/raw/ | Source |
|---|---|
1976-2024-house.tab | US House 1976-2024. Behind a guestbook form, so download it by hand. |
1976-2024-president.csv | President 1976-2024. Downloaded by the script when missing. |
1976-2024-senate.csv | US Senate 1976-2024. Downloaded by the script when missing. Tab-separated despite the name. |
1968-2022-state-legislatures.csv | Carl Klarner, State Legislative Election Returns 1967-2022, the file with one row per contest (202slers_uoa_contest). Downloaded by the script when missing. |
python scripts/build_data.py
python -m unittest discover -s tests
How the House file is read:
How the Senate file is read:
pre in 1992 and 2008, its 2022 runoff as gen runoff, and
its January 2021 runoffs under 2021, which count for 2020.party_detailed first, because party_simplified calls
some Democrats Other. A few candidates with no party at all, and two Louisiana
races whose rounds are mixed up, are corrected in SENATE_PARTIES and
SENATE_FIXES in the script.SENATE_MISSING in the script.SENATE_SPECIAL_CLASSES.How the state legislature file is read:
noVotes). Where that is over half the seats up, the
map hatches the state and the list sorts it last by votes and gaps.Electoral votes are the state's House seats plus two (DC has three), winner-take-all except the recorded Maine and Nebraska district splits. Faithless electors are ignored.
scripts/build_unity.py builds the "Party lines" tab from Voteview's
roll calls (Lewis, Poole, Rosenthal, Boche, Rudkin and Sonnet), which need no key. It
downloads the members, votes and roll-call CSVs for each Congress and chamber into
data/raw/voteview/ (about 475 MB for the 80th-119th Congresses, not committed) and
writes one small file per chamber and Congress to public/data/unity/, with
index.json holding each one's party averages.
python scripts/build_unity.py # 80th (1947) to 119th Congress
python scripts/build_unity.py 100 119 # or any range of Congresses
The measure is Congressional Quarterly's party unity:
Vite + TypeScript + D3. npm run dev to work on it, npm test for the unit tests.
Pushing to master deploys to Pages.