Created
April 27, 2015 00:54
-
-
Save etachov/6d99bcb3a745b762107e to your computer and use it in GitHub Desktop.
Tachovsky Assignment 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
country | objective | disbursed | fh | |
---|---|---|---|---|
Kenya | Counterterrorism | 5297145.2 | 57 | |
Mali | Counterterrorism | 4920931.2 | 37 | |
Egypt | Counterterrorism | 2628123 | 68 | |
Morocco | Counterterrorism | 1500857 | 66 | |
Pakistan | Counterterrorism | 1493790 | 64 | |
Colombia | Counterterrorism | 1287168 | 54 | |
Uganda | Counterterrorism | 1094019 | 58 | |
Yemen | Counterterrorism | 1005153 | 76 | |
Afghanistan | Counterterrorism | 869230 | 66 | |
Jordan | Counterterrorism | 801724 | 68 | |
Hungary | Counterterrorism | 785354 | 35 | |
Indonesia | Counterterrorism | 772915 | 49 | |
Lebanon | Counterterrorism | 767163 | 53 | |
Nigeria | Counterterrorism | 759686 | 51 | |
Turkey | Counterterrorism | 692781 | 62 | |
Philippines | Counterterrorism | 681213.8 | 44 | |
Mexico | Counterterrorism | 613661 | 61 | |
Bulgaria | Counterterrorism | 544967 | 39 | |
India | Counterterrorism | 529612 | 39 | |
Brazil | Counterterrorism | 514855 | 45 | |
Thailand | Counterterrorism | 505605 | 64 | |
Bangladesh | Counterterrorism | 493368 | 54 | |
Malaysia | Counterterrorism | 489274 | 64 | |
Sri Lanka | Counterterrorism | 473169 | 76 | |
Nepal | Counterterrorism | 465728 | 55 | |
Romania | Counterterrorism | 394896 | 41 | |
Dominican Republic | Counterterrorism | 348004 | 41 | |
Maldives | Counterterrorism | 347919 | 55 | |
Georgia | Counterterrorism | 346123 | 47 | |
Tunisia | Counterterrorism | 341082 | 53 | |
Burundi | Counterterrorism | 340743 | 74 | |
Kazakhstan | Counterterrorism | 339777 | 85 | |
Belize | Counterterrorism | 305895 | 22 | |
Serbia | Counterterrorism | 275281 | 37 | |
Peru | Counterterrorism | 252310 | 44 | |
Cameroon | Counterterrorism | 245753 | 66 | |
Algeria | Counterterrorism | 239412 | 59 | |
Estonia | Counterterrorism | 235261 | 16 | |
Mauritius | Counterterrorism | 230677 | 30 | |
Bahamas, The | Counterterrorism | 215753 | 20 | |
Cambodia | Counterterrorism | 181109 | 66 | |
Mauritania | Counterterrorism | 164940.63 | 48 | |
Panama | Counterterrorism | 157026 | 50 | |
Moldova | Counterterrorism | 154247 | 53 | |
Laos | Counterterrorism | 140500 | 84 | |
Croatia | Counterterrorism | 138391 | 40 | |
Slovenia | Counterterrorism | 137697 | 24 | |
Albania | Counterterrorism | 134162 | 49 | |
Bosnia and Herzegovina | Counterterrorism | 130180 | 50 | |
Senegal | Counterterrorism | 126769 | 48 | |
Ukraine | Counterterrorism | 125114 | 63 | |
Uzbekistan | Counterterrorism | 123523 | 95 | |
Guatemala | Counterterrorism | 118343 | 60 | |
Czech Republic | Counterterrorism | 100114 | 20 | |
El Salvador | Counterterrorism | 99786 | 39 | |
Macedonia | Counterterrorism | 99239 | 57 | |
Djibouti | Counterterrorism | 99107 | 75 | |
Poland | Counterterrorism | 95553 | 27 | |
Greece | Counterterrorism | 94093 | 46 | |
Montenegro | Counterterrorism | 92932 | 39 | |
Chad | Counterterrorism | 90860 | 75 | |
Tajikistan | Counterterrorism | 89668 | 80 | |
Latvia | Counterterrorism | 88560 | 27 | |
Gambia, The | Counterterrorism | 86350 | 83 | |
Lithuania | Counterterrorism | 77888 | 24 | |
Azerbaijan | Counterterrorism | 76307 | 84 | |
Seychelles | Counterterrorism | 75777 | 52 | |
Iraq | Counterterrorism | 62833 | 69 | |
Tanzania | Counterterrorism | 58577 | 55 | |
Vietnam | Counterterrorism | 55810 | 84 | |
Mongolia | Counterterrorism | 51242 | 37 | |
Fiji | Counterterrorism | 50368 | 54 | |
Paraguay | Counterterrorism | 50010 | 59 | |
Guinea | Counterterrorism | 49958 | 64 | |
Rwanda | Counterterrorism | 48428 | 79 | |
Burkina Faso | Counterterrorism | 37415 | 44 | |
Trinidad and Tobago | Counterterrorism | 37179 | 25 | |
Botswana | Counterterrorism | 37065 | 41 | |
Liberia | Counterterrorism | 32887 | 58 | |
South Africa | Counterterrorism | 32846 | 33 | |
Libya | Counterterrorism | 30775 | 62 | |
South Sudan | Counterterrorism | 30234 | 62 | |
Spain | Counterterrorism | 29499 | 28 | |
Papua New Guinea | Counterterrorism | 25690 | 29 | |
Cote d`Ivoire | Counterterrorism | 25429 | 55 | |
Italy | Counterterrorism | 23163 | 31 | |
Tonga | Counterterrorism | 22814 | 29 | |
Guyana | Counterterrorism | 22630 | 34 | |
Congo, Democratic Republic of | Counterterrorism | 21935 | 79 | |
Congo, Republic of | Counterterrorism | 21935 | 57 | |
Sweden | Counterterrorism | 20724 | 10 | |
Portugal | Counterterrorism | 20641 | 18 | |
Slovak Republic | Counterterrorism | 20491 | 23 | |
Germany | Counterterrorism | 20169 | 17 | |
Mozambique | Counterterrorism | 20000 | 45 | |
Honduras | Counterterrorism | 19383 | 64 | |
Canada | Counterterrorism | 18126 | 19 | |
Finland | Counterterrorism | 14498 | 11 | |
China | Counterterrorism | 14152 | 84 | |
Russia | Counterterrorism | 13149 | 81 | |
France | Counterterrorism | 12171 | 22 | |
Australia | Counterterrorism | 12111 | 22 | |
Kiribati | Counterterrorism | 11960 | 29 | |
Samoa | Counterterrorism | 11960 | 29 | |
New Zealand | Counterterrorism | 11106 | 18 | |
Ghana | Counterterrorism | 10675 | 28 | |
Norway | Counterterrorism | 9595 | 10 | |
Turkmenistan | Counterterrorism | 9000 | 95 | |
Israel | Counterterrorism | 6042 | 30 | |
Denmark | Counterterrorism | 5596 | 12 | |
Switzerland | Counterterrorism | 5064 | 12 | |
Japan | Counterterrorism | 4558 | 25 | |
Netherlands | Counterterrorism | 4531 | 10 | |
Bolivia | Counterterrorism | 4086 | 48 | |
Lesotho | Counterterrorism | 3775 | 47 | |
Armenia | Counterterrorism | 3200 | 62 | |
Austria | Counterterrorism | 3021 | 21 | |
Chile | Counterterrorism | 3021 | 31 | |
Iceland | Counterterrorism | 3021 | 12 | |
Singapore | Counterterrorism | 2748 | 67 | |
Costa Rica | Counterterrorism | 2116 | 18 | |
Benin | Counterterrorism | 2043 | 36 | |
Haiti | Counterterrorism | 2043 | 50 | |
Ireland | Counterterrorism | 2043 | 16 | |
United Kingdom | Counterterrorism | 2043 | 23 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset = "utf-8"> | |
<title>US Counterterrorism Assistance</title> | |
<script type = "text/javascript" src = "http://d3js.org/d3.v3.js"></script> | |
<style type = "text/css"> | |
body { | |
background-color: #fff; | |
font-family: sans-serif, Helvetica, Arial; | |
} | |
h1 { | |
font-size: 23px; | |
margin: 20px 0 0 85px ; | |
} | |
p { | |
font-size: 16px; | |
margin: 10px 0 0 85px; | |
} | |
a:link { | |
color: #4086AA; | |
} | |
svg { | |
background-color: #fff; | |
} | |
circle:hover { | |
fill: #4086AA; | |
opacity: 1; | |
} | |
.axis path, | |
.axis line { | |
fill: none; | |
stroke: black; | |
shape-rendering: crispEdges; | |
} | |
.axis text { | |
font-family: sans-serif; | |
font-size: 14px; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>U.S. Counterterrorism Aid by Freedom House Score</h1> | |
<p>Sources: <a href="http://catalog.data.gov/dataset/foreign-assistance-dashboard/resource/e2affc25-ddba-4d93-8453-4c1f48b25ecc" target="_blank">data.gov</a> and <a href="https://freedomhouse.org/report-types/freedom-press" target="_blank">Freedom House</a> </br> (Higher Freedom House score means greater suppression of free speech)</p> | |
<script type = "text/javascript"> | |
var w = 750; | |
var h = 425; | |
var padding = [ 40, 10, 50, 100 ]; | |
//top [0] right [1] bottom [2] left [3] | |
var xScale = d3.scale.linear() | |
.range([ padding[3], w - padding[1] - padding[3] ]); | |
var yScale = d3.scale.linear() | |
.range([ padding[0], h - padding[2] ]); | |
var rScale = d3.scale.linear() | |
.range([2.5, 20]); | |
var xAxis = d3.svg.axis() | |
.scale(xScale) | |
.orient("bottom") | |
.ticks(3) | |
.outerTickSize(0); | |
var yAxis = d3.svg.axis() | |
.scale(yScale) | |
.orient("left") | |
.ticks(5) | |
.outerTickSize(0); | |
var svg = d3.select("body") | |
.append("svg") | |
.attr("width", w) | |
.attr("height", h); | |
d3.csv("ct_fh_aid.csv", function(data) { | |
xScale.domain([ | |
d3.min(data, function(d) { | |
return +d.fh-.5; | |
}), | |
d3.max(data, function(d) { | |
return +d.fh; | |
}) | |
]); | |
yScale.domain([ | |
d3.max(data, function(d) { | |
return +d.disbursed; | |
}), | |
d3.min(data, function(d) { | |
return +d.disbursed-100000; | |
}) | |
]); | |
rScale.domain([ | |
d3.min(data, function(d) { | |
return +d.disbursed; | |
}), | |
d3.max(data, function(d) { | |
return +d.disbursed; | |
}) | |
]); | |
var circles = svg.selectAll("circle") | |
.data(data) | |
.enter() | |
.append("circle"); | |
circles | |
.attr("cx", function(d) { | |
return xScale(+d.fh); | |
}) | |
.attr("cy", function(d) { | |
return yScale(+d.disbursed); | |
}) | |
.attr("r", function(d) { | |
return rScale(+d.disbursed); | |
}) | |
.attr("fill", "#292E37") | |
.attr("opacity", 0.7) | |
.append("title") | |
.text(function(d) { | |
return d.country + " Freedom House: " + d.fh + ", and CT Aid Disbursed: " + d.disbursed; | |
}); | |
svg.append("g") | |
.attr("class", "x axis") | |
.attr("transform", "translate(0," + (h - padding[2]) + ")") | |
.call(xAxis); | |
svg.append("g") | |
.attr("class", "y axis") | |
.attr("transform", "translate(" + padding[3] + ",0)") | |
.call(yAxis); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment