Giter Site home page Giter Site logo

tonmcg / us_county_level_election_results_08-20 Goto Github PK

View Code? Open in Web Editor NEW
350.0 26.0 326.0 50.58 MB

United States General Election Presidential Results by County from 2008 to 2016

Jupyter Notebook 96.51% Shell 0.41% HTML 3.08%
county-level-election election-data election-results presidential-election census-data

us_county_level_election_results_08-20's Introduction

United States General Election Presidential Results by County from 2008 to 2020

DOI

Presidential election results for 2008, 2012, 2016, and 2020 from The Guardian, townhall.com, Fox News, Politico, and the New York Times.

2008 election results at the county-level compiled by GitHub user @wboykinm.

2012 election results at the county-level are taken from results published in an Excel file by the Guardian.

2016 election results at the county-level are scraped from results published by Townhall.com. Their well-formatted county-level result tables for the 2016 presidential general election makes it easy for a web scraper like beautifulsoup to capture results.

2020 election results at the county-level are scraped from results published by from Fox News, Politico, and the New York Times.

Idea for 2012 election results from tweet to John A Guerra Gomez. Idea for 2016 election results from tweet to DJ Patil.

Interactive choropleth map of the 2020 presidential election results created by Tony McGovern using Vue, Vuetify, and D3. Static choropleth and dot-density maps of 2020 presidential election results also created by Tony McGovern using the Mapshaper Command Line Tool. See the section below on how to use this tool to create these static maps.

Creating Maps of 2020 Presidential Election Results

This repository relies on data from various newspapers that report 2020 presidential election results at the county-level for all U.S. states, with the exception of Alaska and Washington, D.C., which are reported at the house district- and ward-level, respectively. Whether county-, house district-, or ward-level, each election result is tied to a specific U.S. geography by a unique 5-digit code that represents that geography, called a FIPS code. The U.S. Census Bureau Geography Division (Geography Division) identifies and provides cartographic boundary files for, and assigns a unique FIPS code to, each geography. For a brief explanation on the derivation of the FIPS code, navigate to this page maintained by the Geography Division.

The goal here is to bind 2020 presidential election results to U.S. cartographic boundary files and convert them into a format that can be easily displayed in a web browser. We use the Mapshper Command Line Tool to help create both choropleth and dot density maps.

Choropleth Map

  • Create a directory to hold cartographic boundary files for all election year results within this repository
mkdir cartography
cd cartography
mkdir 2020 2016 2012 2008
  • Navigate to the /2020 directory
cd 2020

U.S. Counties

  • Download and unzip U.S. county cartographic boundary files
curl 'https://www2.census.gov/geo/tiger/GENZ2019/shp/cb_2019_us_county_500k.zip' \
    -o cb_2019_us_county_500k.zip
unzip cb_2019_us_county_500k.zip
  • Input the U.S. county shapefile
  • Filter out certain states, including Alaska -- which we will process separately -- and other U.S. protectorates that we do not have data for
  • Create the following new properties:
    • geoid: combination of STATEFP and COUNTYFP, or FIPS code
    • state_fips: two digit state FIPS code based on STATEFP
    • county_name: name of the county based on NAME
  • Filter out all other fields
  • Simplify the layer using the default algorithm, retaining 2% of removable vertices
  • Convert the Shapefile into the Albers USA projection
  • Output a TopoJSON file named us_counties.json
mapshaper \
    -i cb_2019_us_county_500k.shp name=us_counties \
    -filter 'STATEFP !== "02" && STATEFP !== "69" && STATEFP !== "66" && STATEFP !== "78" && STATEFP !== "60" && STATEFP !== "72"' \
    -each 'geoid=STATEFP + COUNTYFP,state_fips=STATEFP,county_name=NAME' \
    -filter-fields 'geoid,state_fips,county_name' \
    -simplify 2% \
    -proj albersusa \
    -o format=topojson us_counties.json \
    -o format=geojson us_counties.geojson

The result of these commands should output a TopoJSON file that looks like the image below. Notice how Alaska is missing from this image: us_counties

Alaska

Unlike other states within the United States, Alaska does not administer its presidential elections at the county-level but rather at the lower chamber legislative district, or the House District. To show results at the Alaska House District-level, we must download cartographic boundary files from the same Geography Division Cartographic Boundary Files page and process each of the 40 house districts separately from the county-level files.

  • Download and unzip Alaska lower chamber legislative district cartographic boundary files
curl 'https://www2.census.gov/geo/tiger/GENZ2019/shp/cb_2019_02_sldl_500k.zip' \
    -o cb_2019_02_sldl_500k.zip
unzip cb_2019_02_sldl_500k.zip

We now translate and assign each of these 40 house districts a unique FIPS code defined the following way:

  • ssSdd, where ss is the state FIPS code, S is a catch-all statewide code, and dd is the house district.

For example, the FIPS code attached to election results for Alaska House District 01 is 02901: '02' represents the state FIPS code for Alaska, '9' is a catch-all statewide code, and '01' represents House District 01.

Each house district in the shapefile contains a number of properties that describe the district. These properties include a unique identifier, the House District number, and geographic descriptions of the district, among other properties. For our purposes, we want to create properties that will allow us uniquely bind 2020 presidential election results to the Alaska geographic layer.

  • Input the Alaska House District shapefile
  • Create the following new properties:
    • district_n: a unique, zero-padded, two-digit Alaska House District number based on the SLDLST property
    • county_name: combination of "House District " and district_n
    • state_fips: the state FIPS code given by STATEFP
    • state_name: "Alaska"
    • geoid: combination of state_fips, "9", and district_n
  • Filter out all other fields
  • Simplify the layer using the default algorithm, retaining 2% of removable vertices
  • Convert the Shapefile into the Albers USA projection
  • Output a TopoJSON file named alaska_districts.json
mapshaper \
    -i cb_2019_02_sldl_500k.shp name=alaska_districts \
    -each 'district_n=Number(SLDLST).toString().length === 2 ? Number(SLDLST).toString() : new Array(2 - Number(SLDLST).toString().length + 1).join("0") + Number(SLDLST).toString(),county_name="House District " + district_n,state_fips=STATEFP,state_name="Alaska",geoid=state_fips + "9" + district_n' \
    -filter-fields 'geoid,state_fips,county_name' \
    -simplify 2% \
    -proj albersusa \
    -o format=topojson alaska_districts.json \
    -o format=geojson alaska_districts.geojson

The result of these commands should output a TopoJSON file that looks like the image below: alaska_districts

U.S. Election Results

Our goal is to generate a single TopoJSON file that a) contains multiple geometry objects from the us_counties.json and alaska_districts.json TopoJSON files, b) colors the geographies by the results of the 2020 election, mapped to the standard Red-Blue quantiles, and c) displays three levels of geographic boundaries: county-, state-, and national-level. We also want to produce a SVG file that also displays these election results.

  • Download 2020 U.S. county-level election results
curl 'https://raw.githubusercontent.com/tonmcg/US_County_Level_Election_Results_08-20/master/2020_US_County_Level_Presidential_Results.csv' \
    -o 2020_data.csv
  • Combine and merge the alaska_districts.json and us_counties.json layers into a new layer
  • Add DOM attributes to the county-level output, inlcuding stroke, stroke-width, and class
  • Output a new us_district_boundaries.json TopoJSON file
  • Input the us_district_boundaries layer
  • Using the -dissolve command with state_fips as the field to dissolve on, this step merges adjacent polygons on the state_fips layer, thereby erasing shared boundaries and showing only the state-level boundaries
  • Add DOM attributes to the state-level output, inlcuding stroke, stroke-width, and class
  • Output a new us_state_boundaries.json TopoJSON file
  • Input the us_state_boundaries layer
  • Using the -dissolve command with no named input fields to dissolve on, this step merges adjacent polygons for the entire layer, thereby erasing all shared boundaries and showing only the national-level boundary
  • Add DOM attributes to the national-level output, inlcuding stroke, stroke-width, and class
  • Output a new us_boundaries.json TopoJSON file
  • Input the us_district_boundaries.json TopoJSON file. We name the layer us_election_districts
  • Input the 2020_data.csv file, containing the county-level results of the 2020 presidential election
  • Join the election data on to the us_election_districts layer
  • Use the -colorizer command to create a JavaScript function that accepts a numerical input and returns a color defined by a quantized range of values
  • Assign the returned color as the value in fill DOM attribute
  • Ouptut a new us_election_districts TopoJSON file
  • Combine and merge the us_election_districts.json, us_state_boundaries.json, and us_boundaries.json layers into a new layer
  • Output a new us_election_results TopoJOSN file
  • Output a new us_election_results SVG file
