Skip to main content
100%

Election History

✓ Published0🌍 Public
TThanaporn-sk
Last edited Apr 26, 2019
Created on Apr 26, 2019

This visualization displays over two centuries of U.S. presidential election results as a grid of colored cells, one per state and election year, with fill color indicating the winning party and opacity reflecting vote share. Built with D3 v4, it uses SVG rectangles mapped via `d3.scaleBand` for both axes, and adds a hover-based tooltip that highlights the corresponding row and column while showing vote totals and party percentages. A button toggles the vertical sorting between alphabetical and chronological state order using an animated transition.

AI-generated description

This is a riff on this chart that I made for testing the tooltip from here: Avoidant Tooltip

forked from <a href='http://bl.ocks.org/alexmacy/'>alexmacy</a>'s block: <a href='http://bl.ocks.org/alexmacy/4d8168d038e0a75cfaf33cf290f51458'>Election History w/ Avoidant Tooltip</a>

mit Licensed

Similar vizzes