Skip to content

Instantly share code, notes, and snippets.

@Saminu
Last active April 3, 2017 11:20
Show Gist options
  • Save Saminu/53734179b85410c5fd3f311662684705 to your computer and use it in GitHub Desktop.
Save Saminu/53734179b85410c5fd3f311662684705 to your computer and use it in GitHub Desktop.
Nigeria States Info Section
license: mit

Visual Analytics

Homework #4

Meili Vanegas

Juan Sebastian Martinez

The visualization presented here is an alternative to the AADV 3D visualization presented in http://adatavisualization.net/index.php?page=performance, which displays all the determinant metrics used to calculate the Environmental Performance Index (EPI) for all countries.

AADV's Visualization Analysis

The 3D visualization uses areas as marks and both position and size as channels to communicate the different factors used to calculate the EPI score. The main problem with this visualization is that the 3D surfaces overlap, making it difficult to compare scores between different metrics.

In the visualization, factors represent categorical data, and the score for each factor represents numerical data. We can say that the task that the visualization wants to aid is to present the scores of all factors for a given country. With this in mind, the 3D polygonal representation used violates the principle of effectiveness, as it uses areas and depth for the numerical scores presented, which happens to be a low-effective channel for this type of data and makes it difficult to present the scores and to accomplish the final task.

On the other hand, the polygonal 3D representation resembles the data distribution in a pie chart, which tries to show the weight of every factor as the area occupied in the polygon. This gives a good perception of expressiveness, although other representation could be better (thickness of bars in a bar chart for example), as we know that angles are not very effective to communicate information to the human eyes.

forked from mvanegas10's block: Nigeria

