Skip to content

Commit

Permalink
Merge pull request #15 from protontypes/public-feedback
Browse files Browse the repository at this point in the history
Improve map readability
  • Loading branch information
Ly0n authored Feb 7, 2023
2 parents f9355f0 + 0c2d408 commit dad0e69
Showing 1 changed file with 238 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
"legendgroup": "",
"marker": {
"line": {
"color": "#000000",
"color": "#040404",
"width": 1
}
},
Expand Down Expand Up @@ -248,11 +248,11 @@
"t": 0
},
"piecolorway": [
"#0E7C7B",
"#17BEBB",
"#FFC857",
"#E9724C",
"#C5283D"
"#3361e4",
"#2b6fc9",
"#227eae",
"#1a8d93",
"#169485"
],
"showlegend": false,
"template": {
Expand Down Expand Up @@ -1205,7 +1205,7 @@
"legendgroup": "",
"marker": {
"line": {
"color": "#000000",
"color": "#040404",
"width": 1
}
},
Expand Down Expand Up @@ -1239,11 +1239,11 @@
"t": 0
},
"piecolorway": [
"#0E7C7B",
"#17BEBB",
"#FFC857",
"#E9724C",
"#C5283D"
"#3361e4",
"#2b6fc9",
"#227eae",
"#1a8d93",
"#169485"
],
"showlegend": false,
"template": {
Expand Down Expand Up @@ -2142,8 +2142,172 @@
"data": [
{
"coloraxis": "coloraxis",
"customdata": [
[
"USA",
187
],
[
"",
180
],
[
"DEU",
73
],
[
"FRA",
31
],
[
"GBR",
29
],
[
"NLD",
21
],
[
"AUS",
17
],
[
"CAN",
11
],
[
"CHE",
9
],
[
"DNK",
7
],
[
"BEL",
7
],
[
"ITA",
5
],
[
"ESP",
5
],
[
"NOR",
5
],
[
"SWE",
4
],
[
"JPN",
4
],
[
"BRA",
4
],
[
"REU",
4
],
[
"IRL",
4
],
[
"AUT",
3
],
[
"CHN",
3
],
[
"NZL",
2
],
[
"PRT",
2
],
[
"SGP",
2
],
[
"FIN",
2
],
[
"ARG",
1
],
[
"ISR",
1
],
[
"IRN",
1
],
[
"CHL",
1
],
[
"PAN",
1
],
[
"SVN",
1
],
[
"THA",
1
]
],
"geo": "geo",
"hovertemplate": "country=%{location}<br>counts=%{z}<extra></extra>",
"hovertemplate": "%{customdata[0]}<extra>%{customdata[1]}</extra>",
"hovertext": [
"USA",
"",
"DEU",
"FRA",
"GBR",
"NLD",
"AUS",
"CAN",
"CHE",
"DNK",
"BEL",
"ITA",
"ESP",
"NOR",
"SWE",
"JPN",
"BRA",
"REU",
"IRL",
"AUT",
"CHN",
"NZL",
"PRT",
"SGP",
"FIN",
"ARG",
"ISR",
"IRN",
"CHL",
"PAN",
"SVN",
"THA"
],
"locationmode": "ISO-3",
"locations": [
"USA",
Expand Down Expand Up @@ -2182,46 +2346,69 @@
"name": "",
"type": "choropleth",
"z": [
187,
180,
73,
31,
29,
21,
17,
11,
9,
7,
7,
5,
5,
5,
4,
4,
4,
4,
4,
3,
3,
7.546894459887636,
7.491853096329675,
6.189824558880018,
4.954196310386875,
4.857980995127572,
4.392317422778761,
4.087462841250339,
3.4594316186372973,
3.169925001442312,
2.807354922057604,
2.807354922057604,
2.321928094887362,
2.321928094887362,
2.321928094887362,
2,
2,
2,
2,
2,
1.584962500721156,
1.584962500721156,
1,
1,
1,
1,
1,
1,
1
0,
0,
0,
0,
0,
0,
0
]
}
],
"layout": {
"autosize": false,
"coloraxis": {
"colorbar": {
"dtick": "log",
"orientation": "h",
"ticktext": [
"0",
"2",
"4",
"8",
"16",
"32",
"64",
"128",
"256"
],
"tickvals": [
0,
1,
2,
3,
4,
5,
6,
7,
8
],
"title": {
"text": "Organisations"
},
Expand All @@ -2230,31 +2417,11 @@
"colorscale": [
[
0,
"rgb(237, 239, 93)"
],
[
0.16666666666666666,
"rgb(169, 220, 103)"
],
[
0.3333333333333333,
"rgb(110, 197, 116)"
],
[
0.5,
"rgb(57, 171, 126)"
],
[
0.6666666666666666,
"rgb(13, 143, 129)"
],
[
0.8333333333333334,
"rgb(15, 114, 121)"
"#3b52ff"
],
[
1,
"rgb(36, 86, 104)"
"#169485"
]
]
},
Expand All @@ -2276,7 +2443,7 @@
"tracegroupgap": 0
},
"margin": {
"b": 0,
"b": 10,
"l": 20,
"r": 0,
"t": 40
Expand Down Expand Up @@ -3127,21 +3294,29 @@
" df_countries,\n",
" locations=\"country\",\n",
" locationmode=\"ISO-3\",\n",
" color=\"counts\",\n",
" color_continuous_scale=color_continuous_scale,\n",
" color=np.log2(df_countries[\"counts\"]),\n",
" color_continuous_scale=[\"#829EEA\", \"#169485\"],\n",
" hover_name=\"country\", \n",
" hover_data={\"country\": False, \"counts\": True,}\n",
")\n",
"\n",
"fig.update_traces(hovertemplate=\"%{customdata[0]}<extra>%{customdata[1]}</extra>\")\n",
"\n",
"\n",
"fig.update_layout(\n",
" coloraxis_colorbar=dict(\n",
" title=\"Organisations\",\n",
" orientation='h',\n",
" tickvals = [0, 1, 2, 3, 4, 5, 6, 7, 8],\n",
" ticktext = ['0', '2', '4', '8', '16', '32', '64', '128', '256'],\n",
" dtick='log',\n",
" y=-0.25\n",
" ),\n",
" autosize=False,\n",
" dragmode=False,\n",
")\n",
"\n",
"fig[\"layout\"].update(margin=dict(l=20, r=0, b=0, t=40))\n",
"fig[\"layout\"].update(margin=dict(l=20, r=0, b=10, t=40))\n",
"\n",
"fig.show(responsive=True)"
]
Expand Down

0 comments on commit dad0e69

Please sign in to comment.