Skip to content

Instantly share code, notes, and snippets.

@wmerrow
wmerrow / index.html
Created April 12, 2020 20:36
class 9 assignment
<!doctype html>
<html>
<head>
<title>Will's class 9 assignment</title>
<script src='https://api.mapbox.com/mapbox-gl-js/v1.8.1/mapbox-gl.js'></script>
<link rel="stylesheet" type="text/css" href="style.css">
<link href='https://api.mapbox.com/mapbox-gl-js/v1.8.1/mapbox-gl.css' rel='stylesheet' />
@wmerrow
wmerrow / index.html
Last active November 28, 2015 16:38
Intermediate D3 - Module 4 - Chloropleth
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Will's module 4 exercise</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
@wmerrow
wmerrow / index.html
Created November 21, 2015 02:20
Intermediate D3 - Module 3 - United States shape file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Will's module 3 exercise</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
@wmerrow
wmerrow / index.html
Created November 13, 2015 02:10
Intermediate D3 - Module 2 - Stacked Bars
<!DOCTYPE html>
<head>
<html lang="en">
<meta charset="utf-8">
<title>Will's module 2 exercise</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
p1 {font-family: sans-serif; font-size: 35px; font-weight: bold;}
@wmerrow
wmerrow / index.html
Last active November 11, 2015 04:12
Stacked bar chart - draft 1
<!DOCTYPE html>
<head>
<html lang="en">
<meta charset="utf-8">
<title>Will's module 2 exercise</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
p1 {font-family: sans-serif; font-size: 35px; font-weight: bold;}
@wmerrow
wmerrow / 2016Rcandidates2.csv
Created November 5, 2015 02:01
Intermediate D3 - Module 1 - Scatterplot
Candidate Party 3QCampaignRaised CampaignRaised CampaignOnHand BurnRate PACRaised PollingAverage MarketOdds EndorsementPoints ImageLink Offset
Ben Carson Republican 20 31 11.3 0.65 3.8 0.222 9 0 carson.png 0
Chris Christie Republican 4.2 4.2 1.4 0.67 11 0.018 5 25 christie.png -1
Donald Trump Republican 3.9 5.8 0.3 0.96 0 0.27 20 0 trump.png 0
Jeb Bush Republican 13.4 24.8 10.3 0.59 103 0.066 10 37 bush.png 0
Marco Rubio Republican 5.7 15 11 0.39 31.9 0.096 41 13 rubio.png 0
Mike Huckabee Republican 1.2 3.2 0.8 0.77 3.6 0.03 2 24 huckabee.png 3
Rand Paul Republican 2.5 9.5 2 0.78 6.7 0.028 0 15 paul.png 0
John Kasich Republican 4.4 4.4 2.7 0.4 11 0.022 1 14 kasich.png 0
Ted Cruz Republican 12.2 26 13.5 0.49 38 0.07 10 8 cruz.png 1
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 34 columns, instead of 23. in line 9.
Player,Year,HRleader,Age,Tm,Lg,WAR,WARlead,WARleadCobb,WARleadBonds,Salary,Pos,Awards,AllStar,AllStarCobb,AllStarBonds,MVP,MVPCobb,MVPBonds,WorldSeries,WorldSeriesCobb,WorldSeriesBonds,AB,SO,HR,HRlead,HRleadCobb,HRleadBonds,BA,BAlead,BAleadCobb,BAleadBonds,OBP,SLG
Babe Ruth,1914,,19,BOS,AL,0,,,,2500,/1,,,,,,,,,,,10,4,0,,,,0.2,,,,0.2,0.3
Babe Ruth,1915,,20,BOS,AL,1.8,,,,3500,1,,,,,,,,1,,,92,23,4,,,,0.315,,,,0.376,0.576
Babe Ruth,1916,,21,BOS,AL,1.7,,,,3500,1,,,,,,,,1,,,136,23,3,,,,0.272,,,,0.322,0.419
Babe Ruth,1917,,22,BOS,AL,2.1,,,,3500,1,,,,,,,,,,,123,18,2,,,,0.325,,,,0.385,0.472
Babe Ruth,1918,1,23,BOS,AL,5.1,,,,9000,O7138,,,,,,,,1,,,317,58,11,11,,,0.3,,,,0.411,0.555
Babe Ruth,1919,1,24,BOS,AL,9.4,,,,,*O71/38,,,,,,,,,,,432,58,29,29,,,0.322,,,,0.456,0.657
Babe Ruth,1920,1,25,NYY,AL,11.9,11.9,,,20000,*O978/31,,,,,,,,,,,458,80,54,54,,,0.376,,,,0.532,0.847
Babe Ruth,1921,1,26,NYY,AL,12.9,12.9,,,20000,*O78/31,,,,,,,,,,,540,81,59,59,,,0.378,,,,0.512,0.846
Babe Ruth,1922,,27,NYY,AL,6.3,,,,52000,*O79/3,,,,,,,,,,,4
Player Year Age Tm Lg WAR Salary Pos Awards AB SO BA OBP SLG
Babe Ruth 1914 19 BOS AL 0 2500 /1 10 4 0.2 0.2 0.3
Babe Ruth 1915 20 BOS AL 1.8 3500 1 92 23 0.315 0.376 0.576
Babe Ruth 1916 21 BOS AL 1.7 3500 1 136 23 0.272 0.322 0.419
Babe Ruth 1917 22 BOS AL 2.1 3500 1 123 18 0.325 0.385 0.472
Babe Ruth 1918 23 BOS AL 5.1 9000 O7138 317 58 0.3 0.411 0.555
Babe Ruth 1919 24 BOS AL 9.4 *O71/38 432 58 0.322 0.456 0.657
Babe Ruth 1920 25 NYY AL 11.9 20000 *O978/31 458 80 0.376 0.532 0.847
Babe Ruth 1921 26 NYY AL 12.9 20000 *O78/31 540 81 0.378 0.512 0.846
Babe Ruth 1922 27 NYY AL 6.3 52000 *O79/3 406 80 0.315 0.434 0.672
@wmerrow
wmerrow / OutsideSpending.csv
Created August 3, 2015 07:30
William Merrow - Data Visualization
cycle totalexp totalexpB totalexporig indexp eleccomm commcost demfor demagnst repubfor repubagnst
1992 19.635123 0.019635123000 19635123 10947342 0 8687781 8785053 1456731 8372777 927304
1996 17.884043 0.017884043000 17884043 10167742 0 7716301 6669119 1210676 6238743 3643821
2000 51.638411 0.051638411000 51638411 33778636 0 17859775 25015992 1492988 18001514 6558918
2004 193.129472 0.193129472000 193129472 63885795 98898197 30345480 60063207 4155900 22545608 7401923
2008 338.399923 0.338399923000 338399923 143618022 131137181 63644720 120809305 33570233 20382064 32428627
2012 1038.736997 1.038736997000 1038736997 1002135419 15437830 21230660 73333480 454601541 175122392 294832515
@wmerrow
wmerrow / PACdata-Corporations-Inf.csv
Created May 10, 2015 22:39
Will's module 6 exercise
ElectionYear SpendingInf
1978 34.485
1980 55.104
1982 67.375
1984 80.94
1986 99.792
1988 100.8
1990 96.835
1992 108.667
1994 102.56