Last active
June 22, 2019 21:55
-
-
Save adamwd392/c36f82dd42c3daf5eed2 to your computer and use it in GitHub Desktop.
hw6
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 | longmin | latmin | longmax | latmax | |
---|---|---|---|---|---|
Aruba | -70.983 | 12.4 | -69.85 | 12.617 | |
Antigua and Barbuda | -62.417 | 16.817 | -61.65 | 17.75 | |
United Arab Emirates | 45 | 22.167 | 59.25 | 26.133 | |
Afghanistan | 60.433 | 29.15 | 75.033 | 38.484 | |
Algeria | -8.7 | 18.027 | 70.554 | 37.203 | |
Azerbaijan | 44.783 | 38.417 | 50.858 | 41.911 | |
Albania | 19 | 39.583 | 21.05 | 42.659 | |
Armenia | 43.443 | 38.857 | 46.589 | 41.3 | |
Andorra | 1.417 | 42.433 | 1.783 | 42.65 | |
Angola | 10 | -33.806 | 24.35 | -3.033 | |
Argentina | -73.533 | -58.583 | -53.367 | -21.783 | |
Australia | 112.467 | -55.05 | 168 | -9.133 | |
Austria | 1.2 | 46.373 | 19 | 49.017 | |
Bahrain | 45 | 25 | 50.954 | 26.566 | |
Barbados | -59.667 | 12.967 | -59.383 | 13.333 | |
Botswana | 20 | -28.517 | 29.35 | 24.583 | |
Belgium | 2.367 | 49.5 | 6.4 | 51.683 | |
Bahamas | -86 | 20 | -70 | 29.547 | |
Bangladesh | 84 | 20.6 | 92.683 | 26.817 | |
Belize | -89.95 | 15 | -75 | 18.483 | |
Bosnia and H | 15.746 | 42.558 | 19.671 | 45.268 | |
Bolivia | -69.65 | -26.867 | -57.55 | 9.678 | |
Burma | 91.833 | 6 | 102 | 28.35 | |
Benin | -4 | 5 | 92.219 | 21.322 | |
Belarus | 22.55 | 50.717 | 32.85 | 56.133 | |
Brazil | -73.817 | -33.733 | -28.85 | 16.8 | |
Bhutan | 80 | 26.217 | 92.717 | 30 | |
Bulgaria | 22.371 | 41 | 28.6 | 44.215 | |
Brunei | 110 | -2 | 120 | 15 | |
Burundi | 29.018 | -4.455 | 31.783 | -0.95 | |
Canada | -163.9 | 39 | -52.083 | 83.133 | |
Cambodia | 14.869 | 9.917 | 107.567 | 17.483 | |
Chad | 2 | 7.483 | 27.133 | 26 | |
Sri Lanka | 75 | 5.9 | 81.917 | 10.083 | |
China | 74.167 | 18.163 | 135.078 | 53.5 | |
Chile | -109.467 | -64.05 | -8.847 | 42.583 | |
Cameroon | 8.467 | 1.417 | 20 | 16 | |
Comoros | 43.067 | -13 | 45.317 | -11.35 | |
Colombia | -81.85 | -5 | 76.833 | 15 | |
Costa Rica | -87.1 | -0.792 | -46.633 | 15 | |
Central Africa | 13.4 | 0 | 27.45 | 10.983 | |
Cuba | -90 | 15 | 83.917 | 25 | |
Cape Verde | -25.367 | 14.8 | -22.65 | 17.2 | |
Cyprus | 32.271 | 34.567 | 34.6 | 35.7 | |
Denmark | 4.517 | 53.583 | 18 | 64 | |
Djibouti | 39.5 | 10.267 | 43.452 | 19 | |
Dominican Republic | -86 | 15 | 70.5 | 21 | |
Ecuador | -92 | -4.967 | -75.2 | 1.65 | |
Egypt | 13 | 5 | 37 | 50.861 | |
Ireland | -10.683 | 51.367 | -4 | 55.433 | |
Estonia | 21.781 | 57.521 | 28.883 | 59.983 | |
Eritrea | 20 | 0 | 43.417 | 18.033 | |
El Salvador | -90.184 | 13.15 | -87.644 | 14.45 | |
Ethiopia | 33.017 | 3.233 | 47.783 | 19 | |
EU | 40.367 | -22.333 | 40.367 | -22.333 | |
Czech Republ | 12.117 | 39.983 | 38.083 | 59.65 | |
Finland | 18 | 0 | 60.203 | 70.083 | |
Fiji | -179.983 | -45 | 180 | -11.167 | |
France | -5.225 | 41.333 | 9.55 | 51.2 | |
Gambia | -16.817 | 5 | 20 | 13.817 | |
Gabon | 8.7 | -3.95 | 14.533 | 5.983 | |
Georgia | 40.009 | 41.15 | 46.659 | 43.582 | |
Ghana | -4 | 4.733 | 20 | 11.167 | |
Grenada | -61.8 | 11.983 | -61.25 | 12.667 | |
Germany | 5.867 | 45.967 | 15.033 | 55.133 | |
Greece | 19.382 | 34.8 | 29.667 | 44 | |
Guatemala | -92.583 | 13.749 | -75 | 17.817 | |
Guinea | -15.417 | 4.367 | 20 | 13.3 | |
Guyana | -61.283 | 1.25 | -56 | 8.433 | |
Haiti | -86 | 8.547 | 72.296 | 21 | |
Honduras | -89.967 | 13 | -75 | 17.45 | |
Croatia | 13.484 | 42.367 | 19.391 | 46.527 | |
Hungary | 16.133 | 45.75 | 22.867 | 48.983 | |
Iceland | -26 | 62 | -6 | 67.117 | |
Indonesia | 0 | -11.983 | 141.033 | 15 | |
India | 65 | 6 | 97.35 | 35.956 | |
Iran | 27.445 | 5.322 | 96.024 | 39.933 | |
Israel | 34.282 | 29 | 35.667 | 33.286 | |
Italy | 1.133 | 28.969 | 54.824 | 49.2 | |
Iraq | 38.782 | 28.833 | 49.433 | 37.358 | |
Japan | 122.933 | 20.417 | 156.067 | 50.617 | |
Jamaica | -78.667 | 15 | -70 | 18.533 | |
Jordan | 34.783 | 29 | 39.1 | 33.333 | |
Kenya | 24.283 | -5.083 | 41.878 | 4.883 | |
Kyrgyzstan | 69.333 | 39.183 | 80.116 | 43.833 | |
North Korea | 124.128 | 37.621 | 130.672 | 43.004 | |
Kiribati | -179.217 | -45 | 180 | 30 | |
South Korea | 124.612 | 29 | 131.867 | 38.6 | |
Kuwait | 45 | 25 | 49.411 | 30.083 | |
Kazakhstan | 46.583 | 40.417 | 90 | 55.428 | |
Laos | 100.083 | 13.933 | 107.683 | 22.5 | |
Lebanon | 35.104 | 33.067 | 36.623 | 34.691 | |
Latvia | 20.967 | 55.667 | 28.233 | 58.067 | |
Lithuania | 20.991 | 53 | 28.233 | 56.467 | |
Liberia | -11.598 | 4.328 | -4 | 9.5 | |
Slovakia | 16.967 | 45.5 | 26.5 | 49.85 | |
Liechtenstei | 9.5 | 47.05 | 9.75 | 47.25 | |
Lesotho | 24 | -30.667 | 29.483 | -28.567 | |
Luxembourg | 5.743 | 49.45 | 6.517 | 50.182 | |
Libya | 5 | 20.25 | 25.5 | 33.15 | |
Madagascar | 42.4 | -25.9 | 50.483 | -11.95 | |
Moldova | 26.672 | 45.482 | 30.096 | 48.467 | |
Mongolia | 87.783 | 41.55 | 119.917 | 52.1 | |
Malawi | 32.717 | -17.15 | 37 | -5 | |
Montenegro | 18.438 | 41.864 | 20.345 | 43.548 | |
Macedonia | 20.405 | 40.867 | 23.033 | 42.373 | |
Mali | -13.75 | 4.318 | 20 | 26 | |
Monaco | 7.4 | 43.717 | 7.439 | 43.746 | |
Morocco | -13.1 | 3.36 | 9.542 | 36.61 | |
Mauritius | 56.567 | -20.522 | 73.567 | 10.4 | |
Mauritania | -17.117 | 10 | 20 | 27.117 | |
Malta | 14.184 | 35.782 | 15 | 36.333 | |
Oman | 5.1 | 15.083 | 65 | 26.567 | |
Maldives | 61.5 | -10.5 | 75 | 20 | |
Mexico | -119.922 | 0 | 110.75 | 45 | |
Malaysia | 98.933 | 0 | 124.125 | 15 | |
Mozambique | 4.017 | -26.867 | 43 | 15.033 | |
Niger | 0.183 | 1.617 | 20 | 26 | |
Vanuatu | -130 | -45 | 180 | 0 | |
Nigeria | 2.483 | 3.883 | 20 | 13.867 | |
Netherlands | 3.133 | 50.75 | 7.217 | 53.683 | |
Norway | 2.553 | 56.15 | 31.833 | 71.5 | |
Nepal | 80 | 25.767 | 88.183 | 30.45 | |
Nauru | 166.917 | -0.55 | 166.95 | -0.5 | |
Suriname | -60 | 2 | -53.967 | 6.017 | |
Nicaragua | -87.7 | 0 | 0 | 15 | |
New Zealand | -179 | -52.617 | 179.067 | 36.783 | |
Paraguay | -62.633 | -27.55 | -54.267 | -19.317 | |
Peru | -81.458 | -18.357 | 74.35 | 11.371 | |
Pakistan | 17.899 | 23.733 | 77.8 | 43.713 | |
Poland | -21.583 | 45.5 | 26.5 | 55.183 | |
Panama | -83.65 | 7.2 | -8.433 | 15 | |
Portugal | -73.15 | 8.496 | 8.683 | 42.15 | |
Palau | 131.175 | 2.874 | 134.716 | 8.342 | |
Guinea-Bissa | -16.7 | 5 | -4 | 12.8 | |
Qatar | 50.644 | 24.285 | 52.75 | 26.441 | |
Serbia | 18.859 | 41.844 | 22.967 | 46.167 | |
Romania | 19 | 43.517 | 29.967 | 48.25 | |
Philippines | 63.295 | 4.444 | 130.5 | 34.434 | |
Russia | -179.985 | 38.083 | 179.917 | 86.217 | |
Rwanda | 28.867 | -3.317 | 37 | 5 | |
Saudi Arabia | 24.08 | 5 | 55.5 | 48.555 | |
Saint Kitts | -62.85 | 17.083 | -62.517 | 17.417 | |
Seychelles | 20.462 | -10.217 | 57.083 | 42.641 | |
South Africa | 16.45 | -35.5 | 33.533 | -22.133 | |
Senegal | -17.683 | 12.267 | -11.357 | 16.681 | |
Slovenia | 13.427 | 44.083 | 17.467 | 46.933 | |
Sierra Leone | -13.417 | 5 | -4 | 10 | |
San Marino | 12.417 | 43.908 | 12.5 | 43.983 | |
Singapore | 101.333 | 1.083 | 104.412 | 4 | |
Somalia | 20 | -1.659 | 65 | 20 | |
Spain | -18.167 | 27.633 | 6.033 | 44 | |
Saint Lucia | -61.083 | 13.5 | -60.867 | 14.15 | |
Sudan | 18.783 | 3.517 | 38.833 | 27.167 | |
Sweden | 1.3 | 16.693 | 60.717 | 69.033 | |
Syria | 35.599 | 32 | 42.5 | 37.28 | |
Switzerland | 5.967 | 45.15 | 12.467 | 52.883 | |
Thailand | 95 | 4.15 | 139.183 | 20.445 | |
Tajikistan | 67.417 | 36.717 | 75 | 40.933 | |
Tonga | -179.117 | -45 | 180 | 0 | |
Togo | -4 | 5 | 20 | 11.133 | |
Tunisia | 4 | 23.717 | 13 | 37.667 | |
East Timor | 124.069 | -9.474 | 127.606 | -7.557 | |
Turkey | 25 | 35.819 | 44.85 | 42.1 | |
Tuvalu | 176.1 | -10.75 | 179.883 | -5.65 | |
Taiwan | 118.115 | 21 | 125 | 29 | |
Turkmenistan | 52.117 | 35.212 | 66.65 | 42.633 | |
Tanzania | 29.583 | -11.733 | 40.45 | 5 | |
Uganda | 29.467 | -1.483 | 34.967 | 4.55 | |
United Kingdom | -13.683 | 48.5 | 3.858 | 64.067 | |
Ukraine | 18.85 | 37.8 | 76.1 | 64.95 | |
United States | -124.626080 | 18.005611 | -62.361014 | 48.987386 | |
Burkina Faso | -5.483 | 9.4 | 20 | 14.983 | |
Uruguay | -58.5 | -35.783 | -51.283 | -30.117 | |
Uzbekistan | 44.517 | 35.267 | 92.2 | 66.15 | |
Saint Vincent | -61.467 | 12.533 | -61 | 13.5 | |
Venezuela | -76.434 | -0.877 | 69.211 | 19.199 | |
Vietnam | 17.667 | 8.383 | 115 | 23.667 | |
Namibia | 11.75 | -32 | 36.283 | -16.983 | |
Samoa | -172.867 | -14.05 | -171 | -13.417 | |
Swaziland | 30.35 | -27.417 | 32.333 | -25.75 | |
Yemen | 39.5 | 12.1 | 65 | 27.695 | |
Zambia | 2.983 | -18.05 | 39.283 | 5 | |
Zimbabwe | 18 | -32 | 33.8 | -13.633 |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<style> | |
.bar { | |
fill: teal; | |
} | |
.axis { | |
font: 10px arial; | |
} | |
.axis path, | |
.axis line { | |
fill: none; | |
stroke: #000; | |
} | |
</style> | |
<body> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> | |
<script> | |
var margin = {top: 40, right: 40, bottom: 40, left: 50}, | |
width = 960 - margin.left - margin.right, | |
height = 500 - margin.top - margin.bottom; | |
var x = d3.scale.linear() | |
.range([0, width]); | |
var y = d3.scale.linear() | |
.range([height, 0]); | |
var xAxis = d3.svg.axis() | |
.scale(x) | |
.orient("bottom"); | |
var yAxis = d3.svg.axis() | |
.scale(y) | |
.orient("left"); | |
var svg = d3.select("body").append("svg") | |
.attr("width", width + margin.left + margin.right) | |
.attr("height", height + margin.top + margin.bottom) | |
.append("g") | |
.attr("transform", "translate(" + margin.left + "," + margin.top + ")"); | |
var boundingBoxQueryURLS = {}; | |
d3.tsv("country-boundingboxes.tsv", function(error, data) { | |
if (error) { | |
console.log(error); | |
} | |
boundingBoxesArray = data.map(function(d) { return [ d["country"], d["longmin"], d["latmin"], d["longmax"], d["latmax"] ]; }); | |
for(var i = 0; i < boundingBoxesArray.length; i++) { | |
boundingBoxQueryURLS[boundingBoxesArray[i][0]] = "http://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&minlongitude="+boundingBoxesArray[i][1]+"&minlatitude="+boundingBoxesArray[i][2]+"&maxlongitude="+boundingBoxesArray[i][3]+"&maxlatitude="+boundingBoxesArray[i][4] | |
} | |
}); | |
d3.json(boundingBoxQueryURLS["Japan"], function(error, data) { | |
if (error) { | |
console.log(error); | |
} | |
var magnitudeDataArray = [], intensityDataArray = []; | |
magnitudeDataArray = data.features.map(function(d) { return d.properties.mag; }); | |
intensityDataArray = data.features.map(function(d) { return d.properties.cdi; }); | |
x.domain(d3.extent(magnitudeDataArray, function(d) { return d; })).nice(); | |
y.domain(d3.extent(intensityDataArray, function(d) { return d; })).nice(); | |
svg.append("g") | |
.attr("class", "x axis") | |
.attr("transform", "translate(0," + height + ")") | |
.call(xAxis); | |
svg.append("g") | |
.attr("class", "y axis") | |
.call(yAxis); | |
svg.append("text") | |
.attr("text-anchor", "middle") | |
.attr("x", width/2) | |
.attr("y", height + margin.bottom/3 + 9) | |
.text("Magnitude"); | |
svg.append("text") | |
.attr("text-anchor", "middle") | |
.attr("x", -height/2) | |
.attr("y", 10) | |
.attr("dy", "-3em") | |
.attr("transform", "rotate(-90)") | |
.text("Intensity Rating"); | |
svg.append("text") | |
.attr("text-anchor", "middle") | |
.attr("x", width/2) | |
.attr("y", -margin.top/2) | |
.attr("dy", "+.75em") | |
.text("Magnitude Ratings vs Intensity Ratings"); | |
svg.selectAll(".dot") | |
.data(magnitudeDataArray) | |
.enter().append("circle") | |
.attr("class", "dot") | |
.attr("r", 3) //radius of 3 | |
.attr("cx", function(d) { return x(d); }) | |
.data(intensityDataArray) | |
.attr("cy", function(d) { return y(d); }) | |
.style("fill", function(d) { return color(d); }); //color | |
}); | |
</script> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment