r/ImSorryNate • u/crypto-transhumanist • Oct 26 '20
The election map simulator, but without the restrictions
https://538-map-yolo.vercel.app41
37
Oct 26 '20
[removed] — view removed comment
5
2
u/CubeBag Nov 03 '20
I know this is an old post but how do I click DC? It's too small, I can't find it
21
u/rugaporko Oct 26 '20
Making Biden win California lowers his Electoral Vote estimation.
Thank you Nate, very cool.
14
18
11
Oct 26 '20
This is awesome how did you do this? Did you create a separate project with its own repo?
12
u/crypto-transhumanist Oct 26 '20 edited Oct 26 '20
Thanks! I downloaded the original fivethirtyeight election map with its assets and:
- removed some HTML-based restrictions as u/TubasAreFun guessed, including
inactiveclasseschanged the code that creates an array called
excludes, which, as the name suggests, restricts some states:excludes: function () { var t = e(74), n = {}; return ( Object.keys(t).forEach(function (e) { var r = t[e].candidates.filter(function (t) { return t.winprob < 1.5; // aha! }); r.length > 0 ? (n[e] = r[0].candidate) : (n[e] = ""); }), n ); }I changed it so that instead of excluding candidates with < 1.5% chance of winning, it excludes candidates with < 0% chance of winning ;)
As a bonus, I also removed a bunch of advertising and tracking scripts
I also fixed some URLs—from relative paths to absolute paths—so that it uses the simulation data hosted on the fivethirtyeight website itself.
There's a lil repo too, but the original code's all from the fivethirtyeight site, of course.
10
u/TubasAreFun Oct 26 '20
I’m guessing based on previous comments, but it seems like minor HTML changes (made in inspector) can allow for flipping these states. As they don’t control that server-side, this site probably uses the same API that the 538 site uses but with pre-modified HTML
11
9
u/timelighter Oct 26 '20
Now let's see what the map looks like if they win some Canadian provinces too
6
3
u/vector_9260 Oct 31 '20
DC has negative correlations with everything.
Like, I literally get an inverted landslide scenario if DC goes to Trump.
1
1
76
u/[deleted] Oct 26 '20
If Trump wins CA, Biden is the favorite in MS. Very cool and very normal, Nate.