Created
November 9, 2015 06:22
-
-
Save lmelgar/63de22d5f26adc8853ed to your computer and use it in GitHub Desktop.
"Week 11: Region Colors"
This file contains hidden or 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
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d=a("./legend");b.exports=function(){function a(a){var v=d.d3_calcType(c,t,j,k,o,r),w=a.append("g").attr("class",l+"legendCells"),x=w.selectAll("."+l+"cell").data(v.data),y=x.enter().append("g",".cell").attr("class",l+"cell").style("opacity",1e-6);shapeEnter=y.append(e).attr("class",l+"swatch"),shapes=x.select("g."+l+"cell "+e),d.d3_addEvents(y,u),x.exit().transition().style("opacity",0).remove(),d.d3_drawShapes(e,shapes,g,f,h,b),d.d3_addText(w,y,v.labels,l);var z=x.select("text"),A=shapes[0].map(function(a){return a.getBBox()});m?shapes.attr("class",function(a){return l+"swatch "+v.feature(a)}):"line"==e?shapes.style("stroke",v.feature):shapes.style("fill",v.feature);var B,C,D="start"==q?0:"middle"==q?.5:1;"vertical"===s?(B=function(a,b){return"translate(0, "+b*(A[b].height+i)+")"},C=function(a,b){return"translate("+(A[b].width+A[b].x+p)+","+(A[b].y+A[b].height/2+5)+")"}):"horizontal"===s&&(B=function(a,b){return"translate("+b*(A[b].width+i)+",0)"},C=function(a,b){return"translate("+(A[b].width*D+A[b].x)+","+(A[b].height+A[b].y+p+8)+")"}),d.d3_placement(s,x,B,z,C,q),d.d3_title(a,w,n,l),x.transition().style("opacity",1)}var b,c=d3.scale.linear(),e="rect",f=15,g=15,h=10,i=2,j=[5],k=[],l="",m=!1,n="",o=d3.format(".01f"),p=10,q="middle",r="to",s="vertical",t=!1,u=d3.dispatch("cellover","cellout","cellclick");return a.scale=function(b){return arguments.length?(c=b,a):a},a.cells=function(b){return arguments.length?((b.length>1||b>=2)&&(j=b),a):a},a.shape=function(c,d){return arguments.length?(("rect"==c||"circle"==c||"line"==c||"path"==c&&"string"==typeof d)&&(e=c,b=d),a):a},a.shapeWidth=function(b){return arguments.length?(f=+b,a):a},a.shapeHeight=function(b){return arguments.length?(g=+b,a):a},a.shapeRadius=function(b){return arguments.length?(h=+b,a):a},a.shapePadding=function(b){return arguments.length?(i=+b,a):a},a.labels=function(b){return arguments.length?(k=b,a):a},a.labelAlign=function(b){return arguments.length?(("start"==b||"end"==b||"middle"==b)&&(q=b),a):a},a.labelFormat=function(b){return arguments.length?(o=b,a):a},a.labelOffset=function(b){return arguments.length?(p=+b,a):a},a.labelDelimiter=function(b){return arguments.length?(r=b,a):a},a.useClass=function(b){return arguments.length?((b===!0||b===!1)&&(m=b),a):a},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),("horizontal"==b||"vertical"==b)&&(s=b),a):a},a.ascending=function(b){return arguments.length?(t=!!b,a):a},a.classPrefix=function(b){return arguments.length?(l=b,a):a},a.title=function(b){return arguments.length?(n=b,a):a},d3.rebind(a,u,"on"),a}},{"./legend":2}],2:[function(a,b,c){b.exports={d3_identity:function(a){return a},d3_mergeLabels:function(a,b){if(0===b.length)return a;a=a?a:[];for(var c=b.length;c<a.length;c++)b.push(a[c]);return b},d3_linearLegend:function(a,b,c){var d=[];if(b.length>1)d=b;else for(var e=a.domain(),f=(e[e.length-1]-e[0])/(b-1),g=0;b>g;g++)d.push(e[0]+g*f);var h=d.map(c);return{data:d,labels:h,feature:function(b){return a(b)}}},d3_quantLegend:function(a,b,c){var d=a.range().map(function(d){var e=a.invertExtent(d);b(e[0]),b(e[1]);return b(e[0])+" "+c+" "+b(e[1])});return{data:a.range(),labels:d,feature:this.d3_identity}},d3_ordinalLegend:function(a){return{data:a.domain(),labels:a.domain(),feature:function(b){return a(b)}}},d3_drawShapes:function(a,b,c,d,e,f){"rect"===a?b.attr("height",c).attr("width",d):"circle"===a?b.attr("r",e):"line"===a?b.attr("x1",0).attr("x2",d).attr("y1",0).attr("y2",0):"path"===a&&b.attr("d",f)},d3_addText:function(a,b,c,d){b.append("text").attr("class",d+"label"),a.selectAll("g.cell text").data(c).text(this.d3_identity)},d3_calcType:function(a,b,c,d,e,f){var g=a.ticks?this.d3_linearLegend(a,c,e):a.invertExtent?this.d3_quantLegend(a,e,f):this.d3_ordinalLegend(a);return g.labels=this.d3_mergeLabels(g.labels,d),b&&(g.labels=this.d3_reverse(g.labels),g.data=this.d3_reverse(g.data)),g},d3_reverse:function(a){for(var b=[],c=0,d=a.length;d>c;c++)b[c]=a[d-c-1];return b},d3_placement:function(a,b,c,d,e,f){b.attr("transform",c),d.attr("transform",e),"horizontal"===a&&d.style("text-anchor",f)},d3_addEvents:function(a,b){var c=this;a.on("mouseover.legend",function(a){c.d3_cellOver(b,a,this)}).on("mouseout.legend",function(a){c.d3_cellOut(b,a,this)}).on("click.legend",function(a){c.d3_cellClick(b,a,this)})},d3_cellOver:function(a,b,c){a.cellover.call(c,b)},d3_cellOut:function(a,b,c){a.cellout.call(c,b)},d3_cellClick:function(a,b,c){a.cellclick.call(c,b)},d3_title:function(a,b,c,d){if(""!==c){a.append("text").attr("class",d+"legendTitle").text(c);var e=a.select("."+d+"legendTitle").map(function(a){return a[0].getBBox().height})[0],f=-b.map(function(a){return a[0].getBBox().x})[0];b.attr("transform","translate("+f+","+(e+10)+")")}}}},{}],3:[function(a,b,c){var d=a("./legend");b.exports=function(){function a(a){var s=d.d3_calcType(c,q,h,i,l,o),t=a.append("g").attr("class",j+"legendCells"),u=t.selectAll("."+j+"cell").data(s.data),v=u.enter().append("g",".cell").attr("class",j+"cell").style("opacity",1e-6);shapeEnter=v.append(e).attr("class",j+"swatch"),shapes=u.select("g."+j+"cell "+e),d.d3_addEvents(v,r),u.exit().transition().style("opacity",0).remove(),"line"===e?(d.d3_drawShapes(e,shapes,0,f),shapes.attr("stroke-width",s.feature)):d.d3_drawShapes(e,shapes,s.feature,s.feature,s.feature,b),d.d3_addText(t,v,s.labels,j);var w,x,y=u.select("text"),z=shapes[0].map(function(a,b){var d=a.getBBox(),f=c(s.data[b]);return"line"===e&&"horizontal"===p?d.height=d.height+f:"line"===e&&"vertical"===p&&(d.width=d.width),d}),A=d3.max(z,function(a){return a.height+a.y}),B=d3.max(z,function(a){return a.width+a.x}),C="start"==n?0:"middle"==n?.5:1;"vertical"===p?(w=function(a,b){var c=d3.sum(z.slice(0,b+1),function(a){return a.height});return"translate(0, "+(c+b*g)+")"},x=function(a,b){return"translate("+(B+m)+","+(z[b].y+z[b].height/2+5)+")"}):"horizontal"===p&&(w=function(a,b){var c=d3.sum(z.slice(0,b+1),function(a){return a.width});return"translate("+(c+b*g)+",0)"},x=function(a,b){return"translate("+(z[b].width*C+z[b].x)+","+(A+m)+")"}),d.d3_placement(p,u,w,y,x,n),d.d3_title(a,t,k,j),u.transition().style("opacity",1)}var b,c=d3.scale.linear(),e="rect",f=15,g=2,h=[5],i=[],j="",k="",l=d3.format(".01f"),m=10,n="middle",o="to",p="vertical",q=!1,r=d3.dispatch("cellover","cellout","cellclick");return a.scale=function(b){return arguments.length?(c=b,a):a},a.cells=function(b){return arguments.length?((b.length>1||b>=2)&&(h=b),a):a},a.shape=function(c,d){return arguments.length?(("rect"==c||"circle"==c||"line"==c)&&(e=c,b=d),a):a},a.shapeWidth=function(b){return arguments.length?(f=+b,a):a},a.shapePadding=function(b){return arguments.length?(g=+b,a):a},a.labels=function(b){return arguments.length?(i=b,a):a},a.labelAlign=function(b){return arguments.length?(("start"==b||"end"==b||"middle"==b)&&(n=b),a):a},a.labelFormat=function(b){return arguments.length?(l=b,a):a},a.labelOffset=function(b){return arguments.length?(m=+b,a):a},a.labelDelimiter=function(b){return arguments.length?(o=b,a):a},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),("horizontal"==b||"vertical"==b)&&(p=b),a):a},a.ascending=function(b){return arguments.length?(q=!!b,a):a},a.classPrefix=function(b){return arguments.length?(j=b,a):a},a.title=function(b){return arguments.length?(k=b,a):a},d3.rebind(a,r,"on"),a}},{"./legend":2}],4:[function(a,b,c){var d=a("./legend");b.exports=function(){function a(a){var t=d.d3_calcType(b,r,i,j,m,p),u=a.append("g").attr("class",k+"legendCells"),v=u.selectAll("."+k+"cell").data(t.data),w=v.enter().append("g",".cell").attr("class",k+"cell").style("opacity",1e-6);shapeEnter=w.append(c).attr("class",k+"swatch"),shapes=v.select("g."+k+"cell "+c),d.d3_addEvents(w,s),v.exit().transition().style("opacity",0).remove(),d.d3_drawShapes(c,shapes,f,e,g,t.feature),d.d3_addText(u,w,t.labels,k);var x,y,z=v.select("text"),A=shapes[0].map(function(a){return a.getBBox()}),B=d3.max(A,function(a){return a.height}),C=d3.max(A,function(a){return a.width}),D="start"==n?0:"middle"==n?.5:1;"vertical"===q?(x=function(a,b){return"translate(0, "+b*(B+h)+")"},y=function(a,b){return"translate("+(C+o)+","+(A[b].y+A[b].height/2+5)+")"}):"horizontal"===q&&(x=function(a,b){return"translate("+b*(C+h)+",0)"},y=function(a,b){return"translate("+(A[b].width*D+A[b].x)+","+(B+o)+")"}),d.d3_placement(q,v,x,z,y,n),d.d3_title(a,u,l,k),v.transition().style("opacity",1)}var b=d3.scale.linear(),c="path",e=15,f=15,g=10,h=5,i=[5],j=[],k="",l="",m=d3.format(".01f"),n="middle",o=10,p="to",q="vertical",r=!1,s=d3.dispatch("cellover","cellout","cellclick");return a.scale=function(c){return arguments.length?(b=c,a):a},a.cells=function(b){return arguments.length?((b.length>1||b>=2)&&(i=b),a):a},a.shapePadding=function(b){return arguments.length?(h=+b,a):a},a.labels=function(b){return arguments.length?(j=b,a):a},a.labelAlign=function(b){return arguments.length?(("start"==b||"end"==b||"middle"==b)&&(n=b),a):a},a.labelFormat=function(b){return arguments.length?(m=b,a):a},a.labelOffset=function(b){return arguments.length?(o=+b,a):a},a.labelDelimiter=function(b){return arguments.length?(p=b,a):a},a.orient=function(b){return arguments.length?(b=b.toLowerCase(),("horizontal"==b||"vertical"==b)&&(q=b),a):a},a.ascending=function(b){return arguments.length?(r=!!b,a):a},a.classPrefix=function(b){return arguments.length?(k=b,a):a},a.title=function(b){return arguments.length?(l=b,a):a},d3.rebind(a,s,"on"),a}},{"./legend":2}],5:[function(a,b,c){d3.legend={color:a("./color"),size:a("./size"),symbol:a("./symbol")}},{"./color":1,"./size":3,"./symbol":4}]},{},[5]); |
This file contains hidden or 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> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<style> | |
body { | |
font-family: Helvetica, sans-serif; | |
padding: 40px; | |
} | |
.countries { | |
stroke: #fff; | |
stroke-width:0.6px; | |
} | |
.legendLinear text { | |
font-size: 12px; | |
fill: white; | |
} | |
</style> | |
<body> | |
<h2>Regions of the World</h2> | |
<div id="vis"></div> | |
<script src="//d3js.org/d3.v3.min.js"></script> | |
<script src="//d3js.org/queue.v1.min.js"></script> | |
<script src="d3-legend.min.js"></script> | |
<script src="//d3js.org/topojson.v1.min.js"></script> | |
<script src="http://d3js.org/d3.geo.projection.v0.min.js"></script> | |
<script> | |
var width = 1000, | |
height = 580; | |
var svg = d3.select('#vis').append('svg') | |
.attr('width', width) | |
.attr('height', height) | |
.style("background-color", "#3E446B"); | |
var projection = d3.geo.wagner4() | |
.scale(175) | |
.translate([width / 1.9, height / 1.7]) | |
.precision(.1); | |
var path = d3.geo.path() | |
.projection(projection); | |
var color = d3.scale.ordinal().range(["#D1E2E6", "#EDED8E", "#BAC484", "#D4A3B4", "#D1CEED", "#C9BA9B", "#FAB1B1"]); | |
var countryById = d3.map(); | |
// we use queue because we have 2 data files to load. | |
queue() | |
.defer(d3.json, "countries.json") | |
.defer(d3.csv, "indicators.csv", typeAndSet) // process | |
.await(loaded); | |
function typeAndSet(d) { | |
countryById.set(d.ISO3, d); | |
return d; | |
} | |
function getColor(d) { | |
var dataRow = countryById.get(d.id); | |
if (dataRow) { | |
console.log(dataRow); | |
return color(dataRow.Region); | |
} else { | |
console.log("no dataRow", d); | |
return "#ccc"; | |
} | |
} | |
function getText(d) { | |
var dataRow = countryById.get(d.id); | |
if (dataRow) { | |
console.log(dataRow); | |
return dataRow.ShortName + ": " + dataRow.Region; | |
} else { | |
console.log("no dataRow", d); | |
return d.ShortName + ": No data."; | |
} | |
} | |
function loaded(error, countries, properties) { | |
console.log(countries); | |
console.log(properties); | |
color.domain(d3.range(["South Asia", "Europe & Central Asia", "Middle East & North Africa", "Sub-Saharan Africa", "Latin America & Caribbean", "East Asia & Pacific", "North America"])); | |
var world = topojson.feature(countries, countries.objects.units).features; | |
svg.selectAll('path.countries') | |
.data(world) | |
.enter() | |
.append('path') | |
.attr('class', 'countries') | |
.attr('d', path) | |
.attr('fill', function(d,i) { | |
console.log(d.properties.name); | |
return getColor(d); | |
}) | |
.append("title") | |
.text(function(d) { | |
return getText(d); | |
}); | |
var linear = color; | |
svg.append("g") | |
.attr("class", "legendLinear") | |
.attr("transform", "translate(20,20)"); | |
var legendLinear = d3.legend.color() | |
.shapeWidth(30) | |
.orient('vertical') | |
.scale(linear); | |
svg.select(".legendLinear") | |
.call(legendLinear); | |
} | |
</script> | |
</body> | |
</html> |
This file contains hidden or 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
Code | ISO3 | LongName | IncomeGroup | Region | ShortName | |
---|---|---|---|---|---|---|
AFG | AFG | Islamic State of Afghanistan | Low income | South Asia | Afghanistan | |
ALB | ALB | Republic of Albania | Upper middle income | Europe & Central Asia | Albania | |
DZA | DZA | People's Democratic Republic of Algeria | Upper middle income | Middle East & North Africa | Algeria | |
ASM | ASM | American Samoa | Upper middle income | East Asia & Pacific | American Samoa | |
ADO | AND | Principality of Andorra | High income: nonOECD | Europe & Central Asia | Andorra | |
AGO | AGO | People's Republic of Angola | Upper middle income | Sub-Saharan Africa | Angola | |
ATG | ATG | Antigua and Barbuda | High income: nonOECD | Latin America & Caribbean | Antigua and Barbuda | |
ARG | ARG | Argentine Republic | High income: nonOECD | Latin America & Caribbean | Argentina | |
ARM | ARM | Republic of Armenia | Lower middle income | Europe & Central Asia | Armenia | |
ABW | ABW | Aruba | High income: nonOECD | Latin America & Caribbean | Aruba | |
AUS | AUS | Commonwealth of Australia | High income: OECD | East Asia & Pacific | Australia | |
AUT | AUT | Republic of Austria | High income: OECD | Europe & Central Asia | Austria | |
AZE | AZE | Republic of Azerbaijan | Upper middle income | Europe & Central Asia | Azerbaijan | |
BHS | BHS | Commonwealth of The Bahamas | High income: nonOECD | Latin America & Caribbean | The Bahamas | |
BHR | BHR | Kingdom of Bahrain | High income: nonOECD | Middle East & North Africa | Bahrain | |
BGD | BGD | People's Republic of Bangladesh | Lower middle income | South Asia | Bangladesh | |
BRB | BRB | Barbados | High income: nonOECD | Latin America & Caribbean | Barbados | |
BLR | BLR | Republic of Belarus | Upper middle income | Europe & Central Asia | Belarus | |
BEL | BEL | Kingdom of Belgium | High income: OECD | Europe & Central Asia | Belgium | |
BLZ | BLZ | Belize | Upper middle income | Latin America & Caribbean | Belize | |
BEN | BEN | Republic of Benin | Low income | Sub-Saharan Africa | Benin | |
BMU | BMU | The Bermudas | High income: nonOECD | North America | Bermuda | |
BTN | BTN | Kingdom of Bhutan | Lower middle income | South Asia | Bhutan | |
BOL | BOL | Plurinational State of Bolivia | Lower middle income | Latin America & Caribbean | Bolivia | |
BIH | BIH | Bosnia and Herzegovina | Upper middle income | Europe & Central Asia | Bosnia and Herzegovina | |
BWA | BWA | Republic of Botswana | Upper middle income | Sub-Saharan Africa | Botswana | |
BRA | BRA | Federative Republic of Brazil | Upper middle income | Latin America & Caribbean | Brazil | |
BRN | BRN | Brunei Darussalam | High income: nonOECD | East Asia & Pacific | Brunei | |
BGR | BGR | Republic of Bulgaria | Upper middle income | Europe & Central Asia | Bulgaria | |
BFA | BFA | Burkina Faso | Low income | Sub-Saharan Africa | Burkina Faso | |
BDI | BDI | Republic of Burundi | Low income | Sub-Saharan Africa | Burundi | |
CPV | CPV | Republic of Cabo Verde | Lower middle income | Sub-Saharan Africa | Cabo Verde | |
KHM | KHM | Kingdom of Cambodia | Low income | East Asia & Pacific | Cambodia | |
CMR | CMR | Republic of Cameroon | Lower middle income | Sub-Saharan Africa | Cameroon | |
CAN | CAN | Canada | High income: OECD | North America | Canada | |
CYM | CYM | Cayman Islands | High income: nonOECD | Latin America & Caribbean | Cayman Islands | |
CAF | CAF | Central African Republic | Low income | Sub-Saharan Africa | Central African Republic | |
TCD | TCD | Republic of Chad | Low income | Sub-Saharan Africa | Chad | |
CHI | CHI | Channel Islands | High income: nonOECD | Europe & Central Asia | Channel Islands | |
CHL | CHL | Republic of Chile | High income: OECD | Latin America & Caribbean | Chile | |
CHN | CHN | People's Republic of China | Upper middle income | East Asia & Pacific | China | |
COL | COL | Republic of Colombia | Upper middle income | Latin America & Caribbean | Colombia | |
COM | COM | Union of the Comoros | Low income | Sub-Saharan Africa | Comoros | |
ZAR | COD | Democratic Republic of the Congo | Low income | Sub-Saharan Africa | Dem. Rep. Congo | |
COG | COG | Republic of Congo | Lower middle income | Sub-Saharan Africa | Congo | |
CRI | CRI | Republic of Costa Rica | Upper middle income | Latin America & Caribbean | Costa Rica | |
CIV | CIV | Republic of C™te d'Ivoire | Lower middle income | Sub-Saharan Africa | C™te d'Ivoire | |
HRV | HRV | Republic of Croatia | High income: nonOECD | Europe & Central Asia | Croatia | |
CUB | CUB | Republic of Cuba | Upper middle income | Latin America & Caribbean | Cuba | |
CUW | CUW | Curaçao | High income: nonOECD | Latin America & Caribbean | Curaçao | |
CYP | CYP | Republic of Cyprus | High income: nonOECD | Europe & Central Asia | Cyprus | |
CZE | CZE | Czech Republic | High income: OECD | Europe & Central Asia | Czech Republic | |
DNK | DNK | Kingdom of Denmark | High income: OECD | Europe & Central Asia | Denmark | |
DJI | DJI | Republic of Djibouti | Lower middle income | Middle East & North Africa | Djibouti | |
DMA | DMA | Commonwealth of Dominica | Upper middle income | Latin America & Caribbean | Dominica | |
DOM | DOM | Dominican Republic | Upper middle income | Latin America & Caribbean | Dominican Republic | |
ECU | ECU | Republic of Ecuador | Upper middle income | Latin America & Caribbean | Ecuador | |
EGY | EGY | Arab Republic of Egypt | Lower middle income | Middle East & North Africa | Egypt | |
SLV | SLV | Republic of El Salvador | Lower middle income | Latin America & Caribbean | El Salvador | |
GNQ | GNQ | Republic of Equatorial Guinea | High income: nonOECD | Sub-Saharan Africa | Equatorial Guinea | |
ERI | ERI | State of Eritrea | Low income | Sub-Saharan Africa | Eritrea | |
EST | EST | Republic of Estonia | High income: OECD | Europe & Central Asia | Estonia | |
ETH | ETH | Federal Democratic Republic of Ethiopia | Low income | Sub-Saharan Africa | Ethiopia | |
FRO | FRO | Faeroe Islands | High income: nonOECD | Europe & Central Asia | Faeroe Islands | |
FJI | FJI | Republic of Fiji | Upper middle income | East Asia & Pacific | Fiji | |
FIN | FIN | Republic of Finland | High income: OECD | Europe & Central Asia | Finland | |
FRA | FRA | French Republic | High income: OECD | Europe & Central Asia | France | |
PYF | PYF | French Polynesia | High income: nonOECD | East Asia & Pacific | French Polynesia | |
GAB | GAB | Gabonese Republic | Upper middle income | Sub-Saharan Africa | Gabon | |
GMB | GMB | Republic of The Gambia | Low income | Sub-Saharan Africa | The Gambia | |
GEO | GEO | Georgia | Lower middle income | Europe & Central Asia | Georgia | |
DEU | DEU | Federal Republic of Germany | High income: OECD | Europe & Central Asia | Germany | |
GHA | GHA | Republic of Ghana | Lower middle income | Sub-Saharan Africa | Ghana | |
GRC | GRC | Hellenic Republic | High income: OECD | Europe & Central Asia | Greece | |
GRL | GRL | Greenland | High income: nonOECD | Europe & Central Asia | Greenland | |
GRD | GRD | Grenada | Upper middle income | Latin America & Caribbean | Grenada | |
GUM | GUM | Guam | High income: nonOECD | East Asia & Pacific | Guam | |
GTM | GTM | Republic of Guatemala | Lower middle income | Latin America & Caribbean | Guatemala | |
GIN | GIN | Republic of Guinea | Low income | Sub-Saharan Africa | Guinea | |
GNB | GNB | Republic of Guinea-Bissau | Low income | Sub-Saharan Africa | Guinea-Bissau | |
GUY | GUY | Co-operative Republic of Guyana | Lower middle income | Latin America & Caribbean | Guyana | |
HTI | HTI | Republic of Haiti | Low income | Latin America & Caribbean | Haiti | |
HND | HND | Republic of Honduras | Lower middle income | Latin America & Caribbean | Honduras | |
HKG | HKG | Hong Kong Special Administrative Region of the People's Republic of China | High income: nonOECD | East Asia & Pacific | Hong Kong SAR, China | |
HUN | HUN | Hungary | High income: OECD | Europe & Central Asia | Hungary | |
ISL | ISL | Republic of Iceland | High income: OECD | Europe & Central Asia | Iceland | |
IND | IND | Republic of India | Lower middle income | South Asia | India | |
IDN | IDN | Republic of Indonesia | Lower middle income | East Asia & Pacific | Indonesia | |
IRN | IRN | Islamic Republic of Iran | Upper middle income | Middle East & North Africa | Iran | |
IRQ | IRQ | Republic of Iraq | Upper middle income | Middle East & North Africa | Iraq | |
IRL | IRL | Ireland | High income: OECD | Europe & Central Asia | Ireland | |
IMY | IMN | Isle of Man | High income: nonOECD | Europe & Central Asia | Isle of Man | |
ISR | ISR | State of Israel | High income: OECD | Middle East & North Africa | Israel | |
ITA | ITA | Italian Republic | High income: OECD | Europe & Central Asia | Italy | |
JAM | JAM | Jamaica | Upper middle income | Latin America & Caribbean | Jamaica | |
JPN | JPN | Japan | High income: OECD | East Asia & Pacific | Japan | |
JOR | JOR | Hashemite Kingdom of Jordan | Upper middle income | Middle East & North Africa | Jordan | |
KAZ | KAZ | Republic of Kazakhstan | Upper middle income | Europe & Central Asia | Kazakhstan | |
KEN | KEN | Republic of Kenya | Lower middle income | Sub-Saharan Africa | Kenya | |
KIR | KIR | Republic of Kiribati | Lower middle income | East Asia & Pacific | Kiribati | |
PRK | PRK | Democratic People's Republic of Korea | Low income | East Asia & Pacific | Dem. People's Rep. Korea | |
KOR | KOR | Republic of Korea | High income: OECD | East Asia & Pacific | Korea | |
KSV | KSV | Republic of Kosovo | Lower middle income | Europe & Central Asia | Kosovo | |
KWT | KWT | State of Kuwait | High income: nonOECD | Middle East & North Africa | Kuwait | |
KGZ | KGZ | Kyrgyz Republic | Lower middle income | Europe & Central Asia | Kyrgyz Republic | |
LAO | LAO | Lao People's Democratic Republic | Lower middle income | East Asia & Pacific | Lao PDR | |
LVA | LVA | Republic of Latvia | High income: nonOECD | Europe & Central Asia | Latvia | |
LBN | LBN | Lebanese Republic | Upper middle income | Middle East & North Africa | Lebanon | |
LSO | LSO | Kingdom of Lesotho | Lower middle income | Sub-Saharan Africa | Lesotho | |
LBR | LBR | Republic of Liberia | Low income | Sub-Saharan Africa | Liberia | |
LBY | LBY | Socialist People's Libyan Arab Jamahiriya | Upper middle income | Middle East & North Africa | Libya | |
LIE | LIE | Principality of Liechtenstein | High income: nonOECD | Europe & Central Asia | Liechtenstein | |
LTU | LTU | Republic of Lithuania | High income: nonOECD | Europe & Central Asia | Lithuania | |
LUX | LUX | Grand Duchy of Luxembourg | High income: OECD | Europe & Central Asia | Luxembourg | |
MAC | MAC | Macao Special Administrative Region of the People's Republic of China | High income: nonOECD | East Asia & Pacific | Macao SAR, China | |
MKD | MKD | Former Yugoslav Republic of Macedonia | Upper middle income | Europe & Central Asia | Macedonia | |
MDG | MDG | Republic of Madagascar | Low income | Sub-Saharan Africa | Madagascar | |
MWI | MWI | Republic of Malawi | Low income | Sub-Saharan Africa | Malawi | |
MYS | MYS | Malaysia | Upper middle income | East Asia & Pacific | Malaysia | |
MDV | MDV | Republic of Maldives | Upper middle income | South Asia | Maldives | |
MLI | MLI | Republic of Mali | Low income | Sub-Saharan Africa | Mali | |
MLT | MLT | Republic of Malta | High income: nonOECD | Middle East & North Africa | Malta | |
MHL | MHL | Republic of the Marshall Islands | Upper middle income | East Asia & Pacific | Marshall Islands | |
MRT | MRT | Islamic Republic of Mauritania | Lower middle income | Sub-Saharan Africa | Mauritania | |
MUS | MUS | Republic of Mauritius | Upper middle income | Sub-Saharan Africa | Mauritius | |
MEX | MEX | United Mexican States | Upper middle income | Latin America & Caribbean | Mexico | |
FSM | FSM | Federated States of Micronesia | Lower middle income | East Asia & Pacific | Micronesia | |
MDA | MDA | Republic of Moldova | Lower middle income | Europe & Central Asia | Moldova | |
MCO | MCO | Principality of Monaco | High income: nonOECD | Europe & Central Asia | Monaco | |
MNG | MNG | Mongolia | Upper middle income | East Asia & Pacific | Mongolia | |
MNE | MNE | Montenegro | Upper middle income | Europe & Central Asia | Montenegro | |
MAR | MAR | Kingdom of Morocco | Lower middle income | Middle East & North Africa | Morocco | |
MOZ | MOZ | Republic of Mozambique | Low income | Sub-Saharan Africa | Mozambique | |
MMR | MMR | Republic of the Union of Myanmar | Lower middle income | East Asia & Pacific | Myanmar | |
NAM | NAM | Republic of Namibia | Upper middle income | Sub-Saharan Africa | Namibia | |
NPL | NPL | Nepal | Low income | South Asia | Nepal | |
NLD | NLD | Kingdom of the Netherlands | High income: OECD | Europe & Central Asia | Netherlands | |
NCL | NCL | New Caledonia | High income: nonOECD | East Asia & Pacific | New Caledonia | |
NZL | NZL | New Zealand | High income: OECD | East Asia & Pacific | New Zealand | |
NIC | NIC | Republic of Nicaragua | Lower middle income | Latin America & Caribbean | Nicaragua | |
NER | NER | Republic of Niger | Low income | Sub-Saharan Africa | Niger | |
NGA | NGA | Federal Republic of Nigeria | Lower middle income | Sub-Saharan Africa | Nigeria | |
MNP | MNP | Commonwealth of the Northern Mariana Islands | High income: nonOECD | East Asia & Pacific | Northern Mariana Islands | |
NOR | NOR | Kingdom of Norway | High income: OECD | Europe & Central Asia | Norway | |
OMN | OMN | Sultanate of Oman | High income: nonOECD | Middle East & North Africa | Oman | |
PAK | PAK | Islamic Republic of Pakistan | Lower middle income | South Asia | Pakistan | |
PLW | PLW | Republic of Palau | Upper middle income | East Asia & Pacific | Palau | |
PAN | PAN | Republic of Panama | Upper middle income | Latin America & Caribbean | Panama | |
PNG | PNG | The Independent State of Papua New Guinea | Lower middle income | East Asia & Pacific | Papua New Guinea | |
PRY | PRY | Republic of Paraguay | Upper middle income | Latin America & Caribbean | Paraguay | |
PER | PER | Republic of Peru | Upper middle income | Latin America & Caribbean | Peru | |
PHL | PHL | Republic of the Philippines | Lower middle income | East Asia & Pacific | Philippines | |
POL | POL | Republic of Poland | High income: OECD | Europe & Central Asia | Poland | |
PRT | PRT | Portuguese Republic | High income: OECD | Europe & Central Asia | Portugal | |
PRI | PRI | Puerto Rico | High income: nonOECD | Latin America & Caribbean | Puerto Rico | |
QAT | QAT | State of Qatar | High income: nonOECD | Middle East & North Africa | Qatar | |
ROM | ROU | Romania | Upper middle income | Europe & Central Asia | Romania | |
RUS | RUS | Russian Federation | High income: nonOECD | Europe & Central Asia | Russia | |
RWA | RWA | Republic of Rwanda | Low income | Sub-Saharan Africa | Rwanda | |
WSM | WSM | Samoa | Lower middle income | East Asia & Pacific | Samoa | |
SMR | SMR | Republic of San Marino | High income: nonOECD | Europe & Central Asia | San Marino | |
STP | STP | Democratic Republic of S‹o Tom_ and Principe | Lower middle income | Sub-Saharan Africa | S‹o Tom_ and Principe | |
SAU | SAU | Kingdom of Saudi Arabia | High income: nonOECD | Middle East & North Africa | Saudi Arabia | |
SEN | SEN | Republic of Senegal | Lower middle income | Sub-Saharan Africa | Senegal | |
SRB | SRB | Republic of Serbia | Upper middle income | Europe & Central Asia | Serbia | |
SYC | SYC | Republic of Seychelles | High income: nonOECD | Sub-Saharan Africa | Seychelles | |
SLE | SLE | Republic of Sierra Leone | Low income | Sub-Saharan Africa | Sierra Leone | |
SGP | SGP | Republic of Singapore | High income: nonOECD | East Asia & Pacific | Singapore | |
SXM | SXM | Sint Maarten (Dutch part) | High income: nonOECD | Latin America & Caribbean | Sint Maarten (Dutch part) | |
SVK | SVK | Slovak Republic | High income: OECD | Europe & Central Asia | Slovak Republic | |
SVN | SVN | Republic of Slovenia | High income: OECD | Europe & Central Asia | Slovenia | |
SLB | SLB | Solomon Islands | Lower middle income | East Asia & Pacific | Solomon Islands | |
SOM | SOM | Somali Democratic Republic | Low income | Sub-Saharan Africa | Somalia | |
ZAF | ZAF | Republic of South Africa | Upper middle income | Sub-Saharan Africa | South Africa | |
SSD | SSD | Republic of South Sudan | Low income | Sub-Saharan Africa | South Sudan | |
ESP | ESP | Kingdom of Spain | High income: OECD | Europe & Central Asia | Spain | |
LKA | LKA | Democratic Socialist Republic of Sri Lanka | Lower middle income | South Asia | Sri Lanka | |
KNA | KNA | St. Kitts and Nevis | High income: nonOECD | Latin America & Caribbean | St. Kitts and Nevis | |
LCA | LCA | St. Lucia | Upper middle income | Latin America & Caribbean | St. Lucia | |
MAF | MAF | St. Martin (French part) | High income: nonOECD | Latin America & Caribbean | St. Martin (French part) | |
VCT | VCT | St. Vincent and the Grenadines | Upper middle income | Latin America & Caribbean | St. Vincent and the Grenadines | |
SDN | SDN | Republic of the Sudan | Lower middle income | Sub-Saharan Africa | Sudan | |
SUR | SUR | Republic of Suriname | Upper middle income | Latin America & Caribbean | Suriname | |
SWZ | SWZ | Kingdom of Swaziland | Lower middle income | Sub-Saharan Africa | Swaziland | |
SWE | SWE | Kingdom of Sweden | High income: OECD | Europe & Central Asia | Sweden | |
CHE | CHE | Switzerland | High income: OECD | Europe & Central Asia | Switzerland | |
SYR | SYR | Syrian Arab Republic | Lower middle income | Middle East & North Africa | Syrian Arab Republic | |
TWN | TWN | Taiwan, China | High income: nonOECD | East Asia & Pacific | Taiwan, China | |
TJK | TJK | Republic of Tajikistan | Lower middle income | Europe & Central Asia | Tajikistan | |
TZA | TZA | United Republic of Tanzania | Low income | Sub-Saharan Africa | Tanzania | |
THA | THA | Kingdom of Thailand | Upper middle income | East Asia & Pacific | Thailand | |
TMP | TLS | Democratic Republic of Timor-Leste | Lower middle income | East Asia & Pacific | Timor-Leste | |
TGO | TGO | Republic of Togo | Low income | Sub-Saharan Africa | Togo | |
TON | TON | Kingdom of Tonga | Upper middle income | East Asia & Pacific | Tonga | |
TTO | TTO | Republic of Trinidad and Tobago | High income: nonOECD | Latin America & Caribbean | Trinidad and Tobago | |
TUN | TUN | Republic of Tunisia | Upper middle income | Middle East & North Africa | Tunisia | |
TUR | TUR | Republic of Turkey | Upper middle income | Europe & Central Asia | Turkey | |
TKM | TKM | Turkmenistan | Upper middle income | Europe & Central Asia | Turkmenistan | |
TCA | TCA | Turks and Caicos Islands | High income: nonOECD | Latin America & Caribbean | Turks and Caicos Islands | |
TUV | TUV | Tuvalu | Upper middle income | East Asia & Pacific | Tuvalu | |
UGA | UGA | Republic of Uganda | Low income | Sub-Saharan Africa | Uganda | |
UKR | UKR | Ukraine | Lower middle income | Europe & Central Asia | Ukraine | |
ARE | ARE | United Arab Emirates | High income: nonOECD | Middle East & North Africa | United Arab Emirates | |
GBR | GBR | United Kingdom of Great Britain and Northern Ireland | High income: OECD | Europe & Central Asia | United Kingdom | |
USA | USA | United States of America | High income: OECD | North America | United States | |
URY | URY | Oriental Republic of Uruguay | High income: nonOECD | Latin America & Caribbean | Uruguay | |
UZB | UZB | Republic of Uzbekistan | Lower middle income | Europe & Central Asia | Uzbekistan | |
VUT | VUT | Republic of Vanuatu | Lower middle income | East Asia & Pacific | Vanuatu | |
VEN | VEN | Repœblica Bolivariana de Venezuela | High income: nonOECD | Latin America & Caribbean | Venezuela | |
VNM | VNM | Socialist Republic of Vietnam | Lower middle income | East Asia & Pacific | Vietnam | |
VIR | VIR | Virgin Islands of the United States | High income: nonOECD | Latin America & Caribbean | Virgin Islands | |
WBG | WBG | West Bank and Gaza | Lower middle income | Middle East & North Africa | West Bank and Gaza | |
YEM | YEM | Republic of Yemen | Lower middle income | Middle East & North Africa | Yemen | |
ZMB | ZMB | Republic of Zambia | Lower middle income | Sub-Saharan Africa | Zambia | |
ZWE | ZWE | Republic of Zimbabwe | Low income | Sub-Saharan Africa | Zimbabwe | |
ARB | ARB | Arab World | Middle East & North Africa | Arab World |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment