Skip to content

Instantly share code, notes, and snippets.

View anbnyc's full-sized avatar

Alec Barrett anbnyc

View GitHub Profile
@anbnyc
anbnyc / 2012pres.csv
Created August 23, 2015 19:50
Electoral and popular vote by state from 2012 Presidential Election
State Obama EV Romney EV Obama PV Romney PV Other PV Total Vote
AL 0 9 795696 1255925 22717 2074338
AK 0 3 122640 164676 13179 300495
AZ 0 11 1025232 1233654 40368 2299254
AR 0 6 394409 647744 27315 1069468
CA 55 0 7854285 4839958 344304 13038547
CO 9 0 1323102 1185243 61177 2569522
CT 7 0 905083 634892 18985 1558960
DE 3 0 242584 165484 5853 413921
DC 3 0 267070 21381 5313 293764
@anbnyc
anbnyc / 2012pres.csv
Last active August 28, 2015 15:18
Module 2 Project - loading data to D3
AL 0 9 795696 1255925 22717 2074338
AK 0 3 122640 164676 13179 300495
AZ 0 11 1025232 1233654 40368 2299254
AR 0 6 394409 647744 27315 1069468
CA 55 0 7854285 4839958 344304 13038547
CO 9 0 1323102 1185243 61177 2569522
CT 7 0 905083 634892 18985 1558960
DE 3 0 242584 165484 5853 413921
DC 3 0 267070 21381 5313 293764
@anbnyc
anbnyc / 2012pres.csv
Last active September 8, 2015 13:11
module 3 - first binding of data to objects
state obamaEv romneyEv netEv obamaPv romneyPv otherPv totalVote
AL 0 9 -9 795696 1255925 22717 2074338
AK 0 3 -3 122640 164676 13179 300495
AZ 0 11 -11 1025232 1233654 40368 2299254
AR 0 6 -6 394409 647744 27315 1069468
CA 55 0 55 7854285 4839958 344304 13038547
CO 9 0 9 1323102 1185243 61177 2569522
CT 7 0 7 905083 634892 18985 1558960
DE 3 0 3 242584 165484 5853 413921
DC 3 0 3 267070 21381 5313 293764
@anbnyc
anbnyc / 2012pres.csv
Last active September 14, 2015 01:44
module 4 - cleaner and improved bar graph!
AL 0 9 -9 795696 1255925 22717 2074338
AK 0 3 -3 122640 164676 13179 300495
AZ 0 11 -11 1025232 1233654 40368 2299254
AR 0 6 -6 394409 647744 27315 1069468
CA 55 0 55 7854285 4839958 344304 13038547
CO 9 0 9 1323102 1185243 61177 2569522
CT 7 0 7 905083 634892 18985 1558960
DE 3 0 3 242584 165484 5853 413921
DC 3 0 3 267070 21381 5313 293764
@anbnyc
anbnyc / 2012pres.csv
Created September 20, 2015 13:46
module 5 - scatterplot!
AL 0 9 -9 795696 1255925 22717 2074338
AK 0 3 -3 122640 164676 13179 300495
AZ 0 11 -11 1025232 1233654 40368 2299254
AR 0 6 -6 394409 647744 27315 1069468
CA 55 0 55 7854285 4839958 344304 13038547
CO 9 0 9 1323102 1185243 61177 2569522
CT 7 0 7 905083 634892 18985 1558960
DE 3 0 3 242584 165484 5853 413921
DC 3 0 3 267070 21381 5313 293764
year winner totVote evFor evAgainst pctVote
2012 Barack Obama 538 332 206 61.71%
2008 Barack Obama 538 365 173 67.84%
2004 George W. Bush 538 286 251 53.16%
2000 George W. Bush 538 271 266 50.37%
1996 Bill Clinton 538 379 159 70.45%
1992 Bill Clinton 538 370 168 68.77%
1988 George H. W. Bush 538 426 111 79.18%
1984 Ronald Reagan 538 525 13 97.58%
1980 Ronald Reagan 538 489 49 90.89%
@anbnyc
anbnyc / index.html
Created October 23, 2015 20:13
Manhattan Tree Census by Zip Code and Species
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Manhattan Trees</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js" charset="utf-8"></script>
<style type="text/css">
body {
background-color: white;
@anbnyc
anbnyc / index.html
Created November 1, 2015 15:38
Manhattan Tree Census - Bar Chart
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Manhattan Tree Diversity</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
body {
margin: 0;
@anbnyc
anbnyc / index.html
Created November 8, 2015 01:27
Seats in Israeli Knesset
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Knesset Party Trends</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
body {
background-color: white;
@anbnyc
anbnyc / NYS_Assembly_Districts_ESD2015.json
Created November 22, 2015 18:37
NYS Assembly Districts
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.