Rank Country EPI Score 10-Year Percent Change Environmental Health Ecosystem Vitality EH - Health Impacts EH - Air Quality EH -Water and Sanitation EV - Water Resources EV - Agriculture EV - Forests EV - Fisheries EV- Biodiversity and Habitat EV - Climate and Energy Child Mortality Household Air Quality Air Pollution - Average Exposure to PM2.5 Air Pollution - Average PM2.5 Exceedance Access to Sanitation Access to Drinking Water Wastewater Treatment Agricultural Subsidies Pesticide Regulation Change in Forest Cover Fish Stocks Coastal Shelf Fishing Pressure Terrestrial Protected Areas (National Biome Weights) Terrestrial Protected Areas (Global Biome Weights) Marine Protected Areas Critical Habitat Protection Trend in Carbon Intensity Change of Trend in Carbon Intensity Trend in CO2 Emissions per KwH Access to Electricity
1 Switzerland 87.67 0.8 92.19 84.67 100 76.56 100 96.95 49.24 49.65 NA 100 78.14 100 95 78.21 56.47 100 100 96.95 6.48 92 49.65 NA NA 100 100 NA NA 67.91 38.47 98.63 100
2 Luxembourg 83.29 3.02 92.26 77.31 94.79 81.98 100 95 65.33 33.76 NA 100 56.75 94.79 95 85.84 65.11 100 100 95 38.67 92 33.76 NA NA 100 100 NA NA 65.21 54.4 39.86 100
3 Australia 82.4 2.32 99.44 71.03 100 98.33 100 92.33 66.46 100 19.37 83.08 47.67 100 95 100 100 100 100 92.33 56.91 76 100 24.1 14.65 72.06 70.97 99.29 90 44.55 31.12 53.98 100
4 Singapore 81.78 0.94 99.44 70.01 100 98.33 100 99.65 96 NA 0 46.33 86.85 100 95 100 100 100 100 99.65 NA 96 NA 0 0 28.47 28.47 82.04 NA 90 0 81.37 73
5 Czech Rep. 81.47 3.47 90.63 75.35 100 73.99 97.91 75.68 67.07 45.05 NA 98.35 65.82 100 100 74.48 47.48 99.87 95.95 75.68 38.14 96 45.05 NA NA 98.35 98.41 NA NA 77.62 30.98 54.43 100
6 Germany 80.47 1.89 92.83 72.23 100 78.5 100 95.18 65.31 31.35 13.4 100 62.77 100 95 82.24 58.27 100 100 95.18 38.62 92 31.35 8.33 18.46 100 100 100 NA 65.24 27.82 58.26 100
7 Spain 79.79 1.82 97.63 67.89 96.17 97.37 99.33 92.83 65.19 45.05 23.24 56.56 81.84 96.17 95 100 97.12 99.76 98.91 92.83 38.38 92 45.05 21.69 24.8 50.34 46.11 73.21 NA 77.96 69.8 89.97 100
8 Austria 78.32 1.82 92.15 69.11 100 76.45 100 79.05 65.49 19.87 NA 86.59 62.09 100 95 78.96 55.4 100 100 79.05 38.98 92 19.87 NA NA 86.59 93.99 NA NA 54.7 51.19 76.91 100
9 Sweden 78.09 1.3 99.04 64.12 100 97.13 100 87.86 65.18 14.35 25.3 62.38 77.34 100 95 100 96.4 100 100 87.86 38.35 92 14.35 11.76 38.83 47.29 50.31 89.54 NA 77.67 29.51 76.93 100
10 Norway 78.04 2.79 99.44 63.77 100 98.33 100 77.05 46.6 32.52 20.88 71.68 75.65 100 95 100 100 100 100 77.05 1.19 92 32.52 14.86 26.9 76.31 78.34 60.41 NA 65.82 15.48 95.33 100
11 Netherlands 77.75 4.62 91.86 68.35 100 75.57 100 98.82 65.36 33.76 0 94.69 53.32 100 95 78.48 53.24 100 100 98.82 34.73 96 33.76 0 0 100 100 84.08 NA 51.32 23.74 57.54 100
12 United Kingdom 77.35 3.48 98.61 63.18 100 95.82 100 97.93 66.03 43.06 0 70.11 54.24 100 95 100 92.45 100 100 97.93 36.07 96 43.06 0 0 100 100 80.43 0 57.37 24.81 48.64 100
13 Denmark 76.92 4.3 97.61 63.12 100 92.82 100 93.45 66.06 18.52 8.66 67.74 67.22 100 95 100 83.45 100 100 93.45 40.11 92 18.52 10.31 7.02 74.74 74.74 53.74 NA 68.22 45.65 65.31 100
14 Greenland 76.5 2.99 98.77 61.65 97.97 98.33 100 51.94 50.62 NA 16.71 81.9 71.31 97.97 95 100 100 100 100 51.94 5.24 96 NA 9.6 23.81 85.77 91.53 68.38 NA 57.21 42.29 99.77 100
15 Slovenia 76.43 15.16 91.37 66.47 100 78.13 95.96 53.99 63.43 45.05 NA 100 54.59 100 96 80.49 57.91 100 91.92 53.99 34.86 92 45.05 NA NA 100 100 NA NA 54.68 21.68 58.47 100
16 New Zealand 76.41 2.58 87.92 68.74 94.16 98.33 71.28 77.9 79.49 100 5.42 76.05 62.94 94.16 95 100 100 42.55 100 77.9 62.98 96 100 10.84 0 83.93 84.27 100 36 63.47 35.01 63.15 100
17 Portugal 75.8 7.23 98.24 60.84 100 97.97 96.75 70.33 64.3 7.75 30.07 64.36 80.68 100 95 100 98.92 100 93.5 70.33 36.6 92 7.75 18.53 41.61 50.3 48.82 58.33 100 78.41 50.93 90 100
18 Finland 75.72 0.45 99.44 59.9 100 98.33 100 84.25 66.99 11.77 32.89 61.86 62.24 100 95 100 100 100 100 84.25 37.98 96 11.77 2.78 63.01 50.21 50.49 84.88 NA 62.1 37.12 62.75 100
19 Ireland 74.67 1.7 96.27 60.27 100 98.33 90.47 87.47 66.39 100 16.49 18.74 75.01 100 95 100 100 84.22 96.71 87.47 36.77 96 100 7.05 25.94 10.36 10.36 35.49 NA 70.69 6.08 84.84 100
20 Estonia 74.66 15.91 89.12 65.02 93.47 96.21 77.67 75.27 67.12 9.02 27.66 100 56.71 93.47 89 100 99.64 74.74 80.6 75.27 38.24 96 9.02 0 55.32 100 100 100 NA 79.79 0 42.15 100
21 Slovakia 74.45 2.66 87.89 65.48 93.13 73.12 97.43 57.64 63.85 21.31 NA 84.33 72.48 93.13 100 74.39 44.96 94.86 100 57.64 39.71 88 21.31 NA NA 84.33 91.11 NA NA 90 39.14 53.21 100
22 Italy 74.36 2.72 81.46 69.63 100 80.85 63.51 91.44 58.87 55.41 24.93 79.77 63.41 100 95 82.1 65.47 27.03 100 91.44 37.75 80 55.41 12.47 37.4 62.69 63.18 93.19 100 53.69 62.07 82.59 100
23 Greece 73.28 6.2 91.21 61.32 100 85.88 87.76 87.33 61.01 22.83 25.86 66.49 59.79 100 95 91.05 71.58 80.71 94.81 87.33 38.01 84 22.83 21.49 30.23 95.73 96.11 74.1 0 60.38 33.91 61.66 100
24 Canada 73.14 2.58 97.92 56.61 100 97.85 95.9 80.42 62.52 16.64 21.54 58.4 59.85 100 95 100 98.56 96.04 95.76 80.42 29.04 96 16.64 14.22 28.87 49.33 58.01 76.28 50 53.78 29.2 72.18 100
25 United Arab Emirates 72.91 -0.95 88.33 62.64 96.09 86.47 82.41 67.06 92 NA 24.25 96.47 33.86 96.09 100 90.35 69.06 72.13 92.7 67.06 NA 92 NA 9.25 39.24 94.8 94.61 100 NA 16.44 0 69.12 94
26 Japan 72.35 2.17 94.66 57.48 99.2 84.79 100 71.26 46.48 55.41 25.34 73.53 43.54 99.2 95 90.3 69.06 100 100 71.26 0.96 92 55.41 25.32 25.37 87.8 90.78 72.56 43 43.59 34.45 43.51 100
27 France 71.05 3.29 96.48 54.09 100 89.44 100 83.8 65.55 37.94 0 54.45 49.83 100 95 95.97 77.34 100 100 83.8 39.09 92 37.94 0 0 80.81 86.62 50.38 0 55.72 43.07 38.23 100
28 Hungary 70.28 4.1 88.98 57.81 96.71 70.24 99.99 58.62 65.34 100 NA 29.57 66.87 96.71 95 72.21 43.53 99.99 100 58.62 38.68 92 100 NA NA 29.57 29.57 NA NA 75.68 44.03 73.08 100
29 Chile 69.93 7.44 89.42 56.94 91.71 96.8 79.74 68.85 67.39 100 23.35 60.16 35.92 91.71 94 100 96.4 81.52 77.95 68.85 42.78 92 100 21.19 25.52 60.64 47.39 92.62 40 53.08 32.93 12.23 100
30 Poland 69.53 2.67 76.25 65.05 98.71 70.74 59.31 60.73 64.98 58.94 26.52 91.76 60.53 98.71 95 71.89 45.32 44.95 73.66 60.73 33.95 96 58.94 16.67 36.38 100 100 75.28 NA 77.14 46.79 48.99 100
31 Serbia 69.13 2.99 76.71 64.08 84.77 67.17 78.19 8.79 96 100 NA 99.78 62.92 84.77 68 79.18 54.32 70.24 86.13 8.79 100 92 100 NA NA 99.78 99.12 NA NA 76.57 55.3 75.2 100
32 Belarus 67.69 4.17 81 58.82 88.14 81.21 73.66 86.45 68 68.23 NA 41.25 43.15 88.14 100 83.56 60.07 53.4 93.92 86.45 100 36 68.23 NA NA 41.25 41.25 NA NA 90 36.27 41.89 100
33 United States of America 67.52 2.23 92.74 50.71 95.33 96.41 86.48 63.66 61.53 14.35 3.34 63.35 56.45 95.33 95 100 94.24 92.27 80.68 63.66 43.05 80 14.35 1.39 5.28 49.58 59.81 100 44 54.67 29.84 60.18 100
34 Malta 67.42 2.7 94.7 49.23 85.76 98.33 100 37.01 19.66 NA 0 80.96 55.32 85.76 95 100 100 100 100 37.01 35.31 4 NA 0 0 100 100 42.88 NA 52.53 60.01 59.41 100
35 Saudi Arabia 66.66 4.09 87.54 52.73 94.68 84.45 83.48 28.54 92 NA 6.43 93.7 46.63 94.68 95 89.3 69.06 100 66.97 28.54 NA 92 NA 12.87 0 100 100 81.1 NA 45.83 44.12 48.49 94
36 Belgium 66.61 3.22 89.82 51.14 99.65 69.79 100 60 65.33 23.64 0 57.56 64.47 99.65 95 72.29 42.09 100 100 60 38.67 92 23.64 0 0 86.34 86.34 0 NA 61.8 35.28 70.09 100
37 Brunei Darussalam 66.49 -0.84 89.51 51.14 100 94.62 73.93 37.84 68 36.46 42.06 100 21.73 100 95 100 88.85 47.85 100 37.84 NA 68 36.46 11.5 72.62 100 100 NA NA 0 16 64.57 73
38 Cyprus 66.23 2.18 95.23 46.9 100 85.68 100 9.44 61.34 35.07 32.32 77.03 61.92 100 95 93.69 68.35 100 100 9.44 34.68 88 35.07 20.85 43.79 100 100 31.08 NA 64.92 46.81 57.34 100
39 Israel 65.78 0.7 92.57 47.93 98.13 79.57 100 88.4 14.66 NA 0 39.34 41.86 98.13 95 82.56 61.15 100 100 88.4 25.32 4 NA 0 0 71.89 40.47 45.01 0 31.85 38.6 61.48 100
40 Latvia 64.05 5.69 80.52 53.07 91.58 96.29 53.69 49.62 64.57 3.3 0 95.17 53.27 91.58 95 100 93.88 30.33 77.05 49.62 37.15 92 3.3 0 0 100 100 85.5 NA 66.42 0 62.58 100
41 Bulgaria 64.01 3.59 86.57 48.97 87.46 77.23 95.02 28.86 81.62 84.12 0 68.85 48.18 87.46 93 81.13 57.55 100 90.05 28.86 71.24 92 84.12 0 0 100 100 6.55 NA 90 45.22 39.47 100
42 Kuwait 63.94 22.96 77.98 54.59 80.72 61.54 91.69 43 92 NA 0 92.88 42.23 80.72 95 60.47 29.14 100 83.38 43 NA 92 NA 0 0 100 100 78.63 NA 40.39 0 46.4 94
43 South Korea 63.79 7.37 81.7 51.86 96.93 62.24 85.92 83.68 46.98 33.76 22.24 50.4 41.55 96.93 100 57.23 29.5 100 71.85 83.68 1.97 92 33.76 23.94 20.54 36.3 36.3 78.58 NA 43.55 11.91 41.53 93
44 Qatar 63.03 -1.33 89.11 45.64 90.52 76.81 100 67.32 88 NA 0 8.47 70.93 90.52 100 76.83 53.6 100 100 67.32 NA 88 NA 0 0 12.7 12.7 0 NA 61.38 79.08 90 94
45 Croatia 62.23 6.34 83.39 48.13 95.79 76.67 77.71 13.23 60.99 63.12 19.3 70.87 63.26 95.79 92 81.17 56.83 76.96 78.47 13.23 25.98 96 63.12 14.72 23.89 71.94 55.18 85.5 NA 72.63 42.91 63.39 100
46 Taiwan 62.18 4.33 90.44 43.33 94.95 76.38 100 4.59 44.96 49.65 27.04 71.39 57.69 94.95 100 76.61 52.52 100 100 4.59 17.93 72 49.65 19.48 34.6 67.65 67.65 78.86 NA 64.79 46.67 48.45 100
47 Tonga 61.68 0.37 75.43 52.51 72.58 85.67 68.03 27.06 56 NA 41.85 92.16 41.88 72.58 57 100 100 49.6 86.46 27.06 100 12 NA 4.76 78.94 97.2 97.2 82.09 NA 7.52 43.04 NA 92
48 Armenia 61.67 8.02 74.61 53.05 80.93 76.6 66.3 22.59 92 74.82 NA 80.16 39.91 80.93 81 84.42 64.39 47.06 85.54 22.59 100 84 74.82 NA NA 73.14 73.94 NA 100 72.39 13.68 89.95 100
49 Lithuania 61.26 9.06 73.87 52.86 92.69 85.09 43.81 45.82 66.61 23.64 0 91.83 51.02 92.69 93 89.98 72.3 40.39 47.22 45.82 37.22 96 23.64 0 0 87.75 87.75 100 NA 70.02 17.71 42.59 100
50 Egypt 61.11 9.67 69.47 55.54 66.83 67.99 73.59 49.5 73.01 NA 23.78 65.26 61.05 66.83 100 65.12 38.85 59.69 87.49 49.5 58.02 88 NA 5.23 42.34 65.81 37.96 92.01 NA 25.37 74.42 35.25 100
51 Malaysia 59.31 2.51 87.71 40.37 95.38 90.54 77.21 8.64 57.68 1.68 17.6 93.37 40.24 95.38 100 96.09 75.54 62.49 91.94 8.64 35.35 80 1.68 21.5 13.7 100 100 73.49 100 37.59 49.44 31.68 99
52 Tunisia 58.99 6.87 81.19 44.19 89.95 99.04 54.57 27.77 88 100 14.85 31.08 54.38 89.95 100 100 97.12 45.86 63.29 27.77 100 76 100 2.94 26.76 7.4 18.81 67.02 NA 66.86 47.71 66.57 100
53 Ecuador 58.54 7.51 73.44 48.62 72.1 98.13 50.07 6.4 96 28.15 37.17 88.09 54.66 72.1 98 100 96.4 53.28 46.86 6.4 100 92 28.15 28.07 46.27 91.85 76.5 100 84 48.8 51.28 61.75 97
54 Costa Rica 58.53 2.67 82.62 42.47 90.39 97.88 59.57 0.9 90 19.87 37.51 89.55 38.46 90.39 94 100 99.64 55.5 63.65 0.9 100 80 19.87 27.08 47.93 94.44 89.28 74.46 100 46.55 34.42 38.81 99
55 Jamaica 58.26 2.37 70.03 50.41 72.5 96.33 41.26 10 96 18.52 0 88.04 76.98 72.5 89 100 100 32.02 50.5 10 100 92 18.52 0 0 81.34 95.67 75.13 100 16.38 90 60.32 92
56 Mauritius 58.09 3.9 86.55 39.11 88.37 100 71.27 5.44 92 100 47.5 43.7 29.91 88.37 100 100 100 47.63 94.9 5.44 NA 92 100 0.64 94.36 28.32 28.32 18.17 100 24.23 32.39 NA 100
57 Venezuela 57.8 1.12 72.83 47.79 70.44 99.04 49.01 14.94 94 33.76 18.5 92.92 43.59 70.44 100 100 97.12 48.15 49.87 14.94 100 88 33.76 8.24 28.76 100 100 85.66 86 47.13 19.22 57.04 100
58 Panama 56.84 3.53 68.6 48.99 72.7 94 39.11 20.15 96 14.35 27.75 86.96 52.82 72.7 82 100 100 24 54.22 20.15 NA 96 14.35 19.49 36.01 92.44 76.52 78.87 100 71.48 32.83 60.36 88
59 Kiribati 55.82 10.6 51.45 58.73 58.45 84.67 11.24 27.06 56 NA 36.08 100 NA 58.45 54 100 100 7.65 14.83 27.06 100 12 NA 5.3 66.87 100 100 100 NA NA NA NA 56
60 Jordan 55.78 -0.07 76.96 41.66 79.31 82.51 69.06 42.3 84 NA NA 8.52 65.68 79.31 100 85.3 62.23 75.94 62.17 42.3 NA 84 NA NA NA 8.52 7.5 NA NA 69.19 65.47 65.75 99
61 Seychelles 55.56 2.15 83.36 37.02 83.98 100 66.09 3.96 48 NA 51.16 72.42 26.83 83.98 100 100 100 69.52 62.67 3.96 NA 48 NA 5.56 96.77 75.01 72.4 42.26 100 22.14 33.06 NA 29
62 Montenegro 55.52 1.41 78.31 40.33 98.68 76.19 60.08 5.1 86 100 0 51.6 47.4 98.68 72 88.21 68.35 46.34 73.81 5.1 100 72 100 0 0 77.82 77 0 NA 45.27 51.33 41.59 100
63 Azerbaijan 55.47 7.98 59.37 52.87 60.57 86.87 30.66 13.15 62 63.12 NA 58.66 80.88 60.57 93 93.52 74.1 34.08 27.24 13.15 100 24 63.12 NA NA 58.66 68.89 NA NA 90 78.28 83.55 100
64 Cuba 55.07 4.48 80.64 38.02 93.18 97 51.75 9.19 84 100 32.72 56.06 16.93 93.18 91 100 100 50.99 52.52 9.19 NA 84 100 16.17 49.27 37.17 54.24 82.84 50 0 14.87 23.47 100
65 Mexico 55.03 7.94 69.98 45.06 76.67 87.09 46.2 37.45 55.21 19.87 25.34 62.32 51.35 76.67 86 98.65 76.62 37.49 54.9 37.45 30.41 80 19.87 17.4 33.28 62.93 66.46 82.89 37 60.05 27.12 73.66 99
66 Turkey 54.91 9.03 73.85 42.28 66.06 84.07 71.43 48.93 56.67 52.35 21.9 32.62 46.52 66.06 97 87.95 67.27 48.42 94.44 48.93 17.34 96 52.35 20.78 23.02 13.7 14.34 77.46 25 55.37 40.62 43.4 100
67 Albania 54.73 11.79 72.63 42.8 93.75 68.24 55.91 3.36 60 17.25 0 63.19 85.74 93.75 61 82.56 61.15 56.12 55.69 3.36 100 20 17.25 0 0 58.79 57.06 73.71 NA 86.45 78.69 99.4 100
68 Syria 54.5 1.7 67.09 46.11 78.81 71.08 51.38 82.17 92 3.3 0 23.44 59.1 78.81 100 71.14 42.09 60.45 42.31 82.17 100 84 3.3 0 0 3.76 3.28 63.28 NA 35.2 69.32 39.05 93
69 Sri Lanka 53.88 9.94 67.49 44.8 82.82 70.8 48.85 0 92 33.76 62.43 67.7 54.62 82.82 25 100 87.41 48.72 48.99 0 100 84 33.76 50 74.87 85.21 97.14 53.45 35 76.3 49.27 64.84 85
70 Uruguay 53.61 15.61 89.97 29.37 80.39 100 89.51 6.67 68.06 100 20.19 24.62 24.51 80.39 100 100 100 83.18 95.84 6.67 52.12 84 100 19.6 20.79 2.67 2.68 68.49 NA 18.47 60.86 10.73 99
71 Suriname 53.57 1.13 67.15 44.52 64.28 96 41.16 0.01 90 63.12 17.55 75.04 52.76 64.28 88 100 100 35.23 47.08 0.01 100 80 63.12 1.64 33.45 57.55 83.9 83.67 NA 82.78 40.15 NA 100
72 South Africa 53.51 6.04 59.33 49.64 47.51 94.4 36.08 27.86 79.2 100 2.52 63.96 49.87 47.51 85 100 98.2 26.15 46.01 27.86 70.41 88 100 5.04 0 38.22 42.62 100 75 52.04 56.54 38.54 83
73 Russia 53.45 4.21 74.22 39.6 83.12 94.36 45.17 21.5 16.93 35.07 12.73 53.39 61.02 83.12 100 100 83.09 23.4 66.93 21.5 21.87 12 35.07 17.32 8.14 61.08 64.28 88.21 0 90 26.94 47.77 100
74 Moldova 53.36 6.04 66.88 44.34 76.03 73.63 50.99 34.15 74 100 NA 7.51 63.16 76.03 89 79.01 52.88 39.43 62.56 34.15 100 48 100 NA NA 7.51 7.14 NA NA 81.55 49.64 90 99
75 Dominican Republic 53.24 0.47 69.12 42.65 78.15 97.55 31.68 5.9 52.69 5.79 37.15 92.94 44.06 78.15 93 100 99.64 34.44 28.92 5.9 9.38 96 5.79 20.67 53.62 75.78 97.03 98.96 100 90 39.28 45.65 98
76 Fiji 53.08 6.61 70.72 41.33 72.54 87.67 51.94 3.9 94 58.94 38.36 37.98 65.71 72.54 63 100 100 41.08 62.81 3.9 100 88 58.94 9.09 67.62 16.45 18.27 77.21 40 21.24 67.16 NA 56
77 Brazil 52.97 3.72 72.22 40.13 68.59 97.64 50.44 10.87 74.51 10.81 24.68 66.74 53.82 68.59 94 100 98.92 32.68 68.19 10.87 61.01 88 10.81 20.09 29.28 82.4 73.54 81.04 30 52.02 26.19 79.65 99
78 Thailand 52.83 1.91 71.17 40.61 88.23 67.67 57.62 16 62.13 25.34 19.05 70.19 46.05 88.23 74 76.49 52.52 54.7 60.55 16 32.26 92 25.34 21.88 16.23 76.12 51.63 82.82 NA 42.41 42.91 52.4 100
79 Trinidad and Tobago 52.28 6.52 71.66 39.36 63.01 99.88 52.08 5.25 96 17.88 24.58 83.48 32.54 63.01 100 100 99.64 51.06 53.09 5.25 NA 96 17.88 0 49.16 96.18 92.05 45.68 100 26.96 11.34 51.79 99
80 Palau 51.96 10.84 85.17 29.82 76.45 100 79.06 40 12 NA 50 43.95 1.02 76.45 100 100 100 100 58.12 40 NA 12 NA 0 100 65.92 65.92 0 NA 2.42 0 NA 56
81 Morocco 51.89 6.66 63.35 44.25 64.96 98.85 26.24 39.39 46.35 100 19.37 31.2 49.4 64.96 98 100 98.56 22.92 29.56 39.39 8.71 84 100 21.13 17.61 20.12 12.44 61.05 NA 45.9 44.54 59.1 99
82 Bahrain 51.83 -4.09 83.22 30.9 81.63 74.63 93.4 64.27 12 NA 0 4.99 39.57 81.63 95 76.74 52.16 86.81 100 64.27 NA 12 NA 0 0 7.48 7.48 0 NA 32.21 26.74 56.9 94
83 Iran 51.08 9.03 76.12 34.39 64.34 88.81 75.21 2.77 92 84.12 22.41 37.06 36.73 64.34 100 92.68 73.74 92.23 58.19 2.77 100 84 84.12 16.18 28.64 40.3 34.39 73.54 0 28.76 32.13 46.18 98
84 Kazakhstan 51.07 2.57 75.4 34.85 66.8 95.92 63.48 30.5 37.13 74.82 NA 14.11 43.49 66.8 91 100 96.76 70.62 56.33 30.5 22.26 52 74.82 NA NA 14.11 19.58 NA NA 29.46 39.81 59.37 100
85 Colombia 50.77 4.9 66.01 40.62 63 95.09 39.92 4.6 52.51 26.24 32.46 80.4 43.49 63 86 100 99.28 29.91 49.94 4.6 13.01 92 26.24 9.5 55.42 89.25 77.22 99.14 56 64.68 36.3 48.1 97
86 Romania 50.52 10.91 61.85 42.96 85.36 68.88 31.32 13.05 72.13 45.05 0 63.51 62.82 85.36 83 75.43 48.2 24.66 37.99 13.05 52.27 92 45.05 0 0 40.13 51.12 99.26 NA 90 60.61 51.58 100
87 Bolivia 50.48 4 53.95 48.17 48.63 88.77 24.46 11.3 64 11.77 NA 81.04 63.57 48.63 71 100 95.32 10.37 38.56 11.3 100 28 11.77 NA NA 95.73 91.7 NA 43 0 90 11.28 80
88 Belize 50.46 10.17 79.76 30.93 80.78 96 62.49 2.28 92 4.69 0 98.58 2.59 80.78 88 100 100 46 78.99 2.28 100 84 4.69 0 0 99.93 99.67 96.15 NA 83.28 0 NA 88
89 Macedonia 50.41 5.75 78.26 31.84 100 64.26 70.51 3.74 94 25.34 NA 27.54 54.41 100 67 76.87 48.92 49.19 91.82 3.74 100 88 25.34 NA NA 27.54 46.85 NA NA 90 53.19 53.4 99
90 Nicaragua 50.32 5.14 59.9 43.93 74.66 81.88 23.16 8.4 88 0 28.11 91.67 46.82 74.66 46 100 99.64 12.86 33.46 8.4 100 76 0 21.57 34.66 91.1 91.91 92.01 NA 51.87 37.24 65.96 74
91 Lebanon 50.15 0.34 85.94 26.29 91.77 77.34 88.69 15.08 90 74.82 0 1.71 40.43 91.77 100 78.43 53.6 77.38 100 15.08 100 80 74.82 0 0 2.56 2.56 0 NA 68.34 12.17 56.53 100
92 Algeria 50.08 2.48 70.51 36.45 66.12 99.28 46.13 34.64 94 26.24 23.71 34.86 37.53 66.12 100 100 97.84 60.39 31.87 34.64 100 88 26.24 12.62 34.8 37.12 19.43 48.04 NA 26.2 28.62 55.48 99
93 Argentina 49.55 6.42 86.8 24.72 85.07 99.64 75.7 11.75 96 0 15.68 44.88 16.79 85.07 100 100 98.92 65.27 86.12 11.75 100 92 0 17.74 13.61 29.1 35.9 64.53 50 13.6 22.06 11.47 88
94 Zimbabwe 49.54 4.05 46.42 51.62 43.76 78 17.5 14.03 56 23.64 NA 99.52 NA 43.76 34 100 100 8.02 26.99 14.03 100 12 23.64 NA NA 99.74 98.96 NA 100 NA NA NA 37
95 Ukraine 49.01 5.44 77.71 29.87 83.06 84.76 65.31 14.7 62.03 32.52 25.3 41.46 27.78 83.06 97 88.93 68.35 57.32 73.31 14.7 56.06 68 32.52 8.11 42.48 20.17 22.39 81.82 NA 90 17.52 45.9 100
96 Antigua and Barbuda 48.89 4.51 81.6 27.08 83.79 100 61.01 11.37 84 NA 0 60.92 8.41 83.79 100 100 100 49.41 72.62 11.37 NA 84 NA 0 0 38 60.64 45.05 100 13.11 0 NA 88
97 Honduras 48.87 7.05 57.52 43.11 53.31 82.88 36.38 15.54 92 6.17 27.29 76.81 48.29 53.31 49 100 99.64 32.46 40.29 15.54 100 84 6.17 5.41 49.17 82.16 79.69 65.41 80 43.61 50.93 43.04 81
98 Guatemala 48.06 8.63 60.55 39.74 58.89 80.4 42.37 5.37 94 0 32.6 57.55 64.18 58.89 43 100 98.2 32.06 52.67 5.37 100 88 0 21.43 43.78 80.11 53.82 76.26 20 60 56.98 78.52 82
99 Oman 47.75 8.42 81.08 25.52 88.83 96.89 57.52 13.4 24 NA 24.39 42.28 21.64 88.83 95 100 95.68 66.98 48.06 13.4 NA 24 NA 11.16 37.63 61.74 53.99 53.4 0 0 67.9 49.9 94
100 Botswana 47.6 7.18 62.04 37.98 56.09 87.67 42.36 0.95 20 NA NA 100 16.57 56.09 63 100 100 19.15 65.57 0.95 NA 20 NA NA NA 100 100 NA NA 61.98 11.37 6.12 43
101 Georgia 47.23 4.28 73.12 29.97 79.42 75.53 64.39 0 56 84.12 0 29.59 45.43 79.42 54 95.62 76.98 54.67 74.11 0 100 12 84.12 0 0 44.53 44.24 0 NA 40.32 42.22 51.9 100
102 Dominica 47.08 3.54 72.51 30.12 73.9 99.67 43.98 2.99 56 NA 0 66.29 27.95 73.9 99 100 100 33.04 54.92 2.99 100 12 NA 0 0 80.06 85.12 0 100 44.51 25.36 NA 91
103 Bhutan 46.86 1.63 42.07 50.06 42.35 44.86 38.98 0 50 63.12 NA 94.92 NA 42.35 60 50.48 24.1 9.92 68.04 0 100 0 63.12 NA NA 94.92 96.13 NA NA NA NA NA 72
104 Gabon 46.6 7.35 50.09 44.28 37.41 90.97 21.88 0 12 58.94 28.8 82.94 56.67 37.41 74 100 98.92 5.46 38.3 0 NA 12 58.94 26.4 31.2 86.49 84.84 77.49 NA 90 79.52 1.77 82
105 Bahamas 46.58 2.58 73.83 28.42 71.19 98.33 51.95 11.37 12 21.31 39.68 75.53 0 71.19 95 100 100 42.49 61.41 11.37 NA 12 21.31 13.33 66.04 79.55 81.77 65.26 NA 0 0 NA 88
106 Vanuatu 45.88 4.7 57.12 38.39 69.57 72 29.8 27.06 56 74.82 48.81 27.46 NA 69.57 16 100 100 15.67 43.93 27.06 100 12 74.82 2.99 94.63 24.34 24.34 33.72 NA NA NA NA 24
107 Bosnia and Herz. 45.79 4.4 77.57 24.61 91.03 69.53 72.15 3.18 56 100 NA 2.5 31.71 91.03 55 87.39 66.19 63.05 81.25 3.18 100 12 100 NA NA 2.5 2.5 NA NA 34.14 17.86 57.95 100
108 Barbados 45.5 3.46 87.58 17.45 89.63 100 73.12 11.37 84 NA 50 2.28 12.38 89.63 100 100 100 49.79 96.44 11.37 NA 84 NA 0 100 0.54 0.54 8.03 0 11 14.85 NA 88
109 Turkmenistan 45.07 0.33 66.12 31.04 48.37 98.2 51.78 9.8 50 NA NA 17.86 61.67 48.37 100 100 94.6 85.14 18.42 9.8 100 0 NA NA NA 17.86 21.94 NA NA 79.84 69.25 44.76 100
110 Peru 45.05 11.57 55.85 37.84 54.81 83.68 29.07 20.98 92 32.52 29.77 70.36 16.71 54.81 64 100 87.05 24.24 33.91 20.98 100 84 32.52 23.51 36.03 81.34 70.39 71.7 58 41.91 23.2 0 85
111 Mongolia 44.67 8.26 55.12 37.7 65.75 76 23.61 19.8 88 0 NA 73.25 25.06 65.75 28 100 100 13.3 33.91 19.8 100 76 0 NA NA 69.27 59.41 NA 100 69.66 9.81 54.19 86
112 Indonesia 44.36 4.8 55.72 36.78 67.55 75.31 24.29 0.02 51.85 7.75 25.8 78.08 45.25 67.55 45 100 80.94 16.12 32.45 0.02 19.7 84 7.75 25.98 25.62 82.26 87.1 88.95 54 53.88 42.98 49.45 94
113 Cape Verde 44.07 11.48 65.4 29.85 77.56 89.33 29.29 19.4 92 NA 43.26 7.32 45.04 77.56 68 100 100 18.7 39.88 19.4 100 84 NA 20.45 66.07 14.64 14.64 0 0 40.29 45.15 NA 67
114 Philippines 44.02 3.21 60.61 32.95 62.94 81.53 37.35 0.53 45.38 31.35 23.18 64.67 35.73 62.94 50 100 94.6 26.31 48.38 0.53 18.75 72 31.35 19.81 26.54 63.89 76.24 78.56 40 78.85 30.28 46.15 83
115 El Salvador 43.79 17.75 65.62 29.23 71.88 92.55 32.43 0.62 84 9.9 31.98 24.53 58.24 71.88 78 100 99.64 23.07 41.79 0.62 100 68 9.9 21.05 42.91 5.56 3.98 64.03 NA 50.76 44.52 85.44 92
116 Namibia 43.71 18.74 55.53 35.82 56.53 81.67 28.4 13 56 NA 24.59 94.39 0.54 56.53 45 100 100 5.28 51.53 13 100 12 NA 16.03 33.15 100 100 83.16 NA 9.29 0 0 44
117 Uzbekistan 43.23 6.16 67.68 26.92 55.07 79.37 68.59 0 50 55.41 NA 12.87 51.9 55.07 89 85.45 63.67 100 37.18 0 100 0 55.41 NA NA 12.87 23.24 NA NA 90 51.49 52.61 100
118 China 43 2.6 42.73 43.19 76.23 18.81 33.15 18.18 33.85 25.34 14.68 66.63 65.16 76.23 54 2.44 0 19.78 46.51 18.18 15.71 52 25.34 20.16 9.21 64.33 80.41 67.76 54 39.29 75 51.83 100
119 Central African Rep. 42.94 2.75 31.08 50.85 15.89 66.68 10.66 0 90 43.06 NA 97 NA 15.89 4 100 96.04 5.76 15.56 0 100 80 43.06 NA NA 97 97.02 NA NA NA NA NA 9
120 Libya 42.72 4.17 72 23.2 81.63 97.12 37.24 18.08 12 NA 38.84 0.89 46.61 81.63 100 100 91.37 66.59 7.88 18.08 NA 12 NA 18.18 59.49 0.63 2.03 0 NA 59.07 8.59 60.08 100
121 Zambia 41.72 -0.78 36.18 45.41 26.17 71.25 11.12 4.2 42.83 13.28 NA 100 NA 26.17 17 100 96.76 8.71 13.52 4.2 13.66 72 13.28 NA NA 100 100 NA NA NA NA NA 19
122 Papua New Guinea 41.09 2.04 40.97 41.17 46.1 75.43 1.38 0 56 45.05 49.51 25.68 89.98 46.1 27 100 99.28 1.22 1.53 0 100 12 45.05 20.45 78.57 14.23 12.52 61.97 14 78.61 90 NA 15
123 Equatorial Guinea 41.06 2.5 38.85 42.54 17.28 74.09 25.18 1.25 0 37.94 49.67 91.32 NA 17.28 23 100 99.28 44.18 6.18 1.25 NA 0 37.94 17.07 82.26 100 100 65.29 100 NA NA NA 29
124 Senegal 40.83 4.91 44.84 38.16 35.02 83 16.49 2.06 17.45 NA 20.78 85.36 NA 35.02 49 100 100 12.55 20.43 2.06 22.9 12 NA 20 21.56 99.49 79.36 77.21 NA NA NA NA 57
125 Kyrgyzstan 40.63 2.39 63.46 25.41 56.77 86.51 47.11 4.2 94 68.23 NA 15.77 NA 56.77 66 100 93.53 54.32 39.89 4.2 100 88 68.23 NA NA 20.21 21.83 NA 0 NA NA NA 100
126 Burkina Faso 40.52 7.17 32.17 46.08 13.18 69.33 14.01 0.02 88 NA NA 83.75 NA 13.18 8 100 100 1.04 26.98 0.02 100 76 NA NA NA 83.75 83.75 NA NA NA NA NA 13
127 Laos 40.37 2.96 34.49 44.29 56.74 29.23 17.5 0 80 13.28 NA 93.85 NA 56.74 4 53.47 30.22 17.67 17.34 0 100 60 13.28 NA NA 93.85 96.92 NA NA NA NA NA 66
128 Malawi 40.06 7.72 39.34 40.54 28.05 67.55 22.44 0 88 0 NA 87.81 NA 28.05 3 100 99.64 13.24 31.64 0 100 76 0 NA NA 94.62 72.89 NA 100 NA NA NA 9
129 Côte d'Ivoire 39.72 3.14 39.08 40.15 28.6 73.88 14.77 0.6 80 0 33.68 81.23 49.3 28.6 22 100 99.64 2.69 26.85 0.6 100 60 0 13.72 53.64 100 100 57.94 67 48.32 53.16 41.59 59
130 Congo 39.44 18.33 37.22 40.91 27.54 73.85 10.27 0.18 92 47.23 0 66.29 59.88 27.54 23 100 98.56 0.97 19.58 0.18 NA 92 47.23 0 0 55 55.34 88.53 NA 55.48 90 0.01 37
131 Ethiopia 39.43 7.15 35.21 42.24 35.24 66.85 3.53 0 60 35.07 NA 83.78 NA 35.24 2 100 98.56 1.78 5.29 0 100 20 35.07 NA NA 93.15 82.94 NA 71 NA NA NA 23
132 Timor-Leste 39.41 45.37 44.92 35.74 53.2 69.33 12.22 0.3 50 31.35 59.87 60.43 NA 53.2 8 100 100 7.46 16.98 0.3 100 0 31.35 20.81 98.92 50.89 50.89 79.51 NA NA NA NA 38
133 Paraguay 39.25 7.45 59.03 26.07 63.67 83.67 29.76 0.16 92 0 NA 31.2 44.09 63.67 51 100 100 23.69 35.83 0.16 100 84 0 NA NA 31.2 31.46 NA NA 46.91 16.3 98.84 97
134 Nigeria 39.2 3.73 34.05 42.63 21.29 72.7 8.17 1.08 92 29.16 28.24 57.54 70.55 21.29 26 100 92.09 4.72 11.61 1.08 100 84 29.16 33.33 23.14 75.96 58.22 45.96 50 90 90 31.66 48
135 Uganda 39.18 8.68 37.26 40.46 31.05 66.8 13.93 0.56 58 4.34 NA 91.31 NA 31.05 4 100 96.4 6.17 21.69 0.56 100 16 4.34 NA NA 88.24 88.6 NA 100 NA NA NA 15
136 Viet Nam 38.17 3.19 52.43 28.66 62.83 51.32 43.15 0.14 58.25 17.25 20.11 43.39 44.51 62.83 44 63.92 46.04 26.83 59.47 0.14 28.5 88 17.25 14.45 25.77 36.46 21.17 72.93 43 3.03 46.08 41.43 96
137 Guyana 38.07 11.19 69.19 17.32 64.24 97.55 45.78 0 92 63.12 15.79 18.66 0.64 64.24 93 100 99.64 36.37 55.19 0 100 84 63.12 1.16 30.41 29.98 26 0 NA 42.62 0 NA 78
138 Swaziland 37.35 6.96 43.48 33.27 31.43 81.67 17.34 55.5 58 52.35 NA 17.69 14.04 31.43 45 100 100 15.23 19.45 55.5 100 16 52.35 NA NA 17.69 17.41 NA NA 68.53 13.59 NA 35
139 Nepal 37 4.96 31.67 40.55 56.79 16.23 22 0 92 63.12 NA 61.79 NA 56.79 18 30.69 0 6.31 37.7 0 100 84 63.12 NA NA 61.79 42.63 NA NA NA NA NA 76
140 Kenya 36.99 13.96 38.37 36.07 33.86 73.33 7.92 0.52 92 15.46 37.87 67.96 NA 33.86 20 100 100 4.33 11.51 0.52 100 84 15.46 6.86 68.87 77.58 69.76 74.51 50 NA NA NA 23
141 Cameroon 36.68 6.16 37.63 36.06 22.91 73.8 16.17 0 96 43.06 0 45.67 62.13 22.91 25 100 96.4 11 21.34 0 100 92 43.06 0 0 55.56 65.11 0 62 41.76 63.79 58.84 49
142 Niger 36.28 45.88 27.42 42.19 11.94 67.4 2.93 0 78 NA NA 77.21 NA 11.94 4 100 98.2 0 5.86 0 100 56 NA NA NA 77.21 69.83 NA NA NA NA NA 9
143 Tanzania 36.19 1.15 35.89 36.39 35.69 68.31 3.68 0.42 65.87 14.9 26.2 79.12 NA 35.69 6 100 98.92 0 7.36 0.42 43.74 88 14.9 0 52.41 99.86 99.72 81.91 35 NA NA NA 15
144 Guinea-Bissau 35.98 5.54 30.68 39.52 14.52 67.33 10.19 0 56 13.81 29.9 89.87 NA 14.52 2 100 100 1.32 19.06 0 100 12 13.81 17.61 42.19 89.87 99.36 NA NA NA NA NA 57
145 Cambodia 35.44 7.52 42.73 30.58 52.86 64.82 10.52 0 64 0 0 78.93 NA 52.86 11 100 83.45 5.52 15.52 0 100 28 0 0 0 100 100 36.78 NA NA NA NA 31
146 Rwanda 35.41 9.7 38.7 33.21 35.65 63.26 17.2 0 60 45.05 NA 56.32 NA 35.65 2 100 87.77 17.54 16.86 0 100 20 45.05 NA NA 56.32 59.76 NA NA NA NA NA 11
147 Grenada 35.24 3.13 75.92 8.12 75.84 100 51.93 11.37 50 NA 0 3.74 4.14 75.84 100 100 100 49.81 54.04 11.37 100 0 NA 0 0 11.18 3.77 0 0 22.86 0 NA 88
148 Pakistan 34.58 6.66 38.78 31.79 64.97 23.02 28.34 3.52 74 43.06 14.61 41.43 44.33 64.97 36 33.06 0 10.85 45.84 3.52 100 48 43.06 4.37 24.85 58.4 51.11 56.2 0 38.83 43.56 45.87 91
149 Iraq 33.39 2.39 58.01 16.98 71.73 67.42 34.87 8.29 50 NA NA 0 36.03 71.73 100 68.09 34.17 36.4 33.34 8.29 100 0 NA NA NA 0 0 NA NA 14.6 37.84 37.02 98
150 Benin 32.42 3.45 34.49 31.04 24.65 67.39 11.44 0.01 74.05 NA 0 65.88 NA 24.65 9 100 93.17 0.02 22.85 0.01 80.1 68 NA 0 0 98.86 98.79 0 NA NA NA NA 28
151 Ghana 32.07 7.58 40.31 26.58 33.45 69.72 17.77 10.25 92 10.81 29.46 34.26 27.3 33.45 16 100 93.17 0 35.54 10.25 100 84 10.81 24.44 34.47 78.03 59.02 0 0 70.71 36.71 8.41 61
152 Solomon Islands 31.63 6.57 46.75 21.56 55.12 70 15.13 0 56 35.07 54.67 17.58 NA 55.12 10 100 100 4.08 26.18 0 100 12 35.07 9.57 99.77 8.45 8.45 53.41 0 NA NA NA 19
153 Comoros 31.39 1.42 47.4 20.72 34.1 76.33 31.77 3.96 58 68.23 48.26 0 NA 34.1 29 100 100 6.3 57.25 3.96 100 16 68.23 0 96.52 0 0 0 0 NA NA NA 48
154 Tajikistan 31.34 5.38 49.89 18.97 43.73 69.19 36.74 2.25 76 NA NA 24.28 NA 43.73 66 82.94 58.63 58.79 14.69 2.25 100 52 NA NA NA 24.28 33.94 NA NA NA NA NA 100
155 India 31.23 5.4 33.19 29.92 50.04 23.24 26.28 10.49 58.4 35.07 22.64 39.18 35.24 50.04 42 27.72 0 6.2 46.36 10.49 24.79 92 35.07 27.14 18.14 27.61 36.33 60.79 32 51.47 26.89 51.91 75
156 Chad 31.02 1.87 29.57 31.99 15.25 70.55 2.91 0 75.14 NA NA 55.34 NA 15.25 12 100 99.64 0 5.81 0 78.28 72 NA NA NA 55.34 51.22 NA NA NA NA NA 4
157 Yemen 30.16 0.2 43.77 21.09 38.98 81.65 10.69 0.49 92 NA 30.85 23.59 NA 38.98 67 97.74 80.22 13.3 8.08 0.49 100 84 NA 25.29 36.41 3.29 3.29 64.21 NA NA NA NA 45
158 Mozambique 29.97 1.49 31.49 28.96 23.25 68.33 2.88 2.5 50.7 3.99 23.67 63.17 NA 23.25 5 100 100 1.32 4.45 2.5 17.4 84 3.99 3.31 44.02 90.84 95.44 66.38 0 NA NA NA 15
159 Gambia 29.3 6.62 41.03 21.48 22.16 69.67 31.26 0.4 92 NA 0 37.05 NA 22.16 9 100 100 21.47 41.04 0.4 100 84 NA 0 0 23.96 34.64 52.56 NA NA NA NA 31
160 Angola 28.69 9.09 35.44 24.19 15.29 79.27 11.76 0 56 26.24 22.95 41.7 NA 15.29 45 100 92.81 16.12 7.4 0 100 12 26.24 18.56 27.34 65.54 62.37 38.89 0 NA NA NA 35
161 Djibouti 28.52 22.77 52.69 12.4 31.57 93.39 33.11 0 84 NA 0 15.45 NA 31.57 87 100 93.17 17.56 48.67 0 NA 84 NA 0 0 0.01 0.01 61.78 0 NA NA NA 50
162 Guinea 28.03 6.34 32.2 25.25 18.03 67.67 10.91 0.75 94 17.25 20.73 41 NA 18.03 3 100 100 1.16 20.65 0.75 100 88 17.25 11.18 30.28 39.78 24.24 0 100 NA NA NA 20
163 Togo 27.91 4.65 32.82 24.63 26.06 67.23 5.18 0 92 28.15 0 44.23 NA 26.06 6 100 95.68 0 10.37 0 100 84 28.15 0 0 66.28 66.41 0 NA NA NA NA 28
164 Myanmar 27.44 6.11 41.39 18.14 45.8 47.68 30.69 0 80 24.47 0 28.62 NA 45.8 8 78.56 56.47 29.11 32.27 0 100 60 24.47 0 0 36.02 25.86 52.61 0 NA NA NA 49
165 Mauritania 27.19 6.25 37.3 20.44 26.73 80.67 4.52 0 56 NA 23.31 32.63 NA 26.73 42 100 100 3.48 5.55 0 100 12 NA 15.76 30.86 3.16 2.54 92.2 NA NA NA NA 18
166 Madagascar 26.7 15.48 37.2 19.71 41.84 67.33 2.43 0.53 92 7.75 0 37.08 NA 41.84 2 100 100 0 4.86 0.53 100 84 7.75 0 0 18.6 18.07 68.66 43 NA NA NA 14
167 Burundi 25.78 0.59 31.56 21.93 18.1 59.95 16.63 0 88 22.83 NA 30.29 NA 18.1 4 97.44 78.42 11.96 21.3 0 100 76 22.83 NA NA 30.29 30.5 NA NA NA NA NA 5
168 Eritrea 25.76 17.09 43.44 13.98 46.58 78.2 5.53 0 92 NA 0 17.94 NA 46.58 40 100 94.6 0 11.06 0 100 84 NA 0 0 28.28 25.55 0 NA NA NA NA 33
169 Bangladesh 25.61 3.98 30.42 22.4 54.87 13.83 22.56 0 92 22.83 0 39.68 NA 54.87 9 32.49 0 14.12 31 0 100 84 22.83 0 0 11.26 30.5 77.27 NA NA NA NA 55
170 Dem. Rep. Congo 25.01 3.56 23.9 25.75 11.04 56.26 4.39 0 58 26.24 NA 44.85 NA 11.04 7 91.26 70.5 4.76 4.03 0 100 16 26.24 NA NA 59.86 59.75 NA 0 NA NA NA 15
171 Sudan 24.64 0.49 36.33 16.84 29.95 73.55 5.51 0 92 NA 22.75 16.29 NA 29.95 21 100 99.64 2.57 8.44 0 100 84 NA 3.23 42.27 5.77 2.81 40.28 NA NA NA NA 29
172 Liberia 23.95 11.03 37.99 14.59 35.4 67.33 11.22 0 96 20.58 30.5 4.13 NA 35.4 2 100 100 1.08 21.36 0 100 92 20.58 13.31 47.7 10.35 6.19 0 0 NA NA NA 4
173 Sierra Leone 21.74 21.79 27.89 17.64 11.55 67.33 4.77 0 56 18.52 26.94 23.54 NA 11.55 2 100 100 0 9.54 0 100 12 18.52 22.5 31.38 37.74 32.87 0 NA NA NA NA 12
174 Afghanistan 21.57 12.17 34.61 12.87 33.83 62.32 7.69 0 50 52.35 NA 2.52 NA 33.83 15 94.25 77.7 4.06 11.33 0 100 0 52.35 NA NA 2.19 4.53 NA 0 NA NA NA 41
175 Lesotho 20.81 4.36 43.31 5.82 36.32 79.67 13.94 0.3 56 NA NA 1.3 NA 36.32 39 100 100 3.39 24.49 0.3 100 12 NA NA NA 1.3 1.3 NA NA NA NA NA 17
176 Haiti 19.01 6.08 37.06 6.98 33.13 69.67 8.37 0 52 23.64 0 1.09 NA 33.13 9 100 100 3.33 13.41 0 100 4 23.64 0 0 1.59 2.76 0 0 NA NA NA 34
177 Mali 18.43 8.67 28.41 11.77 9.7 67.33 8.19 0 58 NA NA 14.3 NA 9.7 2 100 100 2.03 14.35 0 100 16 NA NA NA 14.3 19.92 NA NA NA NA NA 17
178 Somalia 15.47 6.62 28.91 6.5 18.55 66.89 1.29 3.96 56 NA 0 1.75 NA 18.55 5 100 95.68 2.58 0 3.96 100 12 NA 0 0 3.43 3.56 0 0 NA NA NA 29
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="leaflet.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet.js"></script>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
</head>
<body>
<div class="row" id="title">
<div class="col-md-1"></div>
<div class="col-md-10"><h1>Select a country</h1></div>
<div class="col-md-1"></div>
</div>
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-10" id="map" style="height:650px"></div>
<div class="col-md-1"></div>
</div>
<div class="row" id="country">
<div class="col-md-2"></div>
<div class="col-md-8"><h1></h1></div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-2" id="rank"><p></p></div>
<div class="col-md-2" id="EPI"><p></p></div>
<div class="col-md-2" id="change"><p></p></div>
<div class="col-md-3"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8" id="titleChart1"><p></p></div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-7" id="chart1"></div>
<div class="col-md-3" id="legend1"></div>
<div class="col-md-1"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-7" id="titleChart2"><p></p></div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-7" id="chart2"></div>
<div class="col-md-3" id="legend2"></div>
<div class="col-md-1"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8" id="return"><button onclick="window.location.hash = '#title';">Return to map</button></div>
<div class="col-md-2"></div>
</div>
<div class="row" style="height:50px"></div>
<script src="vis.js"></script>
</body>
/* required styles */
.leaflet-map-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-pane,
.leaflet-tile-container,
.leaflet-overlay-pane,
.leaflet-shadow-pane,
.leaflet-marker-pane,
.leaflet-popup-pane,
.leaflet-overlay-pane svg,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
-ms-touch-action: none;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container img {
max-width: none !important;
}
/* stupid Android 2 doesn't understand "max-width: none" properly */
.leaflet-container img.leaflet-image-layer {
max-width: 15000px !important;
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
-moz-user-select: none;
}
.leaflet-tile-pane { z-index: 2; }
.leaflet-objects-pane { z-index: 3; }
.leaflet-overlay-pane { z-index: 4; }
.leaflet-shadow-pane { z-index: 5; }
.leaflet-marker-pane { z-index: 6; }
.leaflet-popup-pane { z-index: 7; }
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
/* control positioning */
.leaflet-control {
position: relative;
z-index: 7;
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-tile,
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-tile-loaded,
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
-o-transition: -o-transform 0.25s cubic-bezier(0,0,0.25,1);
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile,
.leaflet-touching .leaflet-zoom-animated {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-clickable {
cursor: pointer;
}
.leaflet-container {
cursor: -webkit-grab;
cursor: -moz-grab;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging .leaflet-container,
.leaflet-dragging .leaflet-clickable {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
}
/* visual tweaks */
.leaflet-container {
background: rgba(255,0,0,0.0);;
outline: 0;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-container a.leaflet-active {
outline: 2px solid orange;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255,255,255,0.5);
}
/* general typography */
.leaflet-container {
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
border-radius: 4px;
}
.leaflet-bar a,
.leaflet-bar a:hover {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar a:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar a.leaflet-disabled {
cursor: default;
background-color: #f4f4f4;
color: #bbb;
}
.leaflet-touch .leaflet-bar a {
width: 30px;
height: 30px;
line-height: 30px;
}
/* zoom control */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px;
}
.leaflet-control-zoom-out {
font-size: 20px;
}
.leaflet-touch .leaflet-control-zoom-in {
font-size: 22px;
}
.leaflet-touch .leaflet-control-zoom-out {
font-size: 24px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
background: #fff;
border-radius: 5px;
}
.leaflet-control-layers-toggle {
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(images/layers-2x.png);
background-size: 26px 26px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.7);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover {
text-decoration: underline;
}
.leaflet-container .leaflet-control-attribution,
.leaflet-container .leaflet-control-scale {
font-size: 11px;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
font-size: 11px;
white-space: nowrap;
overflow: hidden;
-moz-box-sizing: content-box;
box-sizing: content-box;
background: #fff;
background: rgba(255, 255, 255, 0.5);
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
border: 2px solid rgba(0,0,0,0.2);
background-clip: padding-box;
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 19px;
line-height: 1.4;
}
.leaflet-popup-content p {
margin: 18px 0;
}
.leaflet-popup-tip-container {
margin: 0 auto;
width: 40px;
height: 20px;
position: relative;
overflow: hidden;
}
.leaflet-popup-tip {
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
background: white;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
padding: 4px 4px 0 0;
text-align: center;
width: 18px;
height: 14px;
font: 16px/14px Tahoma, Verdana, sans-serif;
color: #c3c3c3;
text-decoration: none;
font-weight: bold;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover {
color: #999;
}
.leaflet-popup-scrolled {
overflow: auto;
border-bottom: 1px solid #ddd;
border-top: 1px solid #ddd;
}
.leaflet-oldie .leaflet-popup-content-wrapper {
zoom: 1;
}
.leaflet-oldie .leaflet-popup-tip {
width: 24px;
margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-popup-tip-container {
margin-top: -1px;
}
.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
border: 1px solid #999;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}
body {
margin:0;
top:0;
right:0;
bottom:0;
left:0;
}
rect {
fill: steelblue;
}
.layer {
color : #00cbff;
weight : 0.5;
}
.info h4 {
margin: 0 0 5px;
color: #777;
}
.legend {
line-height: 18px;
color: #555;
}
.legend i {
width: 18px;
height: 18px;
float: left;
margin-right: 8px;
opacity: 0.7;
z-index: 10001;
}
i {
width: 18px;
height: 18px;
float: left;
margin-right: 8px;
opacity: 0.7;
z-index: 10001;
}
h1 {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 34px;
font-style: normal;
font-variant: normal;
font-weight: 500;
line-height: 26.4px;
padding: 0cm 1cm 0cm 1cm;
}
h2 {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 22px;
font-style: normal;
font-variant: normal;
font-weight: 500;
line-height: 26.4px;
padding: 0cm 1cm 0cm 1cm;
}
h3 {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 16px;
font-style: normal;
font-variant: normal;
font-weight: 400;
line-height: 15.4px;
padding: 0cm 0cm 0cm 0cm;
}
p {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 16px;
font-style: normal;
font-variant: normal;
font-weight: 400;
line-height: 20px;
padding: 0cm 0cm 0cm 0cm;
}
var margin = {top: 20, right: 10, bottom: 30, left: 200},
width = 830 - margin.left - margin.right,
height = 300 - margin.top - margin.bottom;
var xScale = d3.scaleLinear().range([0, width]);
var yScale = d3.scaleBand().range([0, height]);
var colScale = d3.scaleOrdinal(d3.schemeCategory20);
var cat1 = [
{"key":"Health Impacts", "value":"#fee8c8"},
{"key":"Air Quality", "value": "#fdbb84"},
{"key":"Water and Sanitation", "value":"#e34a33"},
];
var cat2 = [
{"key":"Water Resources", "value": "#edf8fb"},
{"key":"Agriculture", "value":"#bfd3e6"},
{"key":"Forests", "value":"#9ebcda"},
{"key":"Fisheries", "value":"#8c96c6"},
{"key":"Biodiversity and Habitat", "value": "#8856a7"},
{"key":"Climate and Energy", "value":"#810f7c"}
];
var BAR_WIDTH = 10;
var svg1 = d3.select("#chart1").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 svg2 = d3.select("#chart2").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 xAxis1 = svg1.append("g")
.attr("class", "axis x--axis");
var yAxis1 = svg1.append("g")
.attr("class", "axis y--axis");
var xAxis2 = svg2.append("g")
.attr("class", "axis x--axis");
var yAxis2 = svg2.append("g")
.attr("class", "axis y--axis");
var legend1 = d3.select("#legend1");
var legend2 = d3.select("#legend2");
function update(svgChart, myData, attrX, attrY, xAxis, yAxis, legend, colorCategories){
var fnAccX = function(d) { return d[attrX]; };
var fnAccY = function(d) { return d[attrY]; };
var spaceForBar = (height/myData.length) - BAR_WIDTH;
xScale.domain([0, d3.max(myData, fnAccX)]);
yScale.domain(myData.map(fnAccY));
var bars = svgChart.selectAll(".bars")
.data(myData);
//Enter
var barsEnter = bars.enter()
.append("rect")
.attr("class", "bars")
.attr("width", 0);
//Exit
bars.exit()
.transition()
.duration(1000)
.attr("width", 0)
.remove();
//Update
bars.merge(barsEnter)
.attr("x", 0)
.attr("y", function(d,i) {return (spaceForBar/2 + i * (BAR_WIDTH + spaceForBar));})
.style("fill", function (d) {return setColorByCategory(d.category);})
.attr("height", BAR_WIDTH)
.transition().duration(1000)
.attr("width", function(d) {
var value = xScale(fnAccX(d));
if(isNaN(value)){
return 0;
}
else {
return value;
}
});
xAxis.transition()
.duration(1000)
.call(d3.axisTop(xScale).ticks(10));
yAxis.transition()
.duration(1000)
.call(d3.axisLeft()
.scale(yScale).tickArguments(function(d) {return yScale(fnAccY(d));}));
var group = legend.selectAll("div")
.data(colorCategories.map(function(d){return d.key;}))
.enter().append("div")
.attr("transform", function(d, i) { return "translate(0," + (i * 20) + ")"; });
group.append("i")
.attr("width", 18)
.attr("height", 18)
.style("background", function(d,i){
console.log(colorCategories[i].key + " " + colorCategories[i].value);
return colorCategories[i].value;}
);
group.append("text")
.style("font-size","9pt")
.text(function(d,i){return colorCategories[i].key;});
}
function setColorByCategory(category) {
for (var i=0; i < cat1.length; i++){
if(cat1[i].key === category){
return cat1[i].value;
}
}
for (i=0; i < cat2.length; i++){
if(cat2[i].key === category){
return cat2[i].value;
}
}
}
function selectedCountry(myData) {
window.location.hash = '#country';
var country = d3.select("#country");
country.select("h1").text(myData.Country);
var rank = d3.select("#rank");
rank.select("p").text("Overall Rank: " + myData.Rank + "/178");
var EPI = d3.select("#EPI");
EPI.select("p").text("EPI Score: " + myData.EPI);
var change = d3.select("#change");
change.select("p").text("10-Year Change: " + myData["10-Year Percent Change"] + "%");
var dataChart1 = [];
var dataChart2 = [];
for (var attr in myData["Enviromental Healh"]["Health Impacts"]){
dataChart1.push( {
"key":attr,
"value":myData["Enviromental Healh"]["Health Impacts"][attr],
"category":"Health Impacts"
});
}
for (attr in myData["Enviromental Healh"]["Air Quality"]){
dataChart1.push( {
"key":attr,
"value":myData["Enviromental Healh"]["Air Quality"][attr],
"category":"Air Quality"
});
}
for (attr in myData["Enviromental Healh"]["Water and Sanitation"]){
dataChart1.push( {
"key":attr,
"value":myData["Enviromental Healh"]["Water and Sanitation"][attr],
"category":"Water and Sanitation"
});
}
for (attr in myData["Ecosystem Vitality"]["Water Resources"]){
dataChart2.push( {
"key":attr,
"value":myData["Ecosystem Vitality"]["Water Resources"][attr],
"category":"Water Resources"
});
}
for (attr in myData["Ecosystem Vitality"].Agriculture){
dataChart2.push( {
"key":attr,
"value":myData["Ecosystem Vitality"].Agriculture[attr],
"category":"Agriculture"
});
}
for (attr in myData["Ecosystem Vitality"].Forests){
dataChart2.push( {
"key":attr,
"value":myData["Ecosystem Vitality"].Forests[attr],
"category":"Forests"
});
}
for (attr in myData["Ecosystem Vitality"].Fisheries){
dataChart2.push( {
"key":attr,
"value":myData["Ecosystem Vitality"].Fisheries[attr],
"category":"Fisheries"
});
}
for (attr in myData["Ecosystem Vitality"]["Biodiversity and Habitat"]){
dataChart2.push( {
"key":attr,
"value":myData["Ecosystem Vitality"]["Biodiversity and Habitat"][attr],
"category":"Biodiversity and Habitat"
});
}
for (attr in myData["Ecosystem Vitality"]["Climate and Energy"]){
dataChart2.push( {
"key":attr,
"value":myData["Ecosystem Vitality"]["Climate and Energy"][attr],
"category":"Climate and Energy"
});
}
var title1 = d3.select("#titleChart1").select("p")
.text("Enviromental Healh Score: " + myData["Enviromental Healh"].Value);
var title2 = d3.select("#titleChart2").select("p")
.text("Ecosystem Vitality Score: " + myData["Ecosystem Vitality"].Value);
update(svg1, dataChart1, "value", "key", xAxis1, yAxis1, legend1, cat1);
update(svg2, dataChart2, "value", "key", xAxis2, yAxis2, legend2, cat2);
}
d3.csv("epi2014.csv", function(err, data) {
if(err) {
console.err(err);
alert(err);
return;
}
data.forEach(function (d) {
d["EPI Score"]=+d["EPI Score"];
});
$.getJSON("world.json",function(worldMap){
worldMap.features.forEach(function(d){
data.forEach(function (e){
if(d.properties.name.indexOf(e.Country) !== -1 || e.Country.indexOf(d.properties.name) !== -1 ){
d.properties.indicators = {};
d.properties.indicators.Country = e.Country;
d.properties.indicators.Rank = +e.Rank;
d.properties.indicators.EPI = +e["EPI Score"];
d.properties.indicators["10-Year Percent Change"] = +e["10-Year Percent Change"];
d.properties.indicators["Enviromental Healh"] = {};
d.properties.indicators["Ecosystem Vitality"] = {};
d.properties.indicators["Enviromental Healh"].Value = +e["Environmental Health"];
d.properties.indicators["Ecosystem Vitality"].Value = +e["Ecosystem Vitality"];
d.properties.indicators["Enviromental Healh"]["Health Impacts"] = {};
d.properties.indicators["Enviromental Healh"]["Air Quality"] = {};
d.properties.indicators["Enviromental Healh"]["Water and Sanitation"] = {};
d.properties.indicators["Ecosystem Vitality"]["Water Resources"] = {};
d.properties.indicators["Ecosystem Vitality"].Agriculture = {};
d.properties.indicators["Ecosystem Vitality"].Forests = {};
d.properties.indicators["Ecosystem Vitality"].Fisheries = {};
d.properties.indicators["Ecosystem Vitality"]["Biodiversity and Habitat"] = {};
d.properties.indicators["Ecosystem Vitality"]["Climate and Energy"] = {};
d.properties.indicators["Enviromental Healh"]["Health Impacts"]["Child Mortality"] = +e["Child Mortality"];
d.properties.indicators["Enviromental Healh"]["Air Quality"]["Household Air Quality"] = +e["Household Air Quality"];
d.properties.indicators["Enviromental Healh"]["Air Quality"]["Air Pollution - Average Exposure to PM2.5"] = +e["Air Pollution - Average Exposure to PM2.5"];
d.properties.indicators["Enviromental Healh"]["Air Quality"]["Air Pollution - Average PM2.5 Exceedance"] = +e["Air Pollution - Average PM2.5 Exceedance"];
d.properties.indicators["Enviromental Healh"]["Water and Sanitation"]["Access to Sanitation"] = +e["Access to Sanitation"];
d.properties.indicators["Enviromental Healh"]["Water and Sanitation"]["Access to Drinking Water"] = +e["Access to Drinking Water"];
d.properties.indicators["Ecosystem Vitality"]["Water Resources"]["Wastewater Treatment"] = +e["Wastewater Treatment"];
d.properties.indicators["Ecosystem Vitality"].Agriculture["Agricultural Subsidies"] = +e["Agricultural Subsidies"];
d.properties.indicators["Ecosystem Vitality"].Agriculture["Pesticide Regulation"] = +e["Pesticide Regulation"];
d.properties.indicators["Ecosystem Vitality"].Forests["Change in Forest Cover "] = +e["Change in Forest Cover "];
d.properties.indicators["Ecosystem Vitality"].Fisheries["Fish Stocks"] = +e["Fish Stocks"];
d.properties.indicators["Ecosystem Vitality"].Fisheries["Coastal Shelf Fishing Pressure"] = +e["Coastal Shelf Fishing Pressure"];
d.properties.indicators["Ecosystem Vitality"]["Biodiversity and Habitat"]["Terrestrial Protected Areas (National Biome Weights)"] = +e["Terrestrial Protected Areas (National Biome Weights)"];
d.properties.indicators["Ecosystem Vitality"]["Biodiversity and Habitat"]["Terrestrial Protected Areas (Global Biome Weights)"] = +e["Terrestrial Protected Areas (Global Biome Weights)"];
d.properties.indicators["Ecosystem Vitality"]["Biodiversity and Habitat"]["Marine Protected Areas"] = +e["Marine Protected Areas"];
d.properties.indicators["Ecosystem Vitality"]["Biodiversity and Habitat"]["Critical Habitat Protection"] = +e["Critical Habitat Protection"];
d.properties.indicators["Ecosystem Vitality"]["Climate and Energy"]["Trend in Carbon Intensity"] = +e["Trend in Carbon Intensity"];
d.properties.indicators["Ecosystem Vitality"]["Climate and Energy"]["Change of Trend in Carbon Intensity"] = +e["Change of Trend in Carbon Intensity"];
d.properties.indicators["Ecosystem Vitality"]["Climate and Energy"]["Trend in CO2 Emissions per KwH"] = +e["Trend in CO2 Emissions per KwH"];
d.properties.indicators["Ecosystem Vitality"]["Climate and Energy"]["Access to Electricity"] = +e["Access to Electricity"];
}
})
});
var map = L.map('map', { zoomControl:false }).setView([39, -1], 1.8);
map.dragging.disable();
map.scrollWheelZoom.disable();
var layer = L.geoJson(worldMap, {
clickable: true,
style: function(feature) {
return {
stroke: true,
color: "#0d174e",
weight: 1,
fill: true,
fillColor: setColorByEPI(feature.properties.indicators),
fillOpacity: 1
};
},
onEachFeature: function (feature, layer) {
layer.on({
click: function(e) {
if (e.target.feature.properties.indicators === undefined){
console.log(feature);
}
selectedCountry(e.target.feature.properties.indicators);
}
});
},
});
layer.addTo(map);
var legend = L.control({
position: 'bottomleft'
});
legend.onAdd = function() {
var div = L.DomUtil.create('div', 'legend'),
values = [10,20,30,40,50,60,70,80,90];
div.innerHTML += 'EPI SCORE<br>';
for (var i = 0; i < values.length; i++) {
div.innerHTML +=
'<i style="background:' + setColorByForLegend(values[i] + 1) + '"></i> '+ values[i] + (values[i + 1] ? ' &ndash; ' + values[i + 1] +'<br>' : '+');
}
return div;
};
legend.addTo(map);
});
function setColorByForLegend(epi) {
if (epi > 90) return "#1a9850";
else if (epi > 80) return "#66bd63";
else if (epi > 70) return "#a6d96a";
else if (epi> 60) return "#d9ef8b";
else if (epi > 50) return "#ffffbf";
else if (epi > 40) return "#fee08b";
else if (epi > 30) return "#fdae61";
else if (epi > 20) return "#f46d43";
else if (epi > 10) return "#d73027";
}
function setColorByEPI(indicators) {
if (indicators === undefined) return "#ffffbf";
else if (indicators.EPI > 90) return "#1a9850";
else if (indicators.EPI > 80) return "#66bd63";
else if (indicators.EPI > 70) return "#a6d96a";
else if (indicators.EPI > 60) return "#d9ef8b";
else if (indicators.EPI > 50) return "#ffffbf";
else if (indicators.EPI > 40) return "#fee08b";
else if (indicators.EPI > 30) return "#fdae61";
else if (indicators.EPI > 20) return "#f46d43";
else if (indicators.EPI > 10) return "#d73027";
}
});
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment