Skip to content
Profile photo of Pablo Viniegra Picazopablo_viniegra
Español
ShortcutD

Selected project01 / 10

Spanish Elections Simulator

Problem
National vote shares do not explain how the 350 seats in Congress are distributed across 52 constituencies.
Decision
I isolated the electoral engine as pure TypeScript functions running in the browser and encoded scenarios in the URL to share them without backend lookups.
Spanish Elections Simulator: Congress simulator with D'Hondt allocation across 52 constituencies, a provincial map, coalition calculations and shareable scenarios.
Spanish Elections Simulator
Challenge
Projecting national estimates to each province while preserving the aggregate and implementing traceable D'Hondt allocation, the 3% threshold and tie-breaks.
Result
Adjust the national vote and watch the 350 seats shift province by province; every scenario is shareable as a link, with no backend.

Remote session

terminal@pablo.dev

Connecting to terminal@pablo.dev…