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.
Clinton:
GOP:
Perot:
You can see how the plot is constructed in the HTML source.
same_scale
parameter is set to [true, true, true]
so that distances along the axes are consistent.
keep_axes
is set to true
(otherwise the axes would need to be re-defined).
params.data[i].other
, so that they can be later retrieved from
plots[0].points[i].input_data.other
with little fuss when changing the year.
clicked
gets stored in params.data[i].other
as a flag saying if the state is currently selected.
three_d.set_point_color(i_plot, i, d)
to change the colour of the mouseover-ed point.
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()).