New electoral vote calculator (user search)
       |           

Welcome, Guest. Please login or register.
Did you miss your activation email?
April 25, 2024, 04:15:26 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 🇵🇸)
  New electoral vote calculator (search mode)
Pages: [1]
Author Topic: New electoral vote calculator  (Read 43836 times)
jimrtex
Atlas Icon
*****
Posts: 11,828
Marshall Islands


« on: November 26, 2020, 10:56:08 PM »

You can't enter free-form text, nor more than two digits.

Consider re-ordering the Nebraska CD's to match the geographical order:

   3  1  2

And vertically align the Maine CD's

   2
   1

Darken the text for the wee states, possibly matching the color code.

States should be in alphabetical order for the human interface. Computers are tools, we are not their servants.
Logged
jimrtex
Atlas Icon
*****
Posts: 11,828
Marshall Islands


« Reply #1 on: November 27, 2020, 12:31:57 AM »



This is close to what I want to be able to create, except:

I wanted to enter 145 for Alabama (just horizontally center text about midpoint of the widest horizontal range in the middle third of the vertical range).

I don't want to have the 0's appear, but I might want text in some States (these are multi-state regions).

If you're working on this, think about having the ability to add PR, VI, NM, GU, and AS. These can be only the boxes. Perhaps have one flag to enable, and then only include those that are actually enumerated (I have a value for PR but not the others).

Darken the text for MA, RI, CT, NJ, DE, MD, DC or possibly match the color.

Add an Orange scale (color 5).
Logged
jimrtex
Atlas Icon
*****
Posts: 11,828
Marshall Islands


« Reply #2 on: November 27, 2020, 12:12:32 PM »

Also, unsure of how to handle custom ev label text in the result boxes (MD, CT, DE, etc...). There is nowhere near enough room for any custom text. Might need to restrict text for those states. There isn't enough space to put the text to the right of the box without widening the entire SVG canvas.
Is the text being clipped? I'm OK with larger numbers overrunning limits on states like NH or VT.

I like the color that is used when a state is highlighted. I'm not sure that you need a change when the state is selected. Perhaps simply highlight the box as well.

Or maybe replace the squares with state shapes (e.g. similar to what is done with Hawaii).

It is hard to switch from graphic to text and back.
Logged
jimrtex
Atlas Icon
*****
Posts: 11,828
Marshall Islands


« Reply #3 on: November 27, 2020, 12:18:15 PM »

So it looks like there currently is a kludge for Jim's desire to have nothing showup in certain States.

I'm working on some ideas for showing text instead of EVs, but it's less thorough than I like. For example I can interpret the EV value in the region array by type, and use it as an EV if it's an integer, and use it as a text label if it's a string. My hangup is that it's totally not the way I'd do this if I were including that feature from the start. The way I would normally do it is to allow BOTH evs and label text, so the EVs would at least show up in the EVBar and tooltips. I probably should have made the region entry an object, not an array, so I could structure it better.

I'll continue mulling it over.
I'd be content with this. I'd prefer to be able to able to leave the first value null. Currently this won't display anything.

Is there a way to turn off the tool tips?
Logged
jimrtex
Atlas Icon
*****
Posts: 11,828
Marshall Islands


« Reply #4 on: November 27, 2020, 03:37:21 PM »

Is there a way to turn off the tool tips?

Yes, an undocumented option:

"useTooltips":false

