Skip to content

Instantly share code, notes, and snippets.

Country 2013 2010 2005 2000 1995 1990 Change in Mortality Rate (1990-2013)
Afghanistan 400 500 730 1100 1200 1200 -0.666666667
Albania 21 21 24 28 29 31 -0.322580645
Algeria 89 92 100 120 140 160 -0.44375
Angola 460 530 750 1100 1400 1400 -0.671428571
Argentina 69 76 70 63 60 71 -0.028169014
Armenia 29 31 37 43 51 47 -0.382978723
Australia 6 5 6 9 8 7 -0.142857143
Austria 4 3 5 5 7 10 -0.6
Azerbaijan 26 27 36 57 83 60 -0.566666667
@DimsumPanda
DimsumPanda / index.html
Last active September 7, 2015 23:48
Week2: High Charts
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<title>Highcharts Extract Example</title>
<!-- Code example for class extracted from http://datatools.urban.org/Features/wealth-inequality-charts/ with code from Tim Meko and Ben Chartoff -->
<style>
body {
@DimsumPanda
DimsumPanda / index.html
Last active September 28, 2015 16:13
Week 5: Scatterplot with my Data
<!DOCTYPE html>
<!-- A modified example from Scott Murray's Knight d3 course. -->
<html lang="en">
<head>
<meta charset="utf-8">
<title>Maternal Mortality Rate in 2013 by Country</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
@DimsumPanda
DimsumPanda / index.html
Created October 5, 2015 20:35
Week 6: My 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>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
@DimsumPanda
DimsumPanda / index.html
Last active October 12, 2015 00:56
Week 7: 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>
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
</head>
@DimsumPanda
DimsumPanda / deaths_04yearsold_excerpt.csv
Last active October 25, 2015 15:01
Week 9: JS homework
Country Year Meningitis_encephalitis Respiratory_infections Sepsis Pertussis Malaria Measles HIV_Aids Diarrhoeal_diseases Asphyxia_trauma
Angola Year 2013 5461 26392 7199 897 19405 627 1778 22465 14245
Angola Year 2012 5747 26910 7149 893 19692 1278 1769 23655 14150
Angola Year 2000 9282 25989 4172 931 21138 1103 1179 27209 9800
Angola Year 2001 9452 26463 4784 918 21232 3889 1276 27064 9715
Angola Year 2011 6107 27282 7044 911 21331 573 1704 24567 13909
Angola Year 2002 9628 27141 5269 931 21793 5054 1373 26969 10068
Angola Year 2006 10465 30754 6064 1047 22022 602 1590 27001 12620
Angola Year 2003 9840 28190 5219 964 22530 1786 1466 27015 11186
Angola Year 2005 10242 29865 5742 1014 23066 297 1601 26962 12292
@DimsumPanda
DimsumPanda / README.md
Last active November 15, 2015 12:30
Week 1: Style article

Week 1: Style Article

Basic CSS practice to style the HTML page with headlines, byline, body text, and images in an external style sheet.

@DimsumPanda
DimsumPanda / README.md
Last active November 15, 2015 13:45
Week 2: Paragraph Data load

Week 2: Paragraph Data load

Read in data for the Maternal Mortality Rates in the World with d3.js. Logs the data in the console. This gist was not done in the real D3 'way.' This uses a JS loop that will add p elements for each item in the data set manually instead of using enter().

Logging Data with D3

d3.csv("maternalMortalityRate.csv", function (mydata) {

	//Everything involving the dataset should go here.
@DimsumPanda
DimsumPanda / README.md
Last active November 15, 2015 14:13
Week 3: Cleaned data file

Week 3: Cleaned data file

Assigment:

  • fix any column names you think should/could be improved in the csv (and give it a new name)
  • load your data in d3 using d3.csv, and in the function in d3.csv:
  • add a property to the data set in javascript that is the sum of the years' values for each
  • add a property to the data set in javascript that is the difference between 2010 and 2013
  • sort the data by the new value that is the sum of the refugees
  • draw your

    's for each row of the fixed data set, using the sort order for sum of refugees (largest at the top)

@DimsumPanda
DimsumPanda / README.md
Last active November 15, 2015 14:19
Week 3: My Data the D3 Way

Week 3: My Data the D3 Way

Read in the maternal mortality rates data with D3 and sorted by the change in rates from 1990-2013.