mapshaper \
    -i alaska_districts.geojson us_counties.geojson combine-files name=us_district_boundaries\
    -merge-layers \
    -style class="county" stroke="#000000" fill="none" stroke-width="0.1" \
    -o format=topojson us_district_boundaries.json \
    -o format=geojson us_district_boundaries.geojson \
    -i us_district_boundaries.geojson name=us_state_boundaries \
    -dissolve state_fips \
    -style class="state" stroke="#ffffff" fill="none" stroke-width="1" \
    -o format=topojson us_state_boundaries.json \
    -o format=geojson us_state_boundaries.geojson \
    -i us_district_boundaries.geojson name=us_boundaries \
    -dissolve \
    -style class="us" stroke="#000000" fill="none" stroke-width="0.5" \
    -o format=topojson us_boundaries.json \
    -o format=geojson us_boundaries.geojson \
    -i us_district_boundaries.geojson name=us_election_districts \
    -i 2020_data.csv string-fields=county_fips name=2020_data \
    -join target=us_election_districts 2020_data keys=geoid,county_fips \
    -colorizer name=getColor colors='#2A71AE,#6BACD0,#BFDCEB,#FACCB4,#E48268,#B82D35' breaks=0.1667,0.3334,0.5,0.6667,0.8334 \
    -style fill='getColor(per_gop)' \
    -o format=topojson us_election_districts.json \
    -o format=geojson us_election_districts.geojson \
    -i us_election_districts.geojson us_state_boundaries.geojson us_boundaries.geojson combine-files name=us_election_results \
	-merge-layers force \
	-o format=topojson us_election_results.json \
    -o format=geojson us_election_results.geojson \
    -o us_election_results.svg

The result of these commands should output a TopoJSON file that looks like the following: us_election_results

Dot Density Map

Dot density maps are useful to show where things are clustered. Showing raw counts of votes among U.S. counties rather than relative differences between U.S. counties, the dot density map below illustrates that the most votes tend to come from counties that house large, urban populations.

mapshaper \
    -i us_district_boundaries.geojson name=us_election_districts \
    -points inner + name=dots \
    -i 2020_data.csv string-fields=county_fips name=2020_data \
    -filter-fields county_fips,votes_gop,votes_dem \
    -each 'margin = votes_gop - votes_dem' \
    -each 'abs_margin = Math.abs(margin)' \
    -join target=dots 2020_data keys=geoid,county_fips \
    -sort abs_margin descending \
    -style r='Math.sqrt(abs_margin) * 0.02' \
    -style opacity=0.5 fill='margin > 0 ? "#B82D35": "#2A71AE"' \
    -lines state_fips target=us_election_districts \
    -style class="county" stroke="#ddd" fill="none" stroke-width="0.1" where='TYPE === "inner"' \
    -style class="us" stroke="#000000" fill="none" stroke-width="0.5" where='TYPE === "outer"' \
    -style class="state" stroke="#000000" fill="none" stroke-width="0.5" where='TYPE === "state_fips"' \
    -o us_dot_election_results.svg target=us_election_districts,dots

The result of these commands should output a SVG file that looks like the following: us_dot_election_results

To run

Place in your favorite iPython / Jupyter notebook environment.

If you don't have one, get Docker and use:

./run-notebook.sh

in a shell based environment. Or open up the shell command and issue the docker command in a Windows environment.

us_county_level_election_results_08-20's People

Contributors

hodgesmr avatar joonro avatar slarson avatar tonmcg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

us_county_level_election_results_08-20's Issues

2020 DC results are inaccurate

While a lot of the numbers I am seeing appear to be off from other sources like New York Times, I would expect that especially if these haven't been updated. However, In 2020 it shows that District of Columbia has 29,509 votes for democrat and 1,149 for GOP, which is roughly a tenth of the votes reported by other sources.
DC

2016 county name

Describe the error
The column 'county_name' in the 2016 csv is actually the state name. No county name is included.

To Find
Steps to find the error:

  1. Go to 2016_US_County_Level_Presidential_Results.csv
  2. Look at the column 'county_name'
  3. See error

Switch topojson reference in interactive visualization

Is your feature request related to a problem? Please describe.
The D3 visualization currently references a U.S. county toposjson created by Mike Bostock from 2017 cartographic boundary files. Moreover, alaska election results are not at the county level but rather, at the house district level. The cartographic boundary files are out of date for continental and Hawaii counties and are simply wrong for Alaska.

Describe the solution you'd like
Use mapshaper to create a U.S. house district and county level topojson file from original shapefiles provided by the U.S. Census Geography Division.

Describe alternatives you've considered
Currently using the 10m.json file provided by Mike Bostock from his d3 topojson repo.

Add narrative to README explaining 2020 TopoJSON files

Is your feature request related to a problem? Please describe.
No narrative exists to explain US and Alaska TopoJSON files for 2020 results.

Describe the solution you'd like
Create a narrative in the README to explain US and Alaska TopoJSON files for 2020 results.

Describe alternatives you've considered
None.

Add link to app data

Is your feature request related to a problem? Please describe.
Users may want to view or download the original data and no direct method currently exists

Describe the solution you'd like
Add a note to both the map and table that links to the data used by the app

Describe alternatives you've considered
None.

Create a Jupyter notebook that compiles the results of the U.S. 2020 election

Is your feature request related to a problem? Please describe.
There currently does not exist a Jupyter notebook that compiles the results of the 2020 election found on this repo.

Describe the solution you'd like
Create a Python-based Jupyter notebook that creates the geographies and vote totals of the U.S. 2020 presidential general election

Describe alternatives you've considered
No other alternatives exist.

Additional context
None.

Data update

Is there any chance the Presidential election results will get updated with the more recent counts?

Add data sources note

Is your feature request related to a problem? Please describe.
Users should understand where the data come from.

Describe the solution you'd like
Add a note to both the map and table that defines the source of the data.

Describe alternatives you've considered
None.

Create election district topojson file

Is your feature request related to a problem? Please describe.
The current topojson file used in the election visualization is sourced from Mike Bostock's work. It is of 2017 U.S. counties and does not include Alaska election districts.

Describe the solution you'd like
Create a topojson file that includes 2019 U.S. counties and Alaska election districts using the Albers USA projection and is consumable by D3.

Describe alternatives you've considered
No Alaska included in the viz.

Add image to display dot density election result to README

Is your feature request related to a problem? Please describe.
No image exists to display the dot density election results

Describe the solution you'd like
Add an image to display the dot density election result to README

Describe alternatives you've considered
None.

results don't match Guardian file

I downloaded 2012 results from the Guardian here

https://www.theguardian.com/news/datablog/2012/nov/07/us-2012-election-county-results-download

and used read.table() to bring your updated results into R. From the Guardian table, I'm just taking their summary results rather than the raw vote counts.

It looks like they don't quite match up:

GEOID Romney-pct-Guardian Romney-pct-Tonmcg Difference
10001 46.8 49.81482 -3.0148223
10003 32.2 32.70266 -0.5026634
10005 55.9 59.16703 -3.2670289
15003 29.8 31.60706 -1.8070610

The average difference is -3.

Trimmed leading zeros for FIPS

County FIPS are a five-digit key. The counties with a leading zero have been trimmed so that joining to another file with the full FIPS code will likely fail.

Refactor legend to use Vuetify components

Is your feature request related to a problem? Please describe.
D3-legend requires a lot of DOM manipulation. It would be better to use Vuetify components (perhaps ratings?) to make changes to the data instead of the DOM.

Describe the solution you'd like
Refactor the current legend to use Vuetify components that change the Vue data property instead of trying to manipulate the DOM directly.

Voter Registration Data.

County election data would be far more useful if it include Day of Election Voter Registration Data by county. Going back to 2000 might be too much of an ask. but 2020 and 2016 would be of substantial usability.

Errors in 2008 election

Laporte County has 46k democrat and republican votes but (allegedly) 209k total votes.

Correct values from https://laporteco.in.gov/Elections/ElectionResults/2016General/index.htm

      "total": 47000
      "dem": 28247
      "gop": 17911

Laclede County has 15k democrat and republican votes but (allegedy) 2k total votes

Correct values from http://www.city-data.com/elec08/LACLEDE-MISSOURI.html

      "total": 16323
      "dem": 5218
      "gop": 10875

Washington County has 1.2k democrat votes vs 17k republican votes. This appears to be a typo (an omitted "6") (Edit: also note that this seems reasonable since the 2012 election has 11k democrat votes)

Correct values from https://en.wikipedia.org/wiki/2008_United_States_presidential_election_in_Ohio

      "total": 29932
      "dem": 12368
      "gop": 17019

Refactor visual to use Vuetify Framework

Is your feature request related to a problem? Please describe.
Much of the visualization requires lots of DOM manipulation to changes in data.

Describe the solution you'd like
Add Vuetify references to the visual so that components can easily be added that make use of the virtual DOM for changes in data

Add GitHub icon

Is your feature request related to a problem? Please describe.
There is no mention of this GitHub repo in the app.

Describe the solution you'd like
Add a GitHub icon that links to this repo

Describe alternatives you've considered
None.

2020 certified county results needed.

All States other than Hawaii have certified results at the county level.. This has led the vote totals as presently presented to be substantially incorrect. Can we get these updated?

Change data attribution in viz

Is your feature request related to a problem? Please describe.
The data attribution reads as if Tony McGovern is the source of election data.

Describe the solution you'd like
Change "Data courtesy of" to "Data compiled by" which is closer to the tructh

Some data inconsistencies/errors

Per here:

http://www.lacledecountymissouri.org/clerk/electresults/files/naccum.pdf

The Dem/GOP totals are correct for 2008, but both exceed the total_2008 field.

The other_2008 field also appears to exclude write-ins? I don't know what the rule is in the overall data for this.

Appears this should be 16,379 (or 16,477 -- the former comes from totaling all counts for presidential votes).

2012 numbers are also out of sync, but the error margins appear minimal, so it cold just be a matter of data record timing...

http://www.lacledecountymissouri.org/clerk/electresults/files/totalsn12.pdf

Some other inconsistencies, all from 2008:

  • Sauk County, WI. Democrat vote total should be 18,617 (transposed in this data to 18,167). Source
  • Ottawa County, OH. Vote total should be 23,475. Democrat total should be 12,049. Other total should be 401. Source
  • LaPorte County, IN. Total votes cast is 48,107. Democrats got 28,247. GOP got 17,911. Others had 842. Source
  • Platte County, MO. Total should be 46,640. Dem is 21,459. Other is 721 (560 if excluding write-ins) Source

Data Issues in 2008

The following 5 counties have inconsistent data for 2008 (ref issue #10 for detailed info on Indiana). (NOTE: this integrity check was applied to all other counties for 2008-2016; these 5 the only counties with inconsistencies).

ReportedTotal = TOTAL_20XX value report in .csv's
CalculatedTotal = sum of gop+dem+oth for each year
Diff = calculatedtotal - reportedtotal

StateName,CountyName,ElectionYear,ReportedTotal,CalculatedTotal,Diff
Indiana,LaPorte County,2008,208757,46919,-161838
Missouri,Laclede County,2008,2024,16323,14299
Missouri,Platte County,2008,46480,46516,36
Ohio,Ottawa County,2008,23069,23084,15
Wisconsin,Sauk County,2008,30626,30176,-450

image

image

Make sure 2020 iPython notebook installs correct versions of packages on any environment

Is your feature request related to a problem? Please describe.
Ensure the iPython notebook installs the correct versions of packages irrespective of environment.

Describe the solution you'd like
From Jake VanderPlas:

Fundamentally the problem is usually rooted in the fact that the Jupyter kernels are disconnected from Jupyter's shell; in other words, the installer points to a different Python version than is being used in the notebook.

The following lines of code should be added so that packages are installed and run correctly in the Jupyter notebook regardless of envirnoment.

import sys
!{sys.executable} -m pip install pandas
!{sys.executable} -m pip install lxml

Describe alternatives you've considered
None.

Create topojson of 2019 state and county boundaries for 2020 results

Is your feature request related to a problem? Please describe.
No topojson file exists to visualize the geographies the data in this repo contains.

Describe the solution you'd like
Create a topojson that contains a Albers projection of the United States that has both state-level and county-level layers from the 2019 cartographic boundary files published by the U.S. Census Bureau Geography department. Lo Bénichou put together a great tutorial on how to use mapshaper.org to do this.

Describe alternatives you've considered
No alternatives exist.

Additional context
This topojson will be used to visualize the data in this repo. Topojson should not include Alaska county-level boundaries since the data for 2020 are at the Alaska House District level.

Fix topojson reference in viz

Describe the bug
The interaction visualization does not correctly reference the U.S. district and county level topojson file

Add GeoJSON output files of 2020 election results

Is your feature request related to a problem? Please describe.
This repository makes TopoJSON layers available of 2020 election results but does not have GeoJSON layers, which is more ubiquitous in map making.

Describe the solution you'd like
Add GeoJSON output files of U.S. county geographies, Alaska House Districts geographies, and 2020 election result layer.

Describe alternatives you've considered
Only TopoJSON.

Create dot density topojson file

Is your feature request related to a problem? Please describe.
No TopoJSON or GeoJSON output file exists for the dot density results for the 2020 election

Describe the solution you'd like
Create a TopoJSON (and GeoJSON) dot density output file that show the results of the 2020 election

Describe alternatives you've considered
Just an SVG output file

Add Material Design to visualization

Is your feature request related to a problem? Please describe.
Eventually, we want to add Vuetify components to the visualization and incrementally add features that won't weigh the map down

Describe the solution you'd like
Add the Material Design to the map visual so that components can be incrementally added more easily

Add a dynamic simple Vuetify datatable

Is your feature request related to a problem? Please describe.
A table that shows actual results would allow users to dynamically view results in the map.

Describe the solution you'd like
Add a Vuetify simple-table that:

  • displays all county-level results in one table
  • allows users to dynamically search for counties or states in a search bar
  • filters the map based on selections within the table

Alaska state total votes repeated. Need precincts

The Alaska state total votes are repeated. Alaska does report the votes by precinct at http://www.elect.alaska.net/ You can visualize the continental US and then add a map with precincts instead of boroughs (Alaska uses boroughs instead of counties) by using a different shape file for Alaska. ( or you can create lists of precinct for each borough and produce borough totals) You usually need to write additional code to visualize Alaska and Hawaii. If you commit the resultsbyprct.txt fle to the repository, you probably only want the lines with 'US PRESIDENT' in order to reduce the size from 7.3 MB to about 500 kb

Create topojson of state and House District level-boundaries for 2020 Alaska results

Is your feature request related to a problem? Please describe.
No topojson file exists to visualize Alaska geographies the data in this repo contains.

Describe the solution you'd like
Create a topojson that contains an Albers projection of Alaska that is both on the state-and House District-level from the 2013 cartographic boundary files published by the Alaska Division of Elections. Lo Bénichou put together a great tutorial on how to use mapshaper.org to do this.

Describe alternatives you've considered
No alternatives exist.

Additional context
This topojson will be used to visualize the data in this repo. Topojson should only include Alaska state- and House District-level boundaries since the data for 2020 are at the Alaska House District level. This file will then be merged into the U.S. county-level topojson file described by issue #15.

Use higher resolution Alaska shapefile

Is your feature request related to a problem? Please describe.
The current shapefile provided by the Alaska Division of Elections was a draft submission and hence, the resolution is quite poor.

Describe the solution you'd like
Download and process an Alaska district level shapefile at the same 1:500,000 resolution as the U.S. county shapefile

Describe alternatives you've considered
The draft submission shapefile provided by the Alaska Division of Elections.

Additional context
The U.S. Census Bureau Geography Division publishes higher resolution shapefiles for the lower chambers for all state legislative districts, including Alaska.

Newb Question - How to execute with Python 3.x

Data looks interesting but ipynb files don't execute with Python 3.6. Is there a way execute it via regular python 3?
Tried:

import os
os.system('./run-notebook.sh')

A window flashes but nothing happens. Never run a shell executable before. Alternatively, can an executable .py file initiate the project? Edit: Alternately how does the index.html work, it opens up empty without a map.

thank you

seems odd to create an issue for this, but seemed like a reasonable way to get in touch.

over the weekend i used the data to create https://github.com/alexdean/2016-election-results, which was a fun/educational experience. i plan to continue improving this project to get a better understanding of the election, especially the seemingly huge divide between urban & rural areas.

just wanted to say thank you for doing the work to put this together, and i thought you might like to see one place where it's being put to use.

Make viz tooltip title font heavier

Is your feature request related to a problem? Please describe.
Tooltip title font-weight is too small.

Describe the solution you'd like
Increase tooltip title font-weight to make it more prominent.

Data Fix

Fixed fat-finger error in Laporte County 2008 (And correcting the rest to published numbers).

note: I wasn't able to push changes to either master or a feature branch. So sticking it in this issue instead.

File Name: US_County_Level_Presidential_Results_08-16.csv
Line: 1469
Old: 18091,LaPorte County,208757,28258,17918,743,43657,24104,18609,944,44994,19795,22678,2521
Change to: 18091,LaPorte County,47000,28247,17911,842,43657,24104,18609,944,44994,19795,22678,2521

Source: http://www.laportecounty.org/Resources/Voters/Elections/2008Elections/html/LaporteElecSumm%20.htm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.