Skip to content

Instantly share code, notes, and snippets.

@RobertDelgado
Last active September 26, 2017 03:24
Show Gist options
  • Save RobertDelgado/327f1a936510514071c864b418b1d28e to your computer and use it in GitHub Desktop.
Save RobertDelgado/327f1a936510514071c864b418b1d28e to your computer and use it in GitHub Desktop.
2013 Greenhouse Gas Emissions by Country
license: mit
Country Year Total GHG Population (People) GDP-USD (Million US$ (2010))
Afghanistan 2013 44.4157 30,682,500 19731.34
Albania 2013 8.3078 2,896,652 12542.47
Algeria 2013 187.2679 38,186,135 176324.9
Angola 2013 155.722 23,448,202 96261.43
Antigua & Barbuda 2013 1.0993 89,985 1155.65
Argentina 2013 334.2374 42,538,304 457639.09
Armenia 2013 8.5935 2,992,192 10736.58
Australia 2013 580.0997 23,117,353 1241484.49
Austria 2013 78.4743 8,479,375 404686.91
Azerbaijan 2013 69.7221 9,416,801 57238.34
Bahamas, The 2013 3.4083 377,841 8204.54
Bahrain 2013 33.4062 1,349,427 28674.33
Bangladesh 2013 163.6298 157,157,394 138596.87
Barbados 2013 3.5448 282,503 4490.58
Belarus 2013 90.4979 9,466,000 59927.87
Belgium 2013 113.4088 11,182,817 492609.24
Belize 2013 9.6848 344,193 1500.6
Benin 2013 12.1686 10,322,232 8063.04
Bhutan 2013 1.4583 754,637 1835.84
Bolivia 2013 46.8039 10,399,931 23208.06
Bosnia & Herzegovina 2013 28.4488 3,823,533 17568.16
Botswana 2013 12.9246 2,176,510 15560.89
Brazil 2013 1017.8745 204,259,377 2409739.67
Brunei 2013 19.0151 411,499 14045.47
Bulgaria 2013 54.8549 7,265,115 52039.98
Burkina Faso 2013 23.5054 17,084,554 10785.18
Burundi 2013 3.0465 10,465,959 2297.62
Cambodia 2013 27.0972 15,078,564 13876.86
Cameroon 2013 83.2755 22,211,166 27160.44
Canada 2013 738.3825 35,155,499 1730687.77
Cape Verde 2013 0.6 507,258 1762.87
Central African Republic 2013 49.2281 4,710,678 1352.05
Chad 2013 28.4407 13,145,788 12276
Chile 2013 103.5626 17,575,833 252461.74
China 2013 11735.0071 1,357,380,000 7766512.59
Colombia 2013 159.5837 47,342,363 333817.27
Comoros 2013 0.4038 751,697 580.24
Congo, Dem. Rep. 2013 39.559 72,552,861 25500.5
Congo, Rep. 2013 6.9438 4,394,334 13334.06
Costa Rica 2013 13.7952 4,706,433 41572.79
Cote d'Ivoire 2013 31.9607 21,622,490 28681.62
Croatia 2013 23.477 4,255,689 57591.65
Cuba 2013 46.5085 11,362,505 69954.61
Cyprus 2013 6.9364 1,141,652 23356.23
Czech Republic 2013 120.9859 10,514,272 208463.74
Denmark 2013 52.8873 5,614,932 322470.44
Djibouti 2013 1.3934 864,554 1297.93
Dominica 2013 0.2399 72,005 491.17
Dominican Republic 2013 33.1665 10,281,408 59894.03
Ecuador 2013 58.2656 15,661,312 83181.8
Egypt 2013 272.3785 87,613,909 232552.29
El Salvador 2013 11.5955 6,089,644 22716.94
Equatorial Guinea 2013 20.7597 797,082 18027.86
Estonia 2013 23.3476 1,317,997 22185.92
Ethiopia 2013 123.3709 94,558,374 39984.18
European Union (15) 2013 3374.0348 402,772,136 15801766.9
European Union (28) 2013 4224.5217 503,795,199 17156814.84
Fiji 2013 2.7564 880,487 3486.03
Finland 2013 63.5322 5,438,972 248660.93
France 2013 440.8485 65,972,097 2722566.89
Gabon 2013 7.3587 1,650,351 17096.85
Gambia, The 2013 7.4691 1,866,878 1010.74
Georgia 2013 14.7952 3,776,000 13721.01
Germany 2013 894.057 82,132,753 3577227.56
Ghana 2013 30.8917 26,164,432 43036.44
Greece 2013 86.9692 10,965,211 244004.26
Grenada 2013 2.0022 105,902 786
Guatemala 2013 26.6116 15,690,793 45977.07
Guinea 2013 16.4436 11,948,726 5232.82
Guinea-Bissau 2013 1.9723 1,757,138 916.15
Guyana 2013 4.0547 761,033 2627.24
Haiti 2013 8.0637 10,431,249 7494.4
Honduras 2013 21.111 7,849,059 17482.09
Hungary 2013 56.9204 9,893,082 133161.04
Iceland 2013 2.929 323,764 14191.93
India 2013 2909.0566 1,279,498,874 1989650.37
Indonesia 2013 744.3403 251,268,276 897261.72
Iran 2013 716.8149 77,152,445 444592.55
Iraq 2013 284.5679 34,107,366 180885.91
Ireland 2013 59.2123 4,598,294 221231.11
Israel 2013 89.5907 8,059,500 262440.96
Italy 2013 420.8244 60,233,948 2041287.3
Jamaica 2013 9.501 2,714,669 13404.03
Japan 2013 1353.3473 127,338,621 5644658.52
Jordan 2013 30.8217 7,214,832 28607.72
Kazakhstan 2013 313.7248 17,035,275 176633.09
Kenya 2013 60.1371 43,692,881 46904.25
Kiribati 2013 0.0844 108,544 171.36
Korea, Rep. (South) 2013 673.5412 50,219,669 1194428.93
Kuwait 2013 195.7803 3,593,689 136466.85
Kyrgyzstan 2013 15.4959 5,719,600 5629.45
Laos 2013 11.4916 6,579,985 9023.96
Latvia 2013 12.6443 2,012,647 27011.45
Lebanon 2013 26.9435 5,286,990 39972.86
Lesotho 2013 4.2026 2,083,061 2754.05
Liberia 2013 2.1519 4,293,692 1641.99
Lithuania 2013 19.3235 2,957,689 42336.91
Luxembourg 2013 11.2914 543,360 55554.17
Macedonia, FYR 2013 12.065 2,072,543 9863.71
Madagascar 2013 26.4428 22,924,557 9330.84
Malawi 2013 10.126 16,190,126 7819.25
Malaysia 2013 303.1518 29,465,372 296507.4
Maldives 2013 1.136 393,000 2710.48
Mali 2013 29.1982 16,592,097 11184.42
Malta 2013 2.9785 423,374 9563.58
Mauritania 2013 11.1908 3,872,684 5097.69
Mauritius 2013 5.6704 1,258,653 11137.68
Mexico 2013 733.0104 123,740,109 1153059.23
Moldova 2013 11.4641 3,558,566 6742.7
Mongolia 2013 38.6367 2,859,174 10574.8
Montenegro 2013 3.3881 621,207 4303.73
Morocco 2013 78.8839 33,452,686 105643.1
Mozambique 2013 27.4629 26,467,180 12492.64
Myanmar 2013 98.7527 52,983,829 60877.58
Namibia 2013 11.2817 2,346,592 13161.1
Nepal 2013 36.0311 27,834,981 18057.55
Netherlands 2013 186.7775 16,804,432 839764.95
New Zealand 2013 75.0919 4,442,100 157930.12
Nicaragua 2013 14.0877 5,945,646 10249.67
Niger 2013 26.6106 18,358,863 6886.61
Nigeria 2013 304.0637 172,816,517 425440.43
Norway 2013 46.5925 5,079,623 449009.58
Oman 2013 101.7895 3,906,912 66176.85
Pakistan 2013 326.774 181,192,646 196970.46
Palau 2013 0.3576 20,919 194.39
Panama 2013 17.0885 3,805,683 37655.35
Papua New Guinea 2013 16.4336 7,308,864 12265.96
Paraguay 2013 37.5747 6,465,669 23538.67
Peru 2013 86.2102 30,565,461 176194.81
Philippines 2013 171.6044 97,571,676 236315.8
Poland 2013 361.1905 38,040,196 518567.54
Portugal 2013 62.0311 10,457,295 222001.61
Qatar 2013 82.8463 2,101,288 155056.43
Romania 2013 109.4851 19,983,693 176894.95
Russian Federation 2013 2199.1173 143,506,911 1666932.64
Rwanda 2013 6.6307 11,078,095 6999.34
Saint Kitts & Nevis 2013 0.4262 54,301 762.22
Saint Lucia 2013 1.133 182,305 1227.59
Saint Vincent & Grenadines 2013 0.2753 109,327 700.34
Samoa 2013 0.5099 190,390 684.05
Sao Tome & Principe 2013 0.1887 182,386 222.85
Saudi Arabia 2013 546.8181 30,201,051 626766.13
Senegal 2013 25.4859 14,221,041 14199.48
Serbia 2013 59.0182 7,164,132 40625.73
Seychelles 2013 0.7113 89,900 1183.1
Sierra Leone 2013 6.7302 6,178,859 3813.21
Singapore 2013 52.9509 5,399,162 272484.05
Slovakia 2013 40.3202 5,413,393 94949.25
Slovenia 2013 18.0226 2,059,953 46517.36
Solomon Islands 2013 0.5595 560,685 817.68
South Africa 2013 510.2377 53,192,216 405491.04
Spain 2013 306.6117 46,620,045 1357139.07
Sri Lanka 2013 38.3764 20,579,000 69395.8
Suriname 2013 3.3542 533,450 4874.22
Swaziland 2013 2.8598 1,250,641 4988.78
Sweden 2013 50.8451 9,600,379 506161.64
Switzerland 2013 51.5705 8,089,346 608547.72
Tajikistan 2013 10.2444 8,111,894 6996.23
Tanzania 2013 77.9457 50,213,457 38220.9
Thailand 2013 369.431 67,451,422 378583.99
Togo 2013 6.5823 6,928,719 3626.73
Tonga 2013 0.4116 105,139 371.15
Trinidad & Tobago 2013 25.8122 1,348,240 22972.51
Tunisia 2013 35.6478 10,886,500 46279.7
Turkey 2013 408.4574 76,223,639 846257.18
Turkmenistan 2013 112.285 5,240,088 31713.47
Uganda 2013 33.3506 36,573,387 23745.64
Ukraine 2013 375.667 45,489,600 143750.95
United Arab Emirates 2013 221.4243 9,039,978 336586.47
United Kingdom 2013 546.2641 64,128,226 2546400.81
United States 2013 6279.8362 316,427,395 15802855.3
Uruguay 2013 34.0277 3,407,969 45897.32
Uzbekistan 2013 225.7986 30,243,200 49777.61
Vanuatu 2013 0.6735 253,165 736.04
Venezuela 2013 268.4274 30,276,045 439148.69
Vietnam 2013 256.7606 89,759,500 136657.57
Yemen 2013 35.502 25,533,217 28954.92
Zambia 2013 50.1033 15,246,086 24183.24
Zimbabwe 2013 27.4014 14,898,092 12180.64
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://d3js.org/d3.v4.min.js"></script>
<title>Top Internet Countries Visualization</title>
<style>
body {
margin: 0px;
}
.domain {
display: none;
}
.tick line {
stroke: #C0C0BB;
}
.tick text {
fill: #8E8883;
font-size: 10pt;
font-family: sans-serif;
}
.axis-label {
fill: #635F5D;
font-size: 20pt;
font-family: sans-serif;
}
</style>
</head>
<body>
<svg width="960" height="500"></svg>
<script>
const xValue = d => d.country;
const xLabel = 'Country';
const yValue = d => d.GHG;
const yLabel = 'Total GHG emissions in 2013';
const margin = { left: 150, right: 30, top: 20, bottom: 200 };
const svg = d3.select('svg');
const width = svg.attr('width');
const height = svg.attr('height');
const innerWidth = width - margin.left - margin.right;
const innerHeight = height - margin.top - margin.bottom;
const g = svg.append('g')
.attr('transform', `translate(${margin.left},${margin.top})`);
const xAxisG = g.append('g')
.attr('transform', `translate(0, ${innerHeight})`);
const yAxisG = g.append('g');
xAxisG.append('text')
.attr('class', 'axis-label')
.attr('x', innerWidth /2.5)
.attr('y', 95)
.text(xLabel);
yAxisG.append('text')
.attr('class', 'axis-label')
.attr('x', -innerHeight / 2 - 30)
.attr('y', -70)
.attr('transform', `rotate(-90)`)
.style('text-anchor', 'middle')
.text(yLabel);
const xScale = d3.scaleBand()
.paddingInner(0.5)
.paddingOuter(0.5);
const yScale = d3.scaleLinear();
const xAxis = d3.axisBottom()
.scale(xScale)
.tickSize(-innerHeight);
const yTicks = 10;
const yAxis = d3.axisLeft()
.scale(yScale)
.ticks(yTicks)
.tickPadding(15)
.tickFormat(d3.format('.0s'))
.tickSize(-innerWidth);
const row = d => {
return {
country: d['Country'],
GHG:+d['Total GHG']
};
};
d3.csv('ghg_simple.csv', row, data => {
data = data.filter(function(d){return(d.GHG >= 500);});
data.sort(function(d1, d2){return(d2.GHG - d1.GHG);});
xScale
.domain(data.map(xValue))
.range([0, innerWidth]);
yScale
.domain([0, d3.max(data, yValue)])
.range([innerHeight, 0])
.nice(yTicks);
g.selectAll('rect').data(data)
.enter().append('rect')
.attr('x', d => xScale(xValue(d)))
.attr('y', d => yScale(yValue(d)))
.attr('width', d => xScale.bandwidth())
.attr('height', d => innerHeight - yScale(yValue(d)))
.attr('fill', 'steelblue');
xAxisG.call(xAxis);
xAxisG.selectAll('.tick line').remove();
xAxisG.selectAll('.tick text')
.attr('transform', 'rotate(-45)')
.attr('text-anchor', 'end')
.attr('alignment-baseline', 'middle')
.attr('x', -5)
.attr('y', 6)
.attr('dy', 0);
yAxisG.call(yAxis);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment