Election Calculator / Simulator 2.0 released (user search)
       |           

Welcome, Guest. Please login or register.
Did you miss your activation email?
November 26, 2022, 09:37:48 PM
News: Election Simulator 2.0 Released. Senate/Gubernatorial maps, proportional electoral votes, and more - Read more

  Talk Elections
  Forum Community
  Forum Community (Moderators: The Dowager Mod, YE, KoopaDaQuick)
  Election Calculator / Simulator 2.0 released (search mode)
Pages: [1]
Author Topic: Election Calculator / Simulator 2.0 released  (Read 10209 times)
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« on: January 21, 2022, 01:21:04 PM »
« edited: January 24, 2022, 10:13:25 AM by Virginiá »

After many months of squeezing in an hour or two of work here and there, I've finally got the next major release of the election simulator ready. I've expanded the functionality quite a bit, including to Senate/Gubernatorial elections. Here is the (almost) full list of features, enhancements and bug fixes:

Use on this page:
https://talkelections.org/FORUM/index.php?action=evcalc


New features
----------------------------------------------------------------------------------------------------

  • Senate/gubernatorial maps (Senate maps can have special elections added/removed at will)
  • Faithless electors / divided electoral vote support (mostly for pre-1836 elections)
  • pre-1836 presidential result maps
  • Large map support (for editor page only)
  • Many territories now shown on historical maps (still lots more to do though!)
  • States can now be sorted on the map editor page's state list. Sort by geographical region or Cook Partisan Voting Index (2016-2020)
  • Maps now have a custom right-click menu. This will allow another quick way to change region status/winner/shading in the map editor.
  • Added preset map themes (Default or Bold)
  • Ability to load legacy (Dave's calculator) maps in new editor - old maps displayed in forums posts have option to be loaded in new editor when hovering over with mouse, and you can paste the [img] map links into input on editor page by clicking "Load Legacy Map In Editor" near the bottom to load old map in the new simulator
  • Maps can now have a custom image embedded either in the background or foreground, and can also have their transparency toggled
  • Editor now remembers and loads the map you were last working on. This is tied to your forum session, and will eventually be lost after a couple weeks. Editor will also remember the collapsed state of individual sections.



Enhancements
----------------------------------------------------------------------------------------------------

  • Electoral vote bar recoded entirely to sort based on highest and 2nd highest vote winner, also in SVG format
  • Unpledged/non-voting electors shown in electoral vote bar
  • Added 'ineligible' status for states that were not eligible to vote in time for the 1789 presidential election
  • Improved map shadow option
  • All maps should now have detailed electoral vote allocations shown (please notify me if any are missing/inaccurate)
  • Regions that did not hold a popular vote now use a darker shade so maps are easier to interpret (40 pop vote shade).
  • States with missing popular vote data now display a hatching pattern indicating data is missing
  • Regions can now have the flipped status and a no popular vote held status on any presidential map type
  • Option to hide container borders for party legend
  • Maps now have more options for customization (dark borders, thicker borders, show territories, etc)
  • Custom vote/region label text is now centered better
  • Region tooltips now better display longer candidate names
  • vote-by-district parent region (ME, NE) can now have their electoral votes modified (it will be reset though if you toggle vote-by-cd on/off)
  • Electoral votes can now be reset to original values on an individual basis
  • Congressional district options are now merged into main state table list to save vertical space on calculator page
  • Highlighted region borders on mouse hover now looks less choppy



Bug fixes
----------------------------------------------------------------------------------------------------

  • Vote-by-district entries now have their EV text shown as black under same conditions as states
  • Fixed Tossup evbar showing tooltip with prediction rating slots (should be nothing but # of regions that are tossup)
  • Electoral vote left-hand clipping issue mitigated
  • Fixed issue where changing electoral votes for a region would overwrite custom label text on calculator page
  • Congressional district tooltips on presidential map now correctly show state flag
  • Region tooltips screwed up when set to Tossup
  • Mitigated a bug where hovering over large parts of New Hampshire would cause Vermont's tooltip to be shown and borders to be highlighted
  • Fixed wrong electoral vote count for AR and LA in 1872 map
  • Fixed bug where Maine electoral votes could not be changed even when vote-by-CD mode was disabled
  • Fixed bug where elections with a lot of defined candidates/independents could have the same color used for multiple candidates
  • Map embed data now has smaller memory footprint for most maps
  • Corrected a few election data errors (wrong candidate names/parties - thanks to Truman for pointing it out)
  • Fixed a bug where seceded states in an 1864 map, or other maps with ineligible states would have their region color changed if pop vote shading was toggled
  • Fixed a bug where maps with unicode characters (eg: Cyrillic, Chinese, etc) for names/tooltips/labels/etc would cause the map to fail to load Alternative fix required - will update when found
  • Fixed a bug where resetting all regions to TOSSUP would cause map to forget other regional settings



Previous release threads
----------------------------------------------------------------------------------------------------


Version 1
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #1 on: January 21, 2022, 01:21:13 PM »
« Edited: January 21, 2022, 08:40:06 PM by Virginiá »

Examples of new map features:

Senate (2018) map with new, optional Bold theme:





Faithless / proportional electoral votes:





Custom overlay image with 50% transparency (Jeb over 2020 Senate map):

Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #2 on: January 21, 2022, 01:28:45 PM »
« Edited: January 21, 2022, 01:36:04 PM by Virginiá »

I've also got the state maps getting closer to release. I still need at least one recent election's worth of data to provide a base set of maps though. Not sure how to put that together myself.

Technically, if you wanted to make a state map, you could, but I won't guarantee that old maps won't break when I finally release the actual state-level map generators. Quote/view post [ map ] bbcode to see how:

test:




-


Regarding custom image overlays, if anyone thinks there should be a preset image I should upload so people can easily use it on maps, let me know. I only added "jeb" for now. (If you type "jeb" without quotes into the Custom Image URL field on the map generator page, you'll get jeb on the map).
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #3 on: January 21, 2022, 02:22:09 PM »

Great work, Virginia. Thanks for all the efforts you're putting in this.

A small note on something I realized: It seems that certain browser features such as a blocker for cookie banners indeed block the map from being displayed or even the forum link to be generated (that wasn't the case before). I only use the add-on "I don't care about cookies" because EU laws require all European websites to ask for allowing cookies with annoying banners popping up on almost every website. Now that I deactivated the feature for Talk Elections (not that I would need here anyway), it just works fine. So if anything, it might be more of an issue for European users.

Thanks - I installed that addon but didn't see that behavior. I'll have to keep an eye on it, though. It wouldn't be the first time ad blockers mucked things up here (they did so for the Recommend feature and the new post editor).

Maybe this was already addressed or something, but when I go to the map and do stuff, and then click 'Show Forum Embed Code,' nothing happens - is this intentional, or am I doing something wrong?

Do you see the map fine on the page?

If so and nothing happens when you click that, can you right click on the page, click "Inspect Element", click the Console tab, then send me a screenshot of what it says? If it says nothing, can you keep that console open, reload the page, try to Show Forum Embed Code, then tell me what it says?
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #4 on: January 21, 2022, 02:50:44 PM »

No, it doesn't seem to be showing any map at all. Like usually there's a map above the Show Forum Imbed Code button, but it's not there anymore.

Trying doing a Hard refresh on your browser when on the calculator page. If Windows, hold Ctrl + Press F5. If Mac, follow these instructions:

Quote
Safari (Mac)

    Go to Safari > Empty Cache, or hit Opt + Cmd + E.
    To refresh, click the refresh button on the address bar or press Cmd + R.

Google Chrome

    Windows users: hold down Ctrl and then press F5 on your keyboard.
    Mac users: hold down Cmd and Shift and then press R on your keyboard.
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #5 on: January 21, 2022, 02:57:55 PM »

I'm actually using a Chromebook, how do you do a hard refresh on that? (I did it once but have forgotten how to.)

Also, if this is just a problem for me and everyone else can use maps (not sure), I should be fine because I don't post maps that much anyway.

I think hold Ctrl then click Reload on the browser screen.

I know this fixed it for another user earlier that I was talking to on Discord. The issue in that case was the browser was still trying to use old cached files. If that's the case, alternatively, you could clear your cache for this website or hopefully it'll just automatically refresh within 24-48 hours.
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #6 on: January 21, 2022, 09:11:34 PM »
« Edited: January 21, 2022, 09:15:48 PM by Virginiá »

This is freakin' lit! Thank you so much, As an election map connoisseur, so to speak.

I have a question about state maps? Will they be districts or counties? If counties, that's going to be even more lit!

Oh, and when I try to embed the code, it doesn't appear in the box for me.

Try a hard browser refresh. I don't know why the new files aren't loading in people's browsers right away but it seems to be common for now:

Code:
Safari (Mac)

    Go to Safari > Empty Cache, or hit Opt + Cmd + E.
    To refresh, click the refresh button on the address bar or press Cmd + R.

Google Chrome

    Windows users: hold down Ctrl and then press F5 on your keyboard.
    Mac users: hold down Cmd and Shift and then press R on your keyboard.

(once the expiration date passes on those files - anywhere from 24 hours to 7 days, it should stop being an issue)

The state-level maps are county maps for now. It's my hope that I can organize a community effort after most/all redistricting is done to start making a national congressional map and then maybe also state legislative maps so we can have interactive maps for everything. My goal here over the next couple years is to make this the most useful interactive map generator on the web (for US maps, anyway). I think I've done enough where that's plausible, given all the additions in this update.
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #7 on: January 22, 2022, 03:23:29 PM »

This is amazing.
Only ask I have is that the classic EV calculator be available

It's up to Dave, since it's on his website, but I doubt he would ever take it down. I don't think he updates it anymore but I'd be surprised if he deleted that stuff. If he ever does I'll ask him to keep it up, though. I don't have access to that code unfortunately. That is actually what spurred me to start over on my own.

Damn, thanks for making these

The bold theme's aesthetic is really nice, I think I'll start to use it.

Yeah I really like how that came out. I wasn't sure if everyone else would feel the same so I left it optional, but maybe in the future I'll have it default to it. Some of the maps just look better with it (imo).
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #8 on: January 23, 2022, 07:22:17 AM »

California Recall is missing from 2021 currently.

And FL-SEN 2018 isn't labeled as a flip.

Thanks, will fix.


And while I'm here, how far back do you intend to stretch the Senate and Gubernatorials?

I think 2010 is as far as I planned on going once I have more time to add a few more for each. The Senate maps especially are a bit hard to input by hand.
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #9 on: January 27, 2022, 06:16:07 PM »
« Edited: January 27, 2022, 07:41:16 PM by Virginiá »

Looks like a bug! About to go pick up dinner but when I'm done I'll remedy that for you.

edit:

Does the overlay function require PNG or something?

Fixed.
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #10 on: January 28, 2022, 11:46:44 AM »

Great update!

A minor issue I noticed: It seems like calculator assumes there 55 states, or just counts DC and each ME & NE congressional district as "states". A candidate winning 25 states would be 50% and not 45.5%. Or is that on purpose?



It was a regression bug I caused fixing another bug, lol. It's like whack-a-mole sometimes.

Should be fixed now.
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #11 on: February 03, 2022, 03:40:41 PM »

This update is amazing. I briefly had some issues but I whitelisted the site on my adblocker and they went away.

Here's my wishlist:

1. 2022 Senate/Gub maps
2. Overall Senate maps (with all the states shown)
3. The ability to reduce state EVs below 3 so people can make house maps or something. Just an idea.

Overall Senate map is possible. For EV threshold - I do plan on doing an interactive House map in the future. HCP is graciously working on converting the shapefiles, but it'll probably be released after all the state congressional maps are drawn, both because it's easier that way and because right now I'm still working on the interactive county maps.
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #12 on: March 17, 2022, 02:07:17 PM »

WISHLIST:
-Allow for the editing of total seat numbers in states without seats up that cycle.
-The AZ-Special can't be removed, so hopefully that is solved at some point.

Anyway, great job so far!

Hey, thanks for reporting that. I fixed it just now. Seems to work as expected.
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #13 on: March 26, 2022, 07:44:19 PM »

For some reason the EV numbers are off. For instance 2000 is 268-264.

I just loaded it up, it displays fine for me. Are you sure you were tinkering with it at some point and forgot? It remembers what you were last doing for a few weeks or so.
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #14 on: October 14, 2022, 04:43:48 PM »

For some reason the 2018 Senate map isn't letting me change the flipped seats- for instance, when I seat, say, Florida from R-Gain to normal D, it will show up fine but then will turn back to a gain when I paste the code.

I tested & it did it for me too. I'll look into this. Thanks for letting me know!
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #15 on: November 17, 2022, 11:30:04 AM »

There are a lot of examples where it shows something as wrong, the most extreme example is in 1924, where Wisconsin is won by Herman Farris instead of Robert LaFollette

Thanks - I fixed 1924. It was exhausting putting all this data in by hand so I'm not surprised some of these got screwed up, since I had to alter the way the data was stored several times as the project developed.

Let me know if you see any other incorrect results.
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #16 on: November 17, 2022, 11:33:51 AM »

There are a lot of examples where it shows something as wrong, the most extreme example is in 1924, where Wisconsin is won by Herman Farris instead of Robert LaFollette

Thanks - I fixed 1924. It was exhausting putting all this data in by hand so I'm not surprised some of these got screwed up, since I had to alter the way the data was stored several times as the project developed.

Let me know if you see any other incorrect results.
I will now spend all my free time going over things nobody cares about me just to make it prefect

Make me a sandwich while you're at it.
Logged
Virginiá
Virginia
Administratrix
Atlas Icon
*****
Posts: 18,039
Ukraine


Political Matrix
E: -6.97, S: -5.91

WWW
« Reply #17 on: November 17, 2022, 11:51:24 AM »

In 1796 Maryland casts one more vote than they should have no matter what. All Attempts to reduce either Jefferson or Adams EVs by one will result in the error message. If I get rid of Jefferson, Adams still has one more vote cast than State EVs. This is True no matter what number I set State EVs to.

Electors cast 2 votes (President & Vice President) back then and one of those electors cast votes for both Adams and Jefferson.

Those older elections aren't as a customizable in this map generator yet due to the extra complexities in how votes were done prior to the 12th amendment
Logged
Pages: [1]  
Jump to:  


Login with username, password and session length

Terms of Service - DMCA Agent and Policy - Privacy Policy and Cookies

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Page created in 0.049 seconds with 10 queries.