As another attempt at map truthiness, I used JEQL to produce the following map. It shows actual vote numbers at a state level, color themed along two dimensions:
- The hue shows the relative proportion of Democrat VS Republican votes (using the now-canonical blue and red). For reference, Florida is almost exactly 50-50. This nicely shows that really the US is just varying shades of purple.
- The saturation is proportional to the relative population of the state. California is fully saturated, since it's the most populous state. The the inland Western and the far Northeastern states are pretty pale, since they have fairly low populations. This is roughly proportional to the weight of the state's Electoral College votes, although there are amusing anomalies.
I make no claim that this map represents any valid statistics - it's just a fun exercise in using JEQL to do spatial visualization. For reference, the script is:
CSVReader t colSep: "\t" file: "us_vote_raw.txt";
t = select String.trim(col1) name,
Val.toInt(String.keepChars(col2, "0123456789")) ecVote,
Val.toDouble(String.keepChars(col4, "0123456789")) demvote,
Val.toDouble(String.keepChars(col5, "0123456789")) repvote from t;
maxVote = val(select max(demvote+repvote) from t);
ShapefileReader tus file: "us_state.shp";
tvote = select name, demvote, repvote, GEOMETRY,
demvote / (demvote+repvote) demfrac,
join tus on t.name == String.trim(tus.STATE_NAME);
tplot = select GEOMETRY,
clr = Color.interpolate("ff0000", "0000ff", demfrac);
h = Color.getH(clr);
s = density;
v = 1;
styleFill = Color.toRGBfromHSV(h,s,v); }
extent = BOX(-128 20, -65 50);
Plot data: tplot
The raw data came from Wikipedia via simple cut-and-paste to a text file.