Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
IPCC governance
value id
613 USA
187 UK
97 Canada
96 Australia
86 Germany
70 Netherlands
67 Japan
63 Switzerland
53 France
43 India
41 China
31 New Zealand
29 Argentina
28 Kenya
26 Russia
24 Italy
24 Sweden
21 Austria
18 Norway
16 South Africa
15 Brazil
15 Finland
14 Venezuela
13 Denmark
12 Belgium
12 Poland
11 Mexico
10 Hungary
9 Peru
7 Cuba
7 Spain
7 Zimbabwe
6 Nepal
5 Saudi Arabia
5 Vietnam
4 Indonesia
4 Nigeria
4 Philippines
4 Thailand
3 Benin
3 Iceland
3 Israel
3 Malaysia
3 Sierra Leone
3 Tanzania
2 Bangladesh
2 Barbados
2 Malawi
2 Maldives
2 Portugal
2 Singapore
2 Sri Lanka
2 Tunisia
2 Turkmenistan
2 Uganda
2 Uruguay
2 Hong Kong
1 Albania
1 Algeria
1 Bahamas
1 Botswana
1 Bulgaria
1 Chile
1 Colombia
1 Fiji
1 Ghana
1 Greece
1 South Korea
1 Latvia
1 Mali
1 Niger
1 Pakistan
1 Samoa
1 Senegal
1 Yugoslavia
value id
581 USA
112 Germany
92 United Arab Emirates
88 Canada
70 Australia
56 Japan
47 China
43 UK
42 France
32 India
30 Sweden
29 Netherlands
23 Romania
20 Kenya
19 Brazil
19 Norway
16 Italy
16 Northern Cyprus
15 Argentina
13 New Zealand
12 Austria
11 Finland
11 Spain
10 Mexico
9 Swaziland
8 Belgium
8 Venezuela
7 Thailand
6 Denmark
6 Somaliland
6 Switzerland
5 Israel
5 Malaysia
5 Peru
4 Bangladesh
4 Nigeria
4 Philippines
4 Poland
4 South Africa
4 Tajikistan
3 Botswana
3 Chile
3 Cuba
3 Indonesia
3 Portugal
3 South Ossetia
3 Zambia
2 Benin
2 Costa Rica
2 Greece
2 Guatemala
2 Guinea
2 Niger
2 Saudi Arabia
2 Sri Lanka
2 Trinidad and Tobago
2 Zimbabwe
1 Albania
1 Barbados
1 Bulgaria
1 Czech Republic
1 El Salvador
1 Gambia
1 Hungary
1 Jamaica
1 Kazakhstan
1 Kiribati
1 Malawi
1 Maldives
1 Malta
1 Mauritius
1 Morocco
1 Nepal
1 Samoa
1 Senegal
1 Seychelles
1 Singapore
1 Slovakia
1 Tanzania
1 Togo
1 Uganda
1 Uruguay
1 Uzbekistan
1 Vietnam
value id
350 USA
137 UK
75 Canada
62 Germany
58 Australia
58 France
54 Japan
44 Netherlands
31 Switzerland
28 China
26 India
24 New Zealand
19 Norway
15 Austria
13 Brazil
13 Mexico
13 South Africa
11 Argentina
11 Belgium
11 Kenya
11 Sweden
10 Russia
9 Denmark
8 Italy
8 Spain
7 Finland
5 Cuba
5 Nigeria
5 Sudan
4 Bangladesh
4 Iran
4 Ireland
4 Senegal
4 Uruguay
3 Botswana
3 Chile
3 Hungary
3 Indonesia
3 Morocco
3 Peru
3 Thailand
3 Venezuela
2 Egypt
2 Greece
2 Poland
2 Romania
2 Saudi Arabia
2 Seychelles
2 Trinidad and Tobago
2 Vietnam
1 Barbados
1 Benin
1 Bolivia
1 Fiji
1 Iceland
1 Jamaica
1 Lithuania
1 Malaysia
1 Malta
1 Mauritius
1 Moldova
1 Monaco
1 Mongolia
1 Mozambique
1 Nepal
1 Niger
1 Philippines
1 Portugal
1 Singapore
1 Slovenia
1 Sri Lanka
1 Tanzania
1 Tunisia
1 Turkey
1 Zambia
1 Zimbabwe
value id
168 USA
54 UK
48 China
46 Germany
36 France
36 Australia
34 India
29 Japan
23 Canada
21 Brazil
18 Mexico
18 Netherlands
17 South Africa
16 Switzerland
14 Russia
14 Spain
14 Norway
13 Italy
12 Argentina
12 New Zealand
8 Sudan
8 Chile
8 Sudan
7 Sweden
7 Morocco
7 Austria
6 Cuba
6 Republic of Korea
5 Bangladesh
5 Zambia
5 Belgium
5 Philippines
5 Senegal
4 Egypt
4 Nigeria
4 Ghana
4 Colombia
4 Hungary
4 Finland
4 Malaysia
3 Botswana
3 Trinidad and Tobago
3 Denmark
3 Portugal
3 Tanzania
2 Romania
2 Peru
2 Costa Rica
2 Zimbabwe
2 Ukraine
2 Greece
2 Iran
2 Poland
1 Maldives
1 Sri Lanka
1 Indonesia
1 Malta
1 Guatemala
1 Tunisia
1 Moldova
1 Gambia
1 Nepal
1 Jamaica
1 Tonga
1 Venezuela
1 Thailand
1 Niger
1 Pakistan
1 Estonia
1 Slovenia
1 Algeria
1 Uganda
1 Ethiopia
1 Montenegro
1 Bulgaria
1 Cameroon
1 Barbados
1 Iceland
1 Kenya
1 Belarus
value id
72 USA
45 UK
45 Germany
37 Australia
37 China
31 India
31 Japan
24 France
21 Canada
21 Brazil
17 Spain
16 Netherlands
14 Norway
14 Mexico
14 New Zealand
14 South Africa
13 Italy
12 Russia
11 Republic of Korea
11 Argentina
10 Switzerland
8 Indonesia
8 Chile
7 Nigeria
7 Morocco
6 Malaysia
6 Sudan
6 Austria
6 Jamaica
6 Senegal
6 Cuba
6 Algeria
6 Tanzania
5 Ghana
5 Pakistan
5 Sweden
5 Ethiopia
5 Denmark
5 Philippines
5 Belgium
4 Thailand
4 Zambia
4 Iran
3 Egypt
3 Maldives
3 Egypt
3 Saudi Arabia
3 Bangladesh
3 Colombia
3 Uruguay
3 Venezuela
3 Ukraine
3 Uganda
3 Greece
3 Poland
3 Finland
3 Peru
2 Nepal
2 Trinidad and Tobago
2 Dominican Republic
2 Ecuador
2 Singapore
2 Portugal
2 Ireland
2 Czech Republic
2 Turkey
2 Kenya
2 Hungary
1 Iceland
1 Madagascar
1 Romania
1 Cook Islands
1 Guatemala
1 Mauritania
1 Gambia
1 Botswana
1 Zimbabwe
1 Tonga
1 Eritrea
1 Palau
1 Costa Rica
1 Uzbekistan
1 Mozambique
1 Cameroon
1 Sri Lanka
1 Israel
1 Serbia
1 Bahamas
1 Benin
1 Solomon Islands
1 Latvia
<!DOCTYPE html>
<html lang="en">
<head>
<title>Data Meltdown | IPCC</title>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<header>
<div id="info">
<h2> IPCC CONTRIBUTORS </h2>
<span id="ar2" class="button">AR2</span>
<span id="ar3" class="button">AR3</span>
<span id="ar4" class="button">AR4</span>
<span id="ar5" class="button">AR5</span>
<span id="ar6" class="button">AR6</span>
<br>
<h2 id = "h1_date"> Assessment Report 2 1995 </h2>
</div>
</header>
<style>
canvas{width:100%;height:100%}
/* header{
position:relative;
bottom:10px;
width:100%;
text-align:center;
z-index:100;
display:block;
}*/
body{
font-family:Monospace;
background-color:#fff;
color:#000;
margin:0px;
overflow:hidden;
}
#info{
position:relative;
top:10px;
width:100%;
text-align:center;
z-index:100;
display:block;
}
#info a, .button{font-size: 20px;}
#footer{
position:relative;
bottom:10px;
width:100%;
text-align:center;
z-index:100;
display:block;
}
#
</style>
<body>
<div id="viz" style="text-align:center;">
<svg width="850" height="850" font-family="sans-serif" font-size="10" text-anchor="middle" ></svg>
</div>
<script>
var continents = {
"Australia": "Oceania",
"New Zealand": "Oceania",
"Tonga": "Oceania",
"Fiji": "Oceania",
"Samoa": "Oceania",
"Kiribati": "Oceania",
"Palau": "Oceania",
"Cook Islands": "Oceania",
"Solomon Islands": "Oceania",
"South Africa": "Africa",
"Seychelles": "Africa",
"Sudan": "Africa",
"Morocco": "Africa",
"Zambia": "Africa",
"Senegal": "Africa",
"Egypt": "Africa",
"Nigeria": "Africa",
"Ghana": "Africa",
"Botswana": "Africa",
"Tanzania": "Africa",
"Zimbabwe": "Africa",
"Tunisia": "Africa",
"Gambia": "Africa",
"Niger": "Africa",
"Algeria": "Africa",
"Benin" : "Africa",
"Uganda": "Africa",
"Ethiopia": "Africa",
"Guinea": "Africa",
"Cameroon": "Africa",
"Kenya": "Africa",
"Swaziland": "Africa",
"Malawi" : "Africa",
"Mali" : "Africa",
"Sierra Leone" : "Africa",
"Somaliland" : "Africa",
"Mozambique": "Africa",
"Mauritius": "Africa",
"Mauritania": "Africa",
"Eritrea": "Africa",
"Togo": "Africa",
"Madagascar": "Africa",
"China": "Asia",
"India": "Asia",
"Japan": "Asia",
"South Korea" : "Asia",
"Republic of Korea": "Asia",
"South Ossetia" : "Asia",
"Hong Kong" : "Asia",
"Mongolia" : "Asia",
"Bangladesh": "Asia",
"Philippines": "Asia",
"Malaysia": "Asia",
"Iran": "Asia",
"Maldives": "Asia",
"Turkmenistan" : "Asia",
"Northern Cyprus" : "Asia",
"Sri Lanka": "Asia",
"Indonesia": "Asia",
"Tajikistan": "Asia",
"Nepal": "Asia",
"Thailand": "Asia",
"Pakistan": "Asia",
"United Arab Emirates" : "Asia",
"Saudi Arabia" : "Asia",
"Vietnam" : "Asia",
"Singapore" : "Asia",
"Israel" : "Asia",
"Kazakhstan" : "Asia",
"Uzbekistan" : "Asia",
"Turkey": "Asia",
"Argentina": "America",
"USA": "America",
"Canada": "America",
"Ecuador": "America",
"Bahamas": "America",
"Brazil": "America",
"Mexico": "America",
"Chile": "America",
"Cuba": "America",
"Bolivia": "America",
"Colombia": "America",
"Trinidad and Tobago": "America",
"Peru": "America",
"Costa Rica": "America",
"Guatemala": "America",
"Jamaica": "America",
"Dominican Republic": "America",
"El Salvador": "America",
"Venezuela": "America",
"Barbados": "America",
"Uruguay": "America",
"Germany": "Europe",
"Albania": "Europe",
"France": "Europe",
"UK": "Europe",
"Netherlands": "Europe",
"Switzerland": "Europe",
"Czech Republic" : "Europe",
"Russia": "Europe",
"Spain": "Europe",
"Norway": "Europe",
"Malta": "Europe",
"Italy": "Europe",
"Sweden": "Europe",
"Austria": "Europe",
"Belgium": "Europe",
"Hungary": "Europe",
"Finland": "Europe",
"Denmark": "Europe",
"Portugal": "Europe",
"Ukraine": "Europe",
"Greece": "Europe",
"Romania": "Europe",
"Poland": "Europe",
"Moldova": "Europe",
"Estonia": "Europe",
"Slovenia": "Europe",
"Montenegro": "Europe",
"Bulgaria": "Europe",
"Iceland": "Europe",
"Belarus": "Europe",
"Slovakia": "Europe",
"Ireland": "Europe",
"Monaco": "Europe",
"Lithuania": "Europe",
"Serbia": "Europe",
"Latvia": "Europe",
"Yugoslavia" : "Europe",
}
function color_from_continents(t){
if (continents[t] == "Europe"){
return "rgb(157, 232, 160)"
}
else if (continents[t] == "Africa"){
return "rgb(161, 232, 255)"
}
else if (continents[t] == "Asia"){
return "rgb(255, 105, 109)"
}
else if (continents[t] == "Oceania"){
return "rgb(255, 247, 117)"
}
else if (continents[t] == "America"){
return "rgb(255, 191, 91)"
}
else{
return "purple"
}
}
/// Function to display date
function date(){
if (csv == 'ar2_countries.csv'){
document.getElementById("h1_date").innerHTML = "Assessment Report 2 1995";
}
if (csv == 'ar3_countries.csv'){
document.getElementById("h1_date").innerHTML = "Assessment Report 3 2001";
}
if (csv == 'ar4_countries.csv'){
document.getElementById("h1_date").innerHTML = "Assessment Report 4 2007";
}
if (csv == 'ar5_countries.csv'){
document.getElementById("h1_date").innerHTML = "Assessment Report 5 2014";
}
if (csv == 'ar6_countries.csv'){
document.getElementById("h1_date").innerHTML = "Assessment Report 6 2021";
}
}
var svg = d3.select("svg"),
width = +svg.attr("width"),
height = +svg.attr("height");
var format = d3.format(",d");
var color = d3.scaleOrdinal(d3.schemeCategory20c);
var pack = d3.pack()
.size([width, height])
.padding(1.5);
var csv = "ar2_countries.csv"
function display(){
d3.select('svg').selectAll("*").remove()
date()
d3.csv(csv,
function(d) {
d.value = +d.value;
if (d.value) return d;
},
function(error, data) {
if (error) throw error;
console.log(data.map(data => data.id))
var root = d3.hierarchy({children: data})
.sum(function(d) { return d.value; })
.each(function(d) {
if (id = d.data.id) {
var id, i = id.lastIndexOf(".");
d.id = id;
d.package = id.slice(0, i);
d.class = id.slice(i + 1);
}
});
var node = svg.selectAll(".node")
.data(pack(root).leaves())
.enter()
.append("g")
.attr("class", "node")
.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; });
node.append("circle")
.attr("id", function(d) { return d.id; })
.attr("r", function(d) { return d.r; })
.style("fill", function(d) { return d3.color(color_from_continents(d.id)); });
node.append("clipPath")
.attr("id", function(d) { return "clip-" + d.id; })
.append("use")
.attr("xlink:href", function(d) { return "#" + d.id; });
node.append("text")
.append("tspan")
.text(function(d) {
return d.id; })
.attr("x", function(d){ return 0; })
.attr("y", function(d){ return d.value > 1 ? - d.r/4 : - d.r/2; })
.attr("text-anchor", "middle")
.style("font-size", function(d) { return d.value > 6 ? ((2 * d.r - 10) /5 + "px") : '12px'; })
.append("tspan")
.text(function(d){
return format(d.value) ;
})
.attr("x", function(d){ return 0; })
.attr("y", function(d){ return d.value > 1 ? d.r/4 : d.r/2; })
.attr("text-anchor", "middle")
.style("font-size", function(d) { return d.value > 6 ? ((2 * d.r - 10) / 5 + "px") : '12px'; });
node.append("title")
.text(function(d) { return d.id + "\n" + format(d.value); })
});
}
display()
document.getElementById("ar2").addEventListener('click',function(){
csv = "ar2_countries.csv"
display();
},false)
document.getElementById("ar3").addEventListener('click',function(){
csv = "ar3_countries.csv"
display();
},false)
document.getElementById("ar4").addEventListener('click',function(){
csv = "ar4_countries.csv"
display();
},false)
document.getElementById("ar5").addEventListener('click',function(){
csv = "ar5_countries.csv"
display();
},false)
document.getElementById("ar6").addEventListener('click',function(){
csv = "ar6_countries.csv"
display();
},false)
</script>
</body>
<footer>
<h5> Data Source : <a href = "http://ipcc.ch/publications_and_data/publications_and_data_reports.shtml">IPCC Assessment Reports</a> </h5>
</footer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.