Skip to content

Instantly share code, notes, and snippets.

@luluwuluying
luluwuluying / index.html
Created February 22, 2016 21:20
Week 6: Line Plot
<!DOCTYPE html>
<!-- Modification of an example by Scott Murray from Knight D3 course -->
<html lang="en">
<head>
<meta charset="utf-8">
<title>Line Chart with Multiple Lines</title>
<style type="text/css">
body {
background-color: white;
@luluwuluying
luluwuluying / index.html
Created February 29, 2016 21:43
Dots on Lines
<!DOCTYPE html>
<!-- Modification of an example by Scott Murray from Knight D3 course -->
<html lang="en">
<head>
<meta charset="utf-8">
<title>Line Chart with Multiple Lines</title>
<style type="text/css">
body {
background-color: white;
@luluwuluying
luluwuluying / AlcoholConsumption.csv
Last active February 29, 2016 22:01
week7 Transition Plot.
Country INDICATOR SUBJECT MEASURE FREQUENCY Year Amount Flag Codes
Australia ALCOHOL TOT LT_CAP15 A 1995 9.8
Australia ALCOHOL TOT LT_CAP15 A 1996 10
Australia ALCOHOL TOT LT_CAP15 A 1997 10.2
Australia ALCOHOL TOT LT_CAP15 A 1998 10
Australia ALCOHOL TOT LT_CAP15 A 1999 10
Australia ALCOHOL TOT LT_CAP15 A 2000 10.2
Australia ALCOHOL TOT LT_CAP15 A 2001 10
Australia ALCOHOL TOT LT_CAP15 A 2002 10.4
Australia ALCOHOL TOT LT_CAP15 A 2003 10.3
@luluwuluying
luluwuluying / Timespent.csv
Created March 12, 2016 18:38
My Update Plot
Activity AvgHourTotal AvgHourMen AvgHourWomen
Personal care activities 9.58 9.32 9.82
Sleeping 8.8 8.69 8.9
Eating and drinking 1.17 1.21 1.14
Household activities 1.77 1.38 2.14
Housework 0.55 0.27 0.82
Food preparation and cleanup 0.59 0.34 0.82
Lawn and garden care 0.19 0.25 0.12
Household management 0.12 0.1 0.13
Purchasing goods and services 0.74 0.6 0.87
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
@luluwuluying
luluwuluying / AlcoholConsumption.csv
Created March 21, 2016 00:00
Week9: Stacked Transition
Country IndiaICATOR SUBJECT MEASURE FREQUENCY Year Amount Flag Codes
Australia ALCOHOL TOT LT_CAP15 A 1995 9.8
Australia ALCOHOL TOT LT_CAP15 A 1996 10
Australia ALCOHOL TOT LT_CAP15 A 1997 10.2
Australia ALCOHOL TOT LT_CAP15 A 1998 10
Australia ALCOHOL TOT LT_CAP15 A 1999 10
Australia ALCOHOL TOT LT_CAP15 A 2000 10.2
Australia ALCOHOL TOT LT_CAP15 A 2001 10
Australia ALCOHOL TOT LT_CAP15 A 2002 10.4
Australia ALCOHOL TOT LT_CAP15 A 2003 10.3
@luluwuluying
luluwuluying / co2_emissions.csv
Created March 21, 2016 20:31
Week 9: 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
@luluwuluying
luluwuluying / index.html
Last active March 21, 2016 21:04
Week9: Stacked Transition
<!DOCTYPE html>
<!-- mod of Mike Bostock's block http://bl.ocks.org/mbostock/3020685 -->
<meta charset="utf-8">
<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<style>
body {
font: 12px font-family: 'Montserrat', sans-serif;;
padding: 50px;
}
@luluwuluying
luluwuluying / index.html
Last active March 28, 2016 03:00
Week 9: JS homework
<!DOCTYPE html>
<!-- Modification of Mike Bostock's code in http://bl.ocks.org/mbostock/1157787 -->
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
margin: 20px;
padding: 20px;
}
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 9.
Year,PcarDriverMale,PcarDriverFemale,PcarPassengerMale,PcarPassengeFemale,LTdriverMale,LTdriverFemale,LTpassengerMale,LTpassengerFemale,PedestriansMale,PedestriansFemale,BicyclistsMale,BicyclistsFemale,MotorcyclistsMale,MotorcyclistsFemale,deathsMale,deathsFemale
1975,"15,706","3,642","6,069","5,095",542,4,88,24,"5,196","2,319",820,183,"2,863",243,"32,675","11,844"
1976,"16,013","4,078","6,206","5,330",667,6,102,34,"5,120","2,307",751,163,"2,950",282,"33,038","12,481"
1977,"16,499","4,442","6,242","5,542",760,7,104,44,"5,331","2,400",730,192,"3,676",328,"34,627","13,248"
1978,"17,974","4,782","6,373","5,659",799,15,100,49,"5,494","2,296",714,178,"4,059",389,"36,731","13,591"
1979,"18,273","4,836","6,430","5,388",817,10,140,41,"5,701","2,391",759,173,"4,295",417,"37,588","13,498"
1980,"18,110","4,877","6,439","5,438",709,9,99,49,"5,613","2,454",782,183,"4,524",430,"37,392","13,689"
1981,"17,592","4,910","5,972","5,077",680,10,94,46,"5,459","2,332",748,181,"4,348",389,"35,930","13,161"
1982,"15,129","4,534","5,