Add it into the options:{} object, like the other options (if you don't insert it correctly, map will likely error instead of displaying).
Thanks.

I think I would follow better if the the legend MA was always visible (black) and if I run the cursor across either the state or the box, both the state outline and box outline were highlighted. I think most people know where Massachusetts is and what it looks like. But now you have to translate in your mind that corresponds to MA and that the box next to it is the electoral vote.
Logged
jimrtex
Atlas Icon
*****
Posts: 11,828
Marshall Islands


« Reply #5 on: November 28, 2020, 05:14:33 PM »

As part of an effort to modernize some parts of this forum, I've redone the EV calculator completely. You can check it out here:

I've done extensive testing so far, but there might still be some bugs, so if you notice anything, please let me know.

This will just be the first version of this map generator. I'm already working on expanding to state-level maps and senate prediction maps, and maybe more into the future, a congressional map.

I love the new map generator so much. 🥰
SO MUCH that I don't even dare to make an improvement proposal... 😨
There's one little thing on Dave's maps that is, in my estimation, in need of improvement:
There is no implied geographical significance as to the location of the squares in states with split electoral votes. I wish that would be changed for reasons of clarity and comprehensibility.
As they say in Aksarben. that's as as easy a 3, 1, 2.
Logged
jimrtex
Atlas Icon
*****
Posts: 11,828
Marshall Islands


« Reply #6 on: November 30, 2020, 09:41:35 PM »

Just one thing, I think the colors for Lean are too dark. The tilt colors are more what I imagine for leaning states, and tilt should be even lighter than that

Amazing work!

I agree - I've changed the shading to reflect it better.

One thing I did notice was that the default rankings when you load an election do not properly reflect reality, but this is because I don't have the exact election results to work with. The data sets it uses are no more detailed then the calculator page (30%, 40%, 50%, etc), so I can't tell if a state was won by 51% or 59%. So it is really up to the user to fill out the prediction map.

At some point I might try to code a script to crawl Wikipedia to get the exact percentages, or maybe see if Dave would collaborate on it.

Notice something wrong with NE and ME?

I fixed the issue, but unfortunately, due to the nature of the problem, only new maps from this point on will not have the problem. It was an issue with how the bbcode data was built, not displayed.
What is the fourth field for each State?
Logged
jimrtex
Atlas Icon
*****
Posts: 11,828
Marshall Islands


« Reply #7 on: December 28, 2020, 06:16:27 PM »

Meant to do just a small feature update for adding custom labels but somehow have gotten roped into much more in trying to add pre-1840 elections. I think I see why Dave didn't do those years. It's a lot of work to actually get it right. Electoral votes in that time period start getting assigned in all sorts of ways the further you go back, with the common thread being that the winner of the state does not always get all the EVs. So now I'm basically adding faithless electoral vote support way ahead of schedule so as to support pre-1840 maps.

On a side note, would anyone be interested in extending the territory maps on Wikipedia? It's SVG format, and most of the territories are done, but as you can see in pre-1840 maps, since the states are all on the eastern US, the original map authors didn't draw the full territories (they just cut off arbitrarily). I'd like to incorporate these territories at some point, but I would need the full territory paths across the entire US, and not just portions of them, making sure to properly label each territory in the element attribute(s).

If you're interested, the easist way to contribute would be to just complete the maps on Wikipedia for elections prior to 1844. The goal would be something like this.


I could try doing some maps in QGIS but I'm not sure how well I can match the design to what's on wikipedia.

What is the objective?

Do you (Virginia) want maps with the modern territorial extent of the United States? Should such maps include PR, VI, GU, AS, and MP? In this case there could be an inset map of PR and VI in the Gulf of Mexico or on top of the Bahamas, along with a box for VI, and boxes for MP, GU, and AS.

For each year, there would be the boundaries as they existed at that time. Areas outside the US at a particular election (e.g. Gadsden Purchase, Alaska and Hawaii) could be assigned to a quasi territory which the Atlas App could include or exclude as appropriate. These maps could then be used as the basis for presidential and congressional (including delegate) maps, and other elections.

The underlying code could then be paired with other series of maps (county maps) along with associated data; or even other countries. And if the design is sufficiently generalized even custom maps could be used.

I assume what happened with Wikipedia was that a map of indefinite extent was created and then windowed to an area of interest for which the .svg file was created.

It might be easier to recreate the original map, rather than rely on the Wikipedia version (or obtain the underlying map for the Wikipedia map). I'm assuming that if I were to create a .svg map showing the modern territorial extent for the USA for the 1788/9 election, that my edit would be countermanded by someone who preferred the contemporary extent.
Logged
jimrtex
Atlas Icon
*****
Posts: 11,828
Marshall Islands


« Reply #8 on: January 08, 2021, 02:45:13 AM »

What is the objective?

Do you (Virginia) want maps with the modern territorial extent of the United States? Should such maps include PR, VI, GU, AS, and MP? In this case there could be an inset map of PR and VI in the Gulf of Mexico or on top of the Bahamas, along with a box for VI, and boxes for MP, GU, and AS.

Just a basic recreation of the state and territory map of the continental US. Adding places like VI/GU/etc is a bit much for the scope of this project.

To reduce data size, it would be preferable to have as few territorial changes as possible while still reflecting the general lay of the land. In other words, if there were minor changes to a territory between two elections, it doesn't necessarily have to be implemented.

It might be easier to recreate the original map, rather than rely on the Wikipedia version (or obtain the underlying map for the Wikipedia map). I'm assuming that if I were to create a .svg map showing the modern territorial extent for the USA for the 1788/9 election, that my edit would be countermanded by someone who preferred the contemporary extent.

Thinking about it more, probably - yes. Posting the map here would be fine then too.

I don't think this effort serves a whole lot of purpose other than filling out the map generator for aesthetics. I think it's probably rare that users even use those presidential years for their maps. Nevertheless, it would be nice to have, so if anyone is ever bored and wants to do it, I'll integrate it so long as it fits the exact boundaries/specs of the map currently in use by the calculator (in other words, I need to be able to just add the territory paths to the paths array and have it just 'fit' into the map without adjusting other regions).
I don't understand what the paths array is.

I noticed on an 1840 map, that VA is correctly portrayed including modern-day WV. But that if "WV" is included in the parameters for the map, it is drawn on top of VA.

So let's take 1788.

You would want a map with 14 territories.

1. NH
2. MA would include both MA and ME (and we could be indifferent to the territorial extent of Maine, just going with the modern boundary). Clearly the software can handle disjoint areas (e.g. HI).
3. RI - even though it had not acceded to the Constitution, it could be used in what if scenarios since it did have known number of electors.
4. CT
5. NY
6. NJ
7. PA
8. DE
9. MD (would include territory of DC north of the Potomac)
10. VA (would include modern territory of VA, WV, KY.
11. NC (would include modern territory of NC and TN) even though NC had not acceded to the Constitution, it could be used in what-if scenarios since it did have known number of electors.
12. SC
13. GA (including modern MS and AL, excluding their panhandles).
14. Northwest Territory using modern Canada-USA boundary.

You would then be able to reproduce something like the map in Wikipedia.

https://en.wikipedia.org/wiki/1788%E2%80%9389_United_States_presidential_election

It would be up to your application to differentiate between NWT, NC and RI, and NY.

Does the rest of the map show the modern US extent including AK and HI insets? Would VT be included as a quasi-territory?

I think it would be best to include a date with the map. Your application could select which to use.

Are the boxes part of the map, or a legend?
Logged
jimrtex
Atlas Icon
*****
Posts: 11,828
Marshall Islands


« Reply #9 on: January 16, 2021, 06:29:26 PM »

How close is this to what you would want for a 1789 election?



Notes and Questions:

(1) I can (will) use a more generalized scale for state boundaries.

(2) I will include Northwest Territory.
(2a) Do the codes have to be two letters?

(3) I could include Vermont within New York outline, or include Vermont as a separate territory.

(4) Do you want early maps to be over on the right edge of the image. That is all maps would be drawn with the same scale and extent.

(5) It is assumed that the application would understand the status of NC and RI, and why there were no electoral votes for NY.
Logged
jimrtex
Atlas Icon
*****
Posts: 11,828
Marshall Islands


« Reply #10 on: January 17, 2021, 10:27:29 PM »

Right, so it looks like for the existing SVG data the map generator uses, Georgia would just need to be merged with AL/MS, NC merged with TN, and VA merged with WV/KY.

What I meant by the paths array is that most if not all of the regions on the map are implemented via a <path> html element, so each region has to essentially be 1 path element.
This version has coarser digitization, but I'd like to have little less detail. It also includes the Northwest Territory and the Erie Triangle.

Note that Georgia did not include West Florida including the AL and MS panhandles.



So you would like a suite of paths for the various states and territories, as well as a list of which paths should be used for each year?

I don't speak .svg. QGIS can apparently produce such a file.

How does your 1840 map know to use the Virginia as it existed at that time?
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.042 seconds with 12 queries.