I'd love to see muddy maps for other past presidential elections if you can get a hold of the data (and this one too, once all the votes have been counted).
Really cool work, and well-explained!
fillOpacity: (us_votes[i].total_votes / 59828),
to something like fillOpacity: (us_votes[i].total_votes / (59828 * 50 * (feature.properties.AREALAND / 5.195e10))),
But I think in practice, this effect is swamped by the "upper fence" effect described in the original post. In other words, the scale is very far from linear anyway, by changing the magic number 59828 above you can make it look dramatically different. I should really calculate what the (Q3 + 1.5 * IQR) value is, but above I just put in a "* 50" to make the overall impression of the map similar.The resulting image: https://imgur.com/3K8Wwan
BTW just to double-check, I'm assuming that in this given fillOpacity formula, that a fillOpacity > 1 just resolves to 1. So like fillOpacity : min(votesPerSquareMile/upperFence, 1).
In addition to computing the quartiles correctly, I also realized you should probably use (AREALAND+AREAWATER) rather than just AREALAND... in the above image the great lakes counties look suspiciously overemphasized. :)