alex / nyt-2020-election-scraper Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://alex.github.io/nyt-2020-election-scraper/battleground-state-changes.html
License: MIT License
Home Page: https://alex.github.io/nyt-2020-election-scraper/battleground-state-changes.html
License: MIT License
Not sure what's happening in the GA remining votes column, but this was just released in a presser from GA election officials.
As I said in this comment, the current logic for notifications is imperfect in that they trigger when the site deploys with a change to the HTML rather than a change to the underlying data.
I'm not really sure how we could distinguish the two, honestly. We could hack around it by creating a separate file to track just the data that'd be updated every time the data updates (and then check for updates to that file rather than the generated HTML), or change the commit message when it is/isn't a data update.
I'd argue state flags are less universally recognizable vs the shape of the state.
https://www.fontsquirrel.com/fonts/stateface
OTF available
Please look at percentages and the vote count on Pennsylvania.
While scrolling down with 'shrink table mode' is buggy since the header for each state is overlapping on the data which is displayed
I think that you something like this
function sum_changes(data) {
var sumchange = 0;
$(data).find('.table').each(function() {
$(this).find('tbody tr').each(function() {
sumchange += parseInt($(this).find('td:nth(4)').text().replace(/,/g, ''));
})
});
return sumchange;
}
Then something like
var delta = sum_changes(newContent) - sum_changes(document);
new Notification("New ballots(" + delta + ") were counted!");
This is such an awesome resource.
Is there any way we could get the rows per state limited? If not via a UI element, then maybe via URI params or something?
This is an awesome resource, thank you for putting it together. Is it possible to add a table to the top of the page with each state's most recent update?
Eyes are getting strained, would love a dark mode toggle
Would y'all have any interest in me adding some visualization capabilities? Something like this?
https://colab.research.google.com/drive/19NmdUU-twMK83XbK5GwzYJ1NK2kYCEAI?usp=sharing
Sorry if this doesn't align with "issues", i'm new to contributing to OSS
I see you have no LICENSE file for this project. The default is copyright.
I would suggest releasing the code under the GPL-3.0-or-later or AGPL-3.0-or-later license so that others are encouraged to contribute changes back to your project.
For the Shrink Tables
mode, I would hide blocks with no votes. Alternative, the blocks with zero votes don't seem particularly useful, so I would consider hiding them entirely.
Wanted to say thank you to everyone involved.
Thank you!!
Would it be possible to display totals for each candidate in each state? Total votes, percentage and difference between those two sets of number - similar to what standart news networks show in their infographics.
This is greatest tool to watch the trend I saw on the net but I need to switch to CNN and back to get the whole picture.
Maybe caused by #76? Revert and rework?
Hi, I'm trying to run the python file, but am getting this error: ModuleNotFoundError: No module named 'git'
.
I ran pip install -r requirements.txt
. Anyone else run into this?
the global expand/collapse tables feature is nice. But even better would be a feature to individually expand/collapse tables
Could we add a toggle just to inverse the background/text?
Currently the timestamp is associated with the UTC timezone, but is not being adjusted based on the browser's timezone. This causes timestamps to be displayed as times in the future for US time zones. See:
Would be good to add some simple javascript to offset based on browser timezone or use a US timezone for easy adjustment.
rather than having to scroll through
Thoughts on producing an rss file of the latest batches to drop?
perhaps a colored background or a 🟢 / 🔴 icon
I think the NYT pct is inaccurate. According to the GA sec of state site, there were 90,735 votes left to count at 1015pm 4 Nov. See:
https://sos.ga.gov/index.php/elections/with_90735_votes_out_officials_focused_on_getting_it_right
Filter out blocks over selectable amount of time - for example, older than 1 hour, 5 hours, 1 day
Perhaps not a coding issue at all, but does anyone have an explanation for the perfect 50.0% - 50.0% vote tallies for North Caroliona? It seems unlikely that new votes would break so precisely and so consistently. Also, some voting blocks have odd numbers of votes, but still 50.0% allocation to each candidate. How is that possible?
Thanks for making this!
Although it's not accurate, I think all of us are trying to figure out where the states are going to end up, and by how much margin.
So suggest something like this:
Arizona: Biden leads with 1,000,000 votes. Current trend with 10,000 votes remaining will have Trump winning by 300 votes.
Great tool! Would be nice if we can remove/reorder a state up or down.
I'm observing Georgia and the last 6 updates have decreased the remaining votes left to count, but zero change. Is something up with the code or is it reporting erroneous data?
NV & NC haven’t changed in ages. The ability to hide certain states, that would persist through a refresh, would save real estate.
Great work so far!
First of all, thank you for this awesome repo! I am currently using it in my simple viz.
Not really an issue but I think it would be nice if we can add a showcase section? Apps that are using this data.
I referenced this repo in my app's repo https://github.com/wobsoriano/election2020. Thanks!
This is awesome! How about a Last updated, Latest batch received on the top like on the text-only version of the report (so we can tell if there are new updates without scrolling the whole page)
The use case for me to answer the question 'which states are going to flip?', or 'will my candidate win this state?"
To do this requires hurdle, then finding Block trend, so suggest putting them closer together.
Current:
Block Breakdown | Block Trend | Precincts Reporting | Hurdle
to:
Precincts Reporting | Hurdle | Block Trend | Block Breakdown (this reads better — Biden needs 50%, block trend is 52%)
or
Precincts Reporting | Block Breakdown | Block Trend | Hurdle
or even
In the Lead | Hurdle | Block Trend | Block Breakdown | etc.
Or let me rearrange columns myself!
Thanks again for putting this together. You're amazing!
I think it'd be great if we could see running totals based on the current candidate's percentage from the latest blocks- I tried to do this but ended up finding difficulty in the iterative nature of the actual output HTMLs.
I just want to hang out with everybody else who is staying up late and constantly refreshing this site.
It seems the website did not update with latest information from the Arizona, and Georgia which was reflected on NYT website.
Suggestion: Do the math for us — if block trend > hurdle.
Currently cannot see the ‘tool tip’ text that the [i] buttons show on desktop.
Perhaps on iOS, make into buttons that display a pop-up or dialogue?
This is an awesome tool, thanks a ton for putting it together. :) If I could be so bold, would you be willing to add a column showing the gain/loss for a candidate for every change? You could make it the gain/loss for the candidate that is behind (but I'm agnostic on that front). I can calculate it in my head but it would be nice to see the exact number.
The table header for each of the states is incorrectly placed when scrolling such that the header is not visible at the top of the table. Either, the top line of the header (the one that says the state's name as well as the current total vote count for each candidate) does not come down with the column labels, or the column labels are positioned so that part of the table is visible above the header.
See image below for demonstration of problem. I am using the latest version of Google Chrome, 1920x1080 resolution.
Please let me know if you need any more information. Thanks so much for this awesome resource!
Is it please possible to not have the first cell be a th? It forces screen readers to constantly read that out before hearing the value of each cell, which is all but unusable, and this data is otherwise so well structured.
So, where it says:
Arizona (EV: 11)
Can that please be a td or hopefully a caption, but just not a th please? That one fix, an 'h' to a 'd' will enable blind folks to hear this data so much more easily.
I would file a PR, but since I'm blind I don't know if I'll mess up your styling with the markup change.
Thanks in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.