Skip to content

Instantly share code, notes, and snippets.

View emagee's full-sized avatar

Marcia Gray emagee

View GitHub Profile
@emagee
emagee / bowker-data-clean-reformatted-3.csv
Created August 1, 2015 02:48
Small multiples; tooltips pending (hopefully)
subject date count
Agriculture 2002 1418
Agriculture 2003 1535
Agriculture 2004 1501
Agriculture 2005 1483
Agriculture 2006 1426
Agriculture 2007 1259
Agriculture 2008 1556
Agriculture 2009 1363
Agriculture 2010 1833
@emagee
emagee / bowker-data-clean-reformatted-3.csv
Created July 31, 2015 18:26
More small multiples, repeated axes
Agriculture 2002 1418
Agriculture 2003 1535
Agriculture 2004 1501
Agriculture 2005 1483
Agriculture 2006 1426
Agriculture 2007 1259
Agriculture 2008 1556
Agriculture 2009 1363
Agriculture 2010 1833
@emagee
emagee / bowker-data-clean-reformatted-2.csv
Created July 29, 2015 13:08
Small mults failed attempt 1
Subject date count
Agriculture 2002 1418
Agriculture 2003 1535
Agriculture 2004 1501
Agriculture 2005 1483
Agriculture 2006 1426
Agriculture 2007 1259
Agriculture 2008 1556
Agriculture 2009 1363
Agriculture 2010 1833
@emagee
emagee / fruit.html
Created April 25, 2015 17:30
fruit troubleshoot
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fruits Availability Per Capita in the US, 1970-2012</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
body {
background-color: white;
@emagee
emagee / chocolate_imports_1989-2014-2.csv
Created April 24, 2015 20:00
Chocolate imports — line graph
Source 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014
Canada 100 115 127 151 164 178 222 262 316 348 346 390 456 525 705 721 712 709 726 758 647 872 941 989 1046 1177
Mexico 16 23 12 10 17 15 25 26 27 23 35 34 37 54 73 89 102 131 144 215 355 454 533 515 499 478
Indonesia 4 12 16 17 18 20 47 62 97 62 57 44 47 50 60 62 68 64 83 139 100 122 166 157 160 251
Malaysia 22 46 51 55 30 38 43 42 69 66 57 43 47 38 90 110 112 108 121 256 242 308 278 148 134 185
Cote d'Ivoire 37 35 33 28 23 31 30 26 23 39 30 24 13 30 60 62 78 79 67 91 136 176 129 154 146 179
Germany 18 17 18 22 24 21 25 29 29 29 30 40 54 52 58 53 58 64 82 78 79 150 166 182 174 178
Netherlands 71 80 53 54 66 67 66 67 73 75 71 79 101 124 175 163 134 122 107 132 163 250 297 267 202 169
Belgium-Luxembourg 19 24 22 23 25 23 25 27 35 40 51 48 55 50 61 70 76 89 103 96 80 93 115 120 124 131
France 7 6 7 9 9 11 12 11 15 17 26 21 24 31 42 46 47 55 61 56 52 71 73 63 64 62
Canada 100 115 127 151 164 178 222 262 316 348 346 390 456 525 705 721 712 709 726 758 647 872 941 989 1046 1177
Mexico 16 23 12 10 17 15 25 26 27 23 35 34 37 54 73 89 102 131 144 215 355 454 533 515 499 478
Indonesia 4 12 16 17 18 20 47 62 97 62 57 44 47 50 60 62 68 64 83 139 100 122 166 157 160 251
Malaysia 22 46 51 55 30 38 43 42 69 66 57 43 47 38 90 110 112 108 121 256 242 308 278 148 134 185
Cote d'Ivoire 37 35 33 28 23 31 30 26 23 39 30 24 13 30 60 62 78 79 67 91 136 176 129 154 146 179
Germany 18 17 18 22 24 21 25 29 29 29 30 40 54 52 58 53 58 64 82 78 79 150 166 182 174 178
Netherlands 71 80 53 54 66 67 66 67 73 75 71 79 101 124 175 163 134 122 107 132 163 250 297 267 202 169
Belgium-Luxembourg 19 24 22 23 25 23 25 27 35 40 51 48 55 50 61 70 76 89 103 96 80 93 115 120 124 131
France 7 6 7 9 9 11 12 11 15 17 26 21 24 31 42 46 47 55 61 56 52 71 73 63 64 62
Source 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014
Canada 100 115 127 151 164 178 222 262 316 348 346 390 456 525 705 721 712 709 726 758 647 872 941 989 1046 1177
Mexico 16 23 12 10 17 15 25 26 27 23 35 34 37 54 73 89 102 131 144 215 355 454 533 515 499 478
Indonesia 4 12 16 17 18 20 47 62 97 62 57 44 47 50 60 62 68 64 83 139 100 122 166 157 160 251
Malaysia 22 46 51 55 30 38 43 42 69 66 57 43 47 38 90 110 112 108 121 256 242 308 278 148 134 185
Cote d'Ivoire 37 35 33 28 23 31 30 26 23 39 30 24 13 30 60 62 78 79 67 91 136 176 129 154 146 179
Germany 18 17 18 22 24 21 25 29 29 29 30 40 54 52 58 53 58 64 82 78 79 150 166 182 174 178
Netherlands 71 80 53 54 66 67 66 67 73 75 71 79 101 124 175 163 134 122 107 132 163 250 297 267 202 169
Belgium-Luxembourg 19 24 22 23 25 23 25 27 35 40 51 48 55 50 61 70 76 89 103 96 80 93 115 120 124 131
France 7 6 7 9 9 11 12 11 15 17 26 21 24 31 42 46 47 55 61 56 52 71 73 63 64 62
[
{
source: "Canada",
exports: [
{ year: 1989, amount: 100},
{ year: 1990, amount: 115},
{ year: 1991, amount: 127},
{ year: 1992, amount: 151},
{ year: 1993, amount: 164},
{ year: 1994, amount: 176},
@emagee
emagee / README.md
Created April 18, 2015 03:03
Scattered chocolate

###Process notes

  1. I started with original data set, but that seemed too small for a scatterplot, and I wanted to find a dataset for which I had pre-1999 values; specifically, I wanted the data to cover some pre-NAFTA years. I did track down that data. The earliest year available was 1989, which is fine, since NAFTA took effect in 1994. The new data set also included 2014, whereas the original set only went as far as 2013. Whee!

  2. As part of my data cleaning, I took out all countries from which US did not import chocolate in 1989, and set the minimum value of the chocolate import per country at 1 million — this allowed me to take out all countries that had a "0" in their 1989 column. (Not sure at which point values were rounded down to zero; the metadata mentioned a different reason for the zeros anyway.)

  3. Because of the large number of countries in the original list, I opted to go without the "rest of world" entry that was in the original dataset. Should I have soldiered on and found the average

@emagee
emagee / README.md
Created April 18, 2015 02:54
Scattered chocolate

###Process notes

  1. I started with original data set, but that seemed too small for a scatterplot, and I wanted to find a dataset for which I had pre-1999 values; specifically, I wanted the data to cover some pre-NAFTA years. I did track down that data. The earliest year available was 1989, which is fine, since NAFTA took effect in 1994. The new data set also included 2014, whereas the original set only went as far as 2013. Whee!

  2. As part of my data cleaning, I took out all countries from which US did not import chocolate in 1989, and set the minimum value of the chocolate import per country at 1 million — this allowed me to take out all countries that had a "0" in their 1989 column. (Not sure at which point values were rounded down to zero; the metadata mentioned a different reason for the zeros anyway.)

  3. Because of the large number of countries in the original list, I opted to go without the "rest of world" entry that was in the original dataset. Should I have soldiered on and found the average