Viewing a saved revision (read-only)
d4d56540296e4b4d8eed7fda715dc9d8
Week 7 New Technique
This visualization is a choropleth map of the 2020 U.S. presidential election results, coloring states by the proportion of votes cast for the Democratic versus Republican candidates. The map uses a red-white-blue color scale—red for states that voted more Republican, blue for those voting more Democratic, and white for true swing states—with color intensity reflecting the margin of victory. It is built with D3 and TopoJSON, loading US state boundaries from a public TopoJSON atlas and aggregating county-level election returns to compute statewide Democratic vote shares. A key technique is the use of `d3.geoIdentity` for map projection and `d3.interpolateRgbBasis` with a diverging color palette to smoothly transition across the political spectrum. The visualization dynamically updates once the geographic and election data are fetched and merged, providing an at-a-glance view of partisan voting patterns across the United States in the 2020 presidential election.
AI-generated descriptionElectoral map for the 2020 election. Bluer states voted Democrat in higher proportion, redder states voted Republican in higher proportion, and neutrally colored states are closer to "swing" states.
Uses a US Election 2020 dataset for presidental election data, and the publicly available TopoJSON USA map.