Skip to content

Instantly share code, notes, and snippets.

@pierandrea
Last active August 29, 2015 14:17
Show Gist options
  • Save pierandrea/58c21b24b7de97560515 to your computer and use it in GitHub Desktop.
Save pierandrea/58c21b24b7de97560515 to your computer and use it in GitHub Desktop.
Facebook Government Report
Country 2013 2014
Afghanistan 0 1
Albania 6 16
Algeria 0 1
Andorra 0 3
Argentina 278 482
Armenia 1 1
Australia 603 829
Austria 28 46
Bahrain 1 3
Bangladesh 5
Belgium 154 239
Bhutan 1 0
Bosnia and Herzegovina 4 5
Botswana 1 0
Brazil 1165 1212
Bulgaria 2 0
Cambodia 1 0
Canada 174 279
Chile 230 288
Colombia 21 67
Costa Rica 9 1
Croatia 7 21
Cyprus 3 20
Czech Republic 14 22
Denmark 12 31
Dominican Republic 0 22
Ecuador 2 2
Egypt 6 5
Estonia 6 6
Finland 11 18
France 1661 2094
Georgia 3 0
Germany 1687 2132
Greece 115 117
Greenland 2 1
Hong Kong 25 39
Hungary 38 128
India 3598 5473
Indonesia 0 5
Ireland 35 34
Israel 129 232
Italy 1699 1774
Ivory Coast 1 0
Japan 0 9
Jordan 0 3
Kazakhstan 2 2
Kenya 0 2
Kosovo 1 2
Kuwait 4 4
Lebanon 12 0
Liechtenstein 0 2
Lithuania 9 12
Luxembourg 2 1
Macau 1 1
Macedonia 6 5
Malaysia 16 17
Maldives 0 3
Malta 81 93
Mexico 125 260
Moldova 0 4
Montenegro 0 4
Myanmar 0 0
Nepal 2 2
Netherlands 23 76
New Zealand 80 139
Norway 15 21
Oman 3 0
Pakistan 126 100
Palestine 4 0
Paraguay 0 2
Peru 2 10
Philippines 4 7
Poland 220 305
Portugal 148 305
Qatar 3 0
Romania 11 14
Russia 1 2
Senegal 0 1
Serbia 1 15
Singapore 141 177
Slovakia 5
Slovenia 3 3
South Africa 3 2
South Korea 1 14
Spain 404 500
Sri Lanka 1 0
Sudan 4 2
Sweden 89 213
Switzerland 34 39
Taiwan 193 204
Thailand 2 3
Tunisia 0 2
Turkey 129 165
Uganda 1 0
Ukraine 0 1
United Arab Emirates 2 2
United Kingdom 1906 2366
United States 12598 14274
Uruguay 1 2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>#KnightD3 - Exercise Module 2: Loading CSV Data with D3</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
body {
background-color: orange;
font-family: tahoma, helvetica;
color: white;
padding: 20px;
}
svg {
background-color: orange;
}
div {
text-align: center;
}
h1 {
text-align: center;
}
p {
text-align: center;
}
p.italic {
font-style: italic;
font-size: 6;
}
</style>
</head>
<body>
<h1>Facebook Government Report</h1>
<p>Sharing information about the requests Facebook receives from governments around the world</P>
<svg width="100%" height="200">
<circle cx="300" cy="100" r="50" fill="yellow" />
<circle cx="500" cy="100" r="100" fill="red" />
<text x="300" y="100" font-family="sans-serif" font-size="20px" fill="black">2013</text>
<text x="500" y="100" font-family="sans-serif" font-size="20px" fill="white">2014</text>
<p> <em>A comparison between 2013 and 2014</em></p>
</svg>
<p></p>
<script type="text/javascript">
//Load in contents of CSV file
d3.csv("Facebook-Government-Report-2013-2014.csv", function(data) {
//Now CSV contents have been transformed into
//an array of JSON objects.
//Log 'data' to the console, for verification.
console.log(data);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment