Home > three_d.js > Examples

US Presidential elections, 1992 and 1996

Bill Clinton's two presidential election wins saw significant third-party votes for Ross Perot. Since the sum of Dem, GOP, and Perot vote percentages is approximately equal to 100%, plotting all three variables against one another is wasting a dimension, but still it's fun to switch between the two years and watch the bubbles move. The area of the bubbles in the plot below is proportional to the number of electoral college votes the state has. DC is excluded because at 85% Clinton it wrecks the axes.

Mouse controls: Left-click and drag to rotate; alt (Mac)- or ctrl (Windows)-click-drag or middle-click-drag to pan; scroll or shift-click-drag to zoom. Touch screen controls: one finger to rotate; two-finger scroll to pan; pinch to zoom. Click/tap on the cube icons to snap to a side-on view.

Currently showing 1992. Change year.

Click a state to select.

You can see how the plot is constructed in the HTML source.

I got the reuslts data off Wikipedia. A CSV file and the R script I used to turn the relevant fields into JavaScript are here; the code sources my main JS-writing function write_three_d.R.

Posted 2016-10-02,
updated 2016-12-22 (version 1, keep_axes, set_point_color()).

Home > three_d.js > Examples