Skip to content

Instantly share code, notes, and snippets.

@claudialexa
claudialexa / index.html
Last active April 4, 2016 20:20
Terrorism in the United States 2000-2016
<!DOCTYPE html>
<! A mod of Michelle Chandra's block: http://bl.ocks.org/michellechandra/0b2ce4923dc9b5809922 -->
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css">
/* On mouse hover, lighten state color */
path {
stroke: gray;
@claudialexa
claudialexa / index.html
Created March 28, 2016 16:19
Small Multiples: Terrorist Incidents by Region
<!DOCTYPE html>
<!-- Modification of Mike Bostock's code in http://bl.ocks.org/mbostock/1157787 -->
<meta charset="utf-8">
<style>
body {
font: 11px sans-serif;
margin: 20px;
padding: 20px;
}
@claudialexa
claudialexa / global-terrorism-incidents.csv
Created March 21, 2016 20:22
Countries with the Most Terrorist Attacks, 2000-2014
Country Year Incidents_total
Afghanistan Year 2009 502
Afghanistan Year 2010 540
Afghanistan Year 2011 422
Afghanistan Year 2012 1469
Afghanistan Year 2013 1442
Afghanistan Year 2014 1820
Algeria Year 2009 108
Algeria Year 2010 100
Algeria Year 2011 15
@claudialexa
claudialexa / co2_emissions.csv
Last active March 21, 2016 20:35
Fixing JS Homework
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 54 columns, instead of 27. in line 2.
countryName,countryCode,indicatorName,indicatorCode,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010
Afghanistan,AFG,CO2 emissions (kt),EN.ATM.CO2E.KT,491.378,689.396,707.731,839.743,1008.425,1092.766,1283.45,1224.778,942.419,1672.152,1895.839,1532.806,1639.149,1917.841,2126.86,1987.514,2390.884,2159.863,2240.537,1760.16,1983.847,2101.191,2522.896,2830.924,3509.319,3142.619,3124.284,2867.594,2775.919,2676.91,2493.56,1426.463,1375.125,1320.12,1268.782,1199.109,1114.768,1056.096,832.409,781.071,645.392,359.366,583.053,733.4,1015.759,1338.455,1991.181,3927.357,6523.593,8236.082
Albania,ALB,CO2 emissions (kt),EN.ATM.CO2E.KT,2280.874,2464.224,2082.856,2016.85,2174.531,2552.232,2680.577,3072.946,3245.295,3744.007,4352.729,5643.513,5291.481,4345.395,4594.751,4950.45,5720.52,6494.257,7587.023,5170.47,7341.334,7308.331,7
@claudialexa
claudialexa / fitbit.csv
Created March 15, 2016 02:13
Changing Bars: The Sad Reality of My Fitbit Data
Date Total Calories Burned Minutes Sedentary Minutes Active Activity Calories
Monday 4 3468 1660 1378 62 367
Tuesday 5 3131 1512 1398 42 178
Wednesday 6 3480 1644 1317 123 394
Thursday 7 4923 2290 1158 282 1185
Friday 8 4900 2294 1193 247 1158
Monday 11 3368 1614 1388 52 313
Tuesday 12 3942 1882 1357 83 619
Wednesday 13 3552 1669 1296 144 441
Thursday 14 4261 2002 1247 193 816
@claudialexa
claudialexa / deaths_04yearsold_2013percent.csv
Last active March 14, 2016 21:00
Fixing an Animated Bar Chart
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 11 columns, instead of 8. in line 7.
Country,Meningitis_encephalitis,Respiratory_infections,Sepsis,Pertussis,Malaria,Measles,Congenital_anomalies,HIV_AIDS,Diarrhoeal_diseases,Asphyxia_trauma
India,0.042488278,0.233534888,0.145938913,0.007182025,0.009314662,0.046933792,0.123114044,0.00663867,0.184781579,0.200073149
Democratic Republic of the Congo,0.040686134,0.221728479,0.075842245,0.01386753,0.212434283,0.06908283,0.048008834,0.02005919,0.150790387,0.147500089
Indonesia,0.025829262,0.27277861,0.106128312,0.01262,0.030445137,0.076689828,0.185003315,0.017677822,0.092133369,0.180694346
Pakistan,0.042190621,0.28618202,0.163435643,0.021985945,0.001921226,0.020857808,0.075568204,0.000843982,0.175454966,0.211559586
Nigeria,0.043200357,0.207813651,0.071262349,0.016492104,0.287175958,0.007996224,0.044873945,0.042612526,0.133019132,0.145553754
Ethiopia,0.034238059,0.262054587,0.115549659,0.028521607,0.043578469,0.034427597,0.081432904,0.034783927,0.140515542,0.22489765
Afghanistan,0.052876527,0.315089385,0.112120879,0.01908775,9.43381E-05,0.061885819,0.0
@claudialexa
claudialexa / educationbyincome.csv
Created February 29, 2016 05:08
Seeting up our Children for Failure: The Effect of Income on Education
State lowIncomeReading highIncomeReading lowIncomePreK highIncomePreK
Alabama 18 49 32 52
Alaska 15 40 31 39
Arizona 15 43 25 44
Arkansas 22 46 41 51
California 15 46 37 56
Colorado 21 55 38 57
Connecticut 19 57 56 67
Delaware 25 52 36 55
District of Columbia 13 61 0 0
@claudialexa
claudialexa / german_elections_final.csv
Created February 29, 2016 05:05
Understanding Hitler's Rise to Power: The German Elections of 1919-1933
Date Party Votes Seats
January 19 1919 National Socialist German Workers Party (Nazi Party) 0 0
January 19 1919 Independent Social Democratic Party of Germany 0 0
January 19 1919 Social Democratic Party of Germany 11509048 163
January 19 1919 Communist Party of Germany 0 0
January 19 1919 Centre Party 5980216 91
January 19 1919 German National People's Party 3121479 44
January 19 1919 Bavarian People's Party 0 0
January 19 1919 German People's Party 1345338 19
January 19 1919 Christian Social People's Service 664 0
@claudialexa
claudialexa / german_elections_final.csv
Last active February 23, 2016 03:51
Crazy Election History: Germany 1919-1933, a Linechart
Date Party Votes Seats
January 19 1919 National Socialist German Workers Party 0 0
January 19 1920 Independent Social Democratic Party of Germany 0 0
January 19 1919 Social Democratic Party of Germany 11509048 163
January 19 1919 Communist Party of Germany 0 0
January 19 1919 Centre Party 5980216 91
January 19 1919 German National People's Party 3121479 44
January 19 1919 Bavarian People's Party 0 0
January 19 1919 German People's Party 1345338 19
January 19 1919 Christian Social People's Service 664 0
@claudialexa
claudialexa / index.html
Last active February 23, 2016 03:42
A sooon to be Line Chart: Elections in the Weimar Republic
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Crazy Elections: Weimar Germany</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<style type="text/css">
body {
background-color: #ffffff;
font-family: sans-serif;