@amcharts/amcharts5 5.3.17 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/.internal/charts/flow/ArcDiagram.d.ts +86 -0
  2. package/.internal/charts/flow/ArcDiagram.d.ts.map +1 -0
  3. package/.internal/charts/flow/ArcDiagram.js +161 -0
  4. package/.internal/charts/flow/ArcDiagram.js.map +1 -0
  5. package/.internal/charts/flow/ArcDiagramLink.d.ts +40 -0
  6. package/.internal/charts/flow/ArcDiagramLink.d.ts.map +1 -0
  7. package/.internal/charts/flow/ArcDiagramLink.js +130 -0
  8. package/.internal/charts/flow/ArcDiagramLink.js.map +1 -0
  9. package/.internal/charts/flow/ArcDiagramNodes.d.ts +60 -0
  10. package/.internal/charts/flow/ArcDiagramNodes.d.ts.map +1 -0
  11. package/.internal/charts/flow/ArcDiagramNodes.js +96 -0
  12. package/.internal/charts/flow/ArcDiagramNodes.js.map +1 -0
  13. package/.internal/charts/flow/Chord.d.ts +0 -9
  14. package/.internal/charts/flow/Chord.d.ts.map +1 -1
  15. package/.internal/charts/flow/Chord.js +0 -10
  16. package/.internal/charts/flow/Chord.js.map +1 -1
  17. package/.internal/charts/flow/ChordNodes.d.ts +9 -0
  18. package/.internal/charts/flow/ChordNodes.d.ts.map +1 -1
  19. package/.internal/charts/flow/ChordNodes.js +23 -2
  20. package/.internal/charts/flow/ChordNodes.js.map +1 -1
  21. package/.internal/charts/flow/Flow.js +1 -0
  22. package/.internal/charts/flow/Flow.js.map +1 -1
  23. package/.internal/charts/flow/FlowDefaultTheme.d.ts.map +1 -1
  24. package/.internal/charts/flow/FlowDefaultTheme.js +51 -0
  25. package/.internal/charts/flow/FlowDefaultTheme.js.map +1 -1
  26. package/.internal/charts/hierarchy/Hierarchy.d.ts.map +1 -1
  27. package/.internal/charts/hierarchy/Hierarchy.js.map +1 -1
  28. package/.internal/charts/hierarchy/HierarchyDefaultTheme.d.ts.map +1 -1
  29. package/.internal/charts/hierarchy/HierarchyDefaultTheme.js +45 -0
  30. package/.internal/charts/hierarchy/HierarchyDefaultTheme.js.map +1 -1
  31. package/.internal/charts/hierarchy/Partition.d.ts +1 -1
  32. package/.internal/charts/hierarchy/Partition.js +1 -1
  33. package/.internal/charts/hierarchy/Partition.js.map +1 -1
  34. package/.internal/charts/hierarchy/VoronoiTreemap.d.ts +117 -0
  35. package/.internal/charts/hierarchy/VoronoiTreemap.d.ts.map +1 -0
  36. package/.internal/charts/hierarchy/VoronoiTreemap.js +176 -0
  37. package/.internal/charts/hierarchy/VoronoiTreemap.js.map +1 -0
  38. package/.internal/core/Classes.d.ts +10 -0
  39. package/.internal/core/Classes.d.ts.map +1 -1
  40. package/.internal/core/Classes.js.map +1 -1
  41. package/.internal/core/Registry.d.ts.map +1 -1
  42. package/.internal/core/Registry.js +1 -1
  43. package/.internal/core/Registry.js.map +1 -1
  44. package/.internal/core/render/Polygon.d.ts +52 -0
  45. package/.internal/core/render/Polygon.d.ts.map +1 -0
  46. package/.internal/core/render/Polygon.js +133 -0
  47. package/.internal/core/render/Polygon.js.map +1 -0
  48. package/.internal/core/render/Sprite.js +1 -1
  49. package/.internal/core/render/Sprite.js.map +1 -1
  50. package/.internal/core/render/backend/CanvasRenderer.js +1 -1
  51. package/.internal/core/render/backend/CanvasRenderer.js.map +1 -1
  52. package/.internal/themes/AnimatedTheme.d.ts.map +1 -1
  53. package/.internal/themes/AnimatedTheme.js +2 -0
  54. package/.internal/themes/AnimatedTheme.js.map +1 -1
  55. package/.internal/themes/DefaultTheme.d.ts.map +1 -1
  56. package/.internal/themes/DefaultTheme.js +3 -0
  57. package/.internal/themes/DefaultTheme.js.map +1 -1
  58. package/CHANGELOG.md +10 -0
  59. package/examples/javascript/flow-arc-horizontal/README.md +6 -0
  60. package/examples/javascript/flow-arc-horizontal/index.css +11 -0
  61. package/examples/javascript/flow-arc-horizontal/index.html +12 -0
  62. package/examples/javascript/flow-arc-horizontal/index.js +116 -0
  63. package/examples/javascript/flow-arc-horizontal/package.json +16 -0
  64. package/examples/javascript/flow-arc-horizontal/webpack.config.js +38 -0
  65. package/examples/javascript/flow-arc-vertical/README.md +6 -0
  66. package/examples/javascript/flow-arc-vertical/index.css +11 -0
  67. package/examples/javascript/flow-arc-vertical/index.html +12 -0
  68. package/examples/javascript/flow-arc-vertical/index.js +91 -0
  69. package/examples/javascript/flow-arc-vertical/package.json +16 -0
  70. package/examples/javascript/flow-arc-vertical/webpack.config.js +38 -0
  71. package/examples/javascript/flow-chord/package.json +1 -1
  72. package/examples/javascript/flow-chord-directed/package.json +1 -1
  73. package/examples/javascript/flow-chord-non-ribbon/package.json +1 -1
  74. package/examples/javascript/flow-sankey/package.json +1 -1
  75. package/examples/javascript/gauge/package.json +1 -1
  76. package/examples/javascript/gauge-bands/package.json +1 -1
  77. package/examples/javascript/hierarchy-force-directed/package.json +1 -1
  78. package/examples/javascript/hierarchy-pack/package.json +1 -1
  79. package/examples/javascript/hierarchy-partition/package.json +1 -1
  80. package/examples/javascript/hierarchy-sunburst/package.json +1 -1
  81. package/examples/javascript/hierarchy-tree/package.json +1 -1
  82. package/examples/javascript/hierarchy-treemap/package.json +1 -1
  83. package/examples/javascript/hierarchy-voronoi-treemap/README.md +6 -0
  84. package/examples/javascript/hierarchy-voronoi-treemap/index.css +11 -0
  85. package/examples/javascript/hierarchy-voronoi-treemap/index.html +12 -0
  86. package/examples/javascript/hierarchy-voronoi-treemap/index.js +1298 -0
  87. package/examples/javascript/hierarchy-voronoi-treemap/package.json +16 -0
  88. package/examples/javascript/hierarchy-voronoi-treemap/webpack.config.js +38 -0
  89. package/examples/javascript/jest/package.json +1 -1
  90. package/examples/javascript/json-pie/package.json +1 -1
  91. package/examples/javascript/json-xy/package.json +1 -1
  92. package/examples/javascript/map-animating-along-lines/package.json +1 -1
  93. package/examples/javascript/map-day-and-night/package.json +1 -1
  94. package/examples/javascript/map-globe-rotate-to-country/package.json +1 -1
  95. package/examples/javascript/map-globe-with-projected-circles/package.json +1 -1
  96. package/examples/javascript/map-with-bubbles/package.json +1 -1
  97. package/examples/javascript/map-zoom-to-country/package.json +1 -1
  98. package/examples/javascript/misc-40-charts/package.json +1 -1
  99. package/examples/javascript/misc-microchart-grid/package.json +1 -1
  100. package/examples/javascript/pie-chart/package.json +1 -1
  101. package/examples/javascript/pie-donut-chart/package.json +1 -1
  102. package/examples/javascript/pie-variable-radius/package.json +1 -1
  103. package/examples/javascript/radar-column-iwatch-style/package.json +1 -1
  104. package/examples/javascript/radar-heat-map/package.json +1 -1
  105. package/examples/javascript/radar-line/package.json +1 -1
  106. package/examples/javascript/radar-time-line/package.json +1 -1
  107. package/examples/javascript/sliced-funnel/package.json +1 -1
  108. package/examples/javascript/sliced-pictorial-stacked/package.json +1 -1
  109. package/examples/javascript/sliced-pyramid/package.json +1 -1
  110. package/examples/javascript/stock-chart/package.json +1 -1
  111. package/examples/javascript/stock-chart-comparing-stocks/package.json +1 -1
  112. package/examples/javascript/stock-chart-data-granularity/package.json +1 -1
  113. package/examples/javascript/stock-chart-data-grouping/package.json +1 -1
  114. package/examples/javascript/stock-chart-intraday/package.json +1 -1
  115. package/examples/javascript/stock-chart-live/package.json +1 -1
  116. package/examples/javascript/stock-chart-volume-separate-panel/package.json +1 -1
  117. package/examples/javascript/venn-diagram/package.json +1 -1
  118. package/examples/javascript/wordcloud-with-data/package.json +1 -1
  119. package/examples/javascript/wordcloud-with-text/package.json +1 -1
  120. package/examples/javascript/xy-100-percent-stacked-column/package.json +1 -1
  121. package/examples/javascript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  122. package/examples/javascript/xy-bubble/package.json +1 -1
  123. package/examples/javascript/xy-candlestick/package.json +1 -1
  124. package/examples/javascript/xy-clustered-column/package.json +1 -1
  125. package/examples/javascript/xy-column/package.json +1 -1
  126. package/examples/javascript/xy-comparing-series-google-analytics-style/package.json +1 -1
  127. package/examples/javascript/xy-data-grouping/package.json +1 -1
  128. package/examples/javascript/xy-draggable-range/package.json +1 -1
  129. package/examples/javascript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  130. package/examples/javascript/xy-dumbbell plot/package.json +1 -1
  131. package/examples/javascript/xy-evenly-spaced-date-axis/package.json +1 -1
  132. package/examples/javascript/xy-line/package.json +1 -1
  133. package/examples/javascript/xy-line-highlight-on-legend-hover/package.json +1 -1
  134. package/examples/javascript/xy-live-data/package.json +1 -1
  135. package/examples/javascript/xy-multiple-synced-value-axes/package.json +1 -1
  136. package/examples/javascript/xy-ohlc/package.json +1 -1
  137. package/examples/javascript/xy-real-time-data-sorting/package.json +1 -1
  138. package/examples/javascript/xy-smoothed-line/package.json +1 -1
  139. package/examples/javascript/xy-stacked-and-clustered-column/package.json +1 -1
  140. package/examples/javascript/xy-stacked-column/package.json +1 -1
  141. package/examples/javascript/xy-stacked-step/package.json +1 -1
  142. package/examples/javascript/xy-stock/package.json +1 -1
  143. package/examples/javascript/xy-stock-comparing/package.json +1 -1
  144. package/examples/typescript/flow-arc-horizontal/README.md +6 -0
  145. package/examples/typescript/flow-arc-horizontal/index.css +11 -0
  146. package/examples/typescript/flow-arc-horizontal/index.html +12 -0
  147. package/examples/typescript/flow-arc-horizontal/index.ts +116 -0
  148. package/examples/typescript/flow-arc-horizontal/package.json +18 -0
  149. package/examples/typescript/flow-arc-horizontal/tsconfig.json +12 -0
  150. package/examples/typescript/flow-arc-horizontal/webpack.config.js +45 -0
  151. package/examples/typescript/flow-arc-vertical/README.md +6 -0
  152. package/examples/typescript/flow-arc-vertical/index.css +11 -0
  153. package/examples/typescript/flow-arc-vertical/index.html +12 -0
  154. package/examples/typescript/flow-arc-vertical/index.ts +91 -0
  155. package/examples/typescript/flow-arc-vertical/package.json +18 -0
  156. package/examples/typescript/flow-arc-vertical/tsconfig.json +12 -0
  157. package/examples/typescript/flow-arc-vertical/webpack.config.js +45 -0
  158. package/examples/typescript/flow-chord/package.json +1 -1
  159. package/examples/typescript/flow-chord-directed/package.json +1 -1
  160. package/examples/typescript/flow-chord-non-ribbon/package.json +1 -1
  161. package/examples/typescript/flow-sankey/package.json +1 -1
  162. package/examples/typescript/gauge/package.json +1 -1
  163. package/examples/typescript/gauge-bands/package.json +1 -1
  164. package/examples/typescript/hierarchy-force-directed/package.json +1 -1
  165. package/examples/typescript/hierarchy-pack/package.json +1 -1
  166. package/examples/typescript/hierarchy-partition/package.json +1 -1
  167. package/examples/typescript/hierarchy-sunburst/package.json +1 -1
  168. package/examples/typescript/hierarchy-tree/package.json +1 -1
  169. package/examples/typescript/hierarchy-treemap/package.json +1 -1
  170. package/examples/typescript/hierarchy-voronoi-treemap/README.md +6 -0
  171. package/examples/typescript/hierarchy-voronoi-treemap/index.css +11 -0
  172. package/examples/typescript/hierarchy-voronoi-treemap/index.html +12 -0
  173. package/examples/typescript/hierarchy-voronoi-treemap/index.ts +1298 -0
  174. package/examples/typescript/hierarchy-voronoi-treemap/package.json +18 -0
  175. package/examples/typescript/hierarchy-voronoi-treemap/tsconfig.json +12 -0
  176. package/examples/typescript/hierarchy-voronoi-treemap/webpack.config.js +45 -0
  177. package/examples/typescript/jest/package.json +1 -1
  178. package/examples/typescript/json-pie/package.json +1 -1
  179. package/examples/typescript/json-xy/package.json +1 -1
  180. package/examples/typescript/map-animating-along-lines/package.json +1 -1
  181. package/examples/typescript/map-day-and-night/package.json +1 -1
  182. package/examples/typescript/map-globe-rotate-to-country/package.json +1 -1
  183. package/examples/typescript/map-globe-with-projected-circles/package.json +1 -1
  184. package/examples/typescript/map-with-bubbles/package.json +1 -1
  185. package/examples/typescript/map-zoom-to-country/package.json +1 -1
  186. package/examples/typescript/misc-40-charts/package.json +1 -1
  187. package/examples/typescript/misc-microchart-grid/package.json +1 -1
  188. package/examples/typescript/pie-chart/package.json +1 -1
  189. package/examples/typescript/pie-donut-chart/package.json +1 -1
  190. package/examples/typescript/pie-variable-radius/package.json +1 -1
  191. package/examples/typescript/radar-column-iwatch-style/package.json +1 -1
  192. package/examples/typescript/radar-heat-map/package.json +1 -1
  193. package/examples/typescript/radar-line/package.json +1 -1
  194. package/examples/typescript/radar-time-line/package.json +1 -1
  195. package/examples/typescript/sliced-funnel/package.json +1 -1
  196. package/examples/typescript/sliced-pictorial-stacked/package.json +1 -1
  197. package/examples/typescript/sliced-pyramid/package.json +1 -1
  198. package/examples/typescript/stock-chart/package.json +1 -1
  199. package/examples/typescript/stock-chart-comparing-stocks/package.json +1 -1
  200. package/examples/typescript/stock-chart-data-granularity/package.json +1 -1
  201. package/examples/typescript/stock-chart-data-grouping/package.json +1 -1
  202. package/examples/typescript/stock-chart-intraday/package.json +1 -1
  203. package/examples/typescript/stock-chart-live/package.json +1 -1
  204. package/examples/typescript/stock-chart-volume-separate-panel/package.json +1 -1
  205. package/examples/typescript/venn-diagram/package.json +1 -1
  206. package/examples/typescript/wordcloud-with-data/package.json +1 -1
  207. package/examples/typescript/wordcloud-with-text/package.json +1 -1
  208. package/examples/typescript/xy-100-percent-stacked-column/package.json +1 -1
  209. package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  210. package/examples/typescript/xy-bubble/package.json +1 -1
  211. package/examples/typescript/xy-candlestick/package.json +1 -1
  212. package/examples/typescript/xy-clustered-column/package.json +1 -1
  213. package/examples/typescript/xy-column/package.json +1 -1
  214. package/examples/typescript/xy-comparing-series-google-analytics-style/package.json +1 -1
  215. package/examples/typescript/xy-data-grouping/package.json +1 -1
  216. package/examples/typescript/xy-draggable-range/package.json +1 -1
  217. package/examples/typescript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  218. package/examples/typescript/xy-dumbbell plot/package.json +1 -1
  219. package/examples/typescript/xy-evenly-spaced-date-axis/package.json +1 -1
  220. package/examples/typescript/xy-line/package.json +1 -1
  221. package/examples/typescript/xy-line-highlight-on-legend-hover/package.json +1 -1
  222. package/examples/typescript/xy-live-data/package.json +1 -1
  223. package/examples/typescript/xy-multiple-synced-value-axes/package.json +1 -1
  224. package/examples/typescript/xy-ohlc/package.json +1 -1
  225. package/examples/typescript/xy-real-time-data-sorting/package.json +1 -1
  226. package/examples/typescript/xy-smoothed-line/package.json +1 -1
  227. package/examples/typescript/xy-stacked-and-clustered-column/package.json +1 -1
  228. package/examples/typescript/xy-stacked-column/package.json +1 -1
  229. package/examples/typescript/xy-stacked-step/package.json +1 -1
  230. package/examples/typescript/xy-stock/package.json +1 -1
  231. package/examples/typescript/xy-stock-comparing/package.json +1 -1
  232. package/flow.d.ts +3 -0
  233. package/flow.d.ts.map +1 -1
  234. package/flow.js +3 -0
  235. package/flow.js.map +1 -1
  236. package/hierarchy.d.ts +1 -0
  237. package/hierarchy.d.ts.map +1 -1
  238. package/hierarchy.js +1 -0
  239. package/hierarchy.js.map +1 -1
  240. package/index.d.ts +1 -0
  241. package/index.d.ts.map +1 -1
  242. package/index.js +1 -0
  243. package/index.js.map +1 -1
  244. package/package.json +4 -2
@@ -0,0 +1,1298 @@
1
+ import * as am5 from "@amcharts/amcharts5";
2
+ import * as am5hierarchy from "@amcharts/amcharts5/hierarchy";
3
+ import am5themes_Animated from "@amcharts/amcharts5/themes/Animated";
4
+
5
+
6
+ // Create root element
7
+ // https://www.amcharts.com/docs/v5/getting-started/#Root_element
8
+ let root = am5.Root.new("chartdiv");
9
+
10
+
11
+ // Create custom theme...
12
+ const myTheme = am5.Theme.new(root);
13
+
14
+ // ... no stroke and fill on zero level
15
+ myTheme.rule("Polygon", ["hierarchy", "node", "shape", "depth0"]).setAll({
16
+ strokeOpacity: 0,
17
+ fillOpacity: 0
18
+ });
19
+
20
+ // ... thick stroke and full opacity on first level
21
+ myTheme.rule("Polygon", ["hierarchy", "node", "shape", "depth1"]).setAll({
22
+ strokeWidth: 5,
23
+ fillOpacity: 1,
24
+ stroke: am5.color(0x000000)
25
+ });
26
+
27
+ // ... no fill and thin stroke on second level
28
+ myTheme.rule("Polygon", ["hierarchy", "node", "shape", "depth2"]).setAll({
29
+ fillOpacity: 0,
30
+ strokeWidth: 1,
31
+ stroke: am5.color(0x000000)
32
+ });
33
+
34
+ // ... by default last lever is not clickable, but we change it here, so, add pointer on the last level
35
+ myTheme.rule("HierarchyNode", ["last"]).setAll({
36
+ cursorOverStyle: "pointer"
37
+ });
38
+
39
+ // ... set global settings for all labels
40
+ myTheme.rule("Label", ["node"]).setAll({
41
+ fontSize: 11,
42
+ minScale: 0.7
43
+ });
44
+
45
+ // ... hide label of zero level
46
+ myTheme.rule("Label", ["node", "depth0"]).setAll({
47
+ forceHidden: true
48
+ });
49
+
50
+ // ... hide label of first level
51
+ myTheme.rule("Label", ["node", "depth1"]).setAll({
52
+ forceHidden: true
53
+ });
54
+
55
+
56
+ // Set themes
57
+ // https://www.amcharts.com/docs/v5/concepts/themes/
58
+ root.setThemes([
59
+ am5themes_Animated.new(root),
60
+ myTheme
61
+ ]);
62
+
63
+
64
+ // Prepare data
65
+ var data = {
66
+ "children": [
67
+ {
68
+ "name": "Africa",
69
+ "children": [
70
+ {
71
+ "id": "DZ",
72
+ "name": "Algeria",
73
+ "population": 40400000
74
+ },
75
+ {
76
+ "id": "AO",
77
+ "name": "Angola",
78
+ "population": 25868000
79
+ },
80
+ {
81
+ "id": "BJ",
82
+ "name": "Benin",
83
+ "population": 10653654
84
+ },
85
+ {
86
+ "id": "BW",
87
+ "name": "Botswana",
88
+ "population": 2141206
89
+ },
90
+ {
91
+ "id": "BF",
92
+ "name": "Burkina Faso",
93
+ "population": 19034397
94
+ },
95
+ {
96
+ "id": "BI",
97
+ "name": "Burundi",
98
+ "population": 10114505
99
+ },
100
+ {
101
+ "id": "CV",
102
+ "name": "Cabo Verde",
103
+ "population": 531239
104
+ },
105
+ {
106
+ "id": "CM",
107
+ "name": "Cameroon",
108
+ "population": 22709892
109
+ },
110
+ {
111
+ "id": "CF",
112
+ "name": "Central African Republic",
113
+ "population": 4998000
114
+ },
115
+ {
116
+ "id": "TD",
117
+ "name": "Chad",
118
+ "population": 14497000
119
+ },
120
+ {
121
+ "id": "KM",
122
+ "name": "Comoros",
123
+ "population": 806153
124
+ },
125
+ {
126
+ "id": "CG",
127
+ "name": "Congo (Brazzaville)",
128
+ "population": 4741000
129
+ },
130
+ {
131
+ "id": "CD",
132
+ "name": "Congo (Kinshasa)",
133
+ "population": 85026000
134
+ },
135
+ {
136
+ "id": "DJ",
137
+ "name": "Djibouti",
138
+ "population": 900000
139
+ },
140
+ {
141
+ "id": "EG",
142
+ "name": "Egypt",
143
+ "population": 91251890
144
+ },
145
+ {
146
+ "id": "GQ",
147
+ "name": "Equatorial Guinea",
148
+ "population": 1222442
149
+ },
150
+ {
151
+ "id": "ER",
152
+ "name": "Eritrea",
153
+ "population": 4474690
154
+ },
155
+ {
156
+ "id": "SZ",
157
+ "name": "Eswatini",
158
+ "population": 1136191
159
+ },
160
+ {
161
+ "id": "ET",
162
+ "name": "Ethiopia",
163
+ "population": 102403196
164
+ },
165
+ {
166
+ "id": "GA",
167
+ "name": "Gabon",
168
+ "population": 1802278
169
+ },
170
+ {
171
+ "id": "GM",
172
+ "name": "Gambia",
173
+ "population": 1882450
174
+ },
175
+ {
176
+ "id": "GH",
177
+ "name": "Ghana",
178
+ "population": 27670174
179
+ },
180
+ {
181
+ "id": "GN",
182
+ "name": "Guinea",
183
+ "population": 12947000
184
+ },
185
+ {
186
+ "id": "GW",
187
+ "name": "Guinea-Bissau",
188
+ "population": 1547777
189
+ },
190
+ {
191
+ "id": "KE",
192
+ "name": "Kenya",
193
+ "population": 47251000
194
+ },
195
+ {
196
+ "id": "LS",
197
+ "name": "Lesotho",
198
+ "population": 2263010
199
+ },
200
+ {
201
+ "id": "LR",
202
+ "name": "Liberia",
203
+ "population": 4615000
204
+ },
205
+ {
206
+ "id": "LY",
207
+ "name": "Libya",
208
+ "population": 6385000
209
+ },
210
+ {
211
+ "id": "MG",
212
+ "name": "Madagascar",
213
+ "population": 22434363
214
+ },
215
+ {
216
+ "id": "MW",
217
+ "name": "Malawi",
218
+ "population": 18622104
219
+ },
220
+ {
221
+ "id": "ML",
222
+ "name": "Mali",
223
+ "population": 17994837
224
+ },
225
+ {
226
+ "id": "MR",
227
+ "name": "Mauritania",
228
+ "population": 4420184
229
+ },
230
+ {
231
+ "id": "MU",
232
+ "name": "Mauritius",
233
+ "population": 1262879
234
+ },
235
+ {
236
+ "id": "MA",
237
+ "name": "Morocco",
238
+ "population": 34224455
239
+ },
240
+ {
241
+ "id": "MZ",
242
+ "name": "Mozambique",
243
+ "population": 28829476
244
+ },
245
+ {
246
+ "id": "NA",
247
+ "name": "Namibia",
248
+ "population": 2324004
249
+ },
250
+ {
251
+ "id": "NE",
252
+ "name": "Niger",
253
+ "population": 21477348
254
+ },
255
+ {
256
+ "id": "NG",
257
+ "name": "Nigeria",
258
+ "population": 186988000
259
+ },
260
+ {
261
+ "id": "RW",
262
+ "name": "Rwanda",
263
+ "population": 11553188
264
+ },
265
+ {
266
+ "id": "ST",
267
+ "name": "São Tomé and Príncipe",
268
+ "population": 187356
269
+ },
270
+ {
271
+ "id": "SN",
272
+ "name": "Senegal",
273
+ "population": 14799859
274
+ },
275
+ {
276
+ "id": "SC",
277
+ "name": "Seychelles",
278
+ "population": 91400
279
+ },
280
+ {
281
+ "id": "SL",
282
+ "name": "Sierra Leone",
283
+ "population": 7075641
284
+ },
285
+ {
286
+ "id": "SO",
287
+ "name": "Somalia",
288
+ "population": 11079000
289
+ },
290
+ {
291
+ "id": "ZA",
292
+ "name": "South Africa",
293
+ "population": 55653654
294
+ },
295
+ {
296
+ "id": "SS",
297
+ "name": "South Sudan",
298
+ "population": 12131000
299
+ },
300
+ {
301
+ "id": "SD",
302
+ "name": "Sudan",
303
+ "population": 39598700
304
+ },
305
+ {
306
+ "id": "TZ",
307
+ "name": "Tanzania",
308
+ "population": 55155000
309
+ },
310
+ {
311
+ "id": "TG",
312
+ "name": "Togo",
313
+ "population": 7606374
314
+ },
315
+ {
316
+ "id": "TN",
317
+ "name": "Tunisia",
318
+ "population": 11154400
319
+ },
320
+ {
321
+ "id": "UG",
322
+ "name": "Uganda",
323
+ "population": 39570125
324
+ },
325
+ {
326
+ "id": "EH",
327
+ "name": "Western Sahara",
328
+ "population": 510713
329
+ },
330
+ {
331
+ "id": "ZM",
332
+ "name": "Zambia",
333
+ "population": 15933883
334
+ },
335
+ {
336
+ "id": "ZW",
337
+ "name": "Zimbabwe",
338
+ "population": 14240168
339
+ }
340
+ ]
341
+ },
342
+ {
343
+ "name": "Asia",
344
+ "children": [
345
+ {
346
+ "id": "AF",
347
+ "name": "Afghanistan",
348
+ "population": 27657145
349
+ },
350
+ {
351
+ "id": "AM",
352
+ "name": "Armenia",
353
+ "population": 2994400
354
+ },
355
+ {
356
+ "id": "AZ",
357
+ "name": "Azerbaijan",
358
+ "population": 9730500
359
+ },
360
+ {
361
+ "id": "BH",
362
+ "name": "Bahrain",
363
+ "population": 1404900
364
+ },
365
+ {
366
+ "id": "BD",
367
+ "name": "Bangladesh",
368
+ "population": 161006790
369
+ },
370
+ {
371
+ "id": "BT",
372
+ "name": "Bhutan",
373
+ "population": 775620
374
+ },
375
+ {
376
+ "id": "BN",
377
+ "name": "Brunei",
378
+ "population": 408786
379
+ },
380
+ {
381
+ "id": "KH",
382
+ "name": "Cambodia",
383
+ "population": 15626444
384
+ },
385
+ {
386
+ "id": "CN",
387
+ "name": "China",
388
+ "population": 1373540000
389
+ },
390
+ {
391
+ "id": "GE",
392
+ "name": "Georgia",
393
+ "population": 3720400
394
+ },
395
+ {
396
+ "id": "IN",
397
+ "name": "India",
398
+ "population": 1324171354
399
+ },
400
+ {
401
+ "id": "ID",
402
+ "name": "Indonesia",
403
+ "population": 261115456
404
+ },
405
+ {
406
+ "id": "IR",
407
+ "name": "Iran",
408
+ "population": 79369900
409
+ },
410
+ {
411
+ "id": "IQ",
412
+ "name": "Iraq",
413
+ "population": 37883543
414
+ },
415
+ {
416
+ "id": "IL",
417
+ "name": "Israel",
418
+ "population": 8547100
419
+ },
420
+ {
421
+ "id": "JP",
422
+ "name": "Japan",
423
+ "population": 126672000
424
+ },
425
+ {
426
+ "id": "JO",
427
+ "name": "Jordan",
428
+ "population": 9531712
429
+ },
430
+ {
431
+ "id": "KZ",
432
+ "name": "Kazakhstan",
433
+ "population": 17753200
434
+ },
435
+ {
436
+ "id": "KW",
437
+ "name": "Kuwait",
438
+ "population": 4137309
439
+ },
440
+ {
441
+ "id": "KG",
442
+ "name": "Kyrgyzstan",
443
+ "population": 6045117
444
+ },
445
+ {
446
+ "id": "LA",
447
+ "name": "Laos",
448
+ "population": 6492400
449
+ },
450
+ {
451
+ "id": "LB",
452
+ "name": "Lebanon",
453
+ "population": 6006668
454
+ },
455
+ {
456
+ "id": "MY",
457
+ "name": "Malaysia",
458
+ "population": 31187265
459
+ },
460
+ {
461
+ "id": "MV",
462
+ "name": "Maldives",
463
+ "population": 427756
464
+ },
465
+ {
466
+ "id": "MN",
467
+ "name": "Mongolia",
468
+ "population": 3086918
469
+ },
470
+ {
471
+ "id": "MM",
472
+ "name": "Myanmar",
473
+ "population": 51419420
474
+ },
475
+ {
476
+ "id": "NP",
477
+ "name": "Nepal",
478
+ "population": 28431500
479
+ },
480
+ {
481
+ "id": "KP",
482
+ "name": "North Korea",
483
+ "population": 25000000
484
+ },
485
+ {
486
+ "id": "OM",
487
+ "name": "Oman",
488
+ "population": 4420133
489
+ },
490
+ {
491
+ "id": "PK",
492
+ "name": "Pakistan",
493
+ "population": 193203476
494
+ },
495
+ {
496
+ "id": "PH",
497
+ "name": "Philippines",
498
+ "population": 103320222
499
+ },
500
+ {
501
+ "id": "QA",
502
+ "name": "Qatar",
503
+ "population": 2587564
504
+ },
505
+ {
506
+ "id": "RU",
507
+ "name": "Russia",
508
+ "population": 146599183
509
+ },
510
+ {
511
+ "id": "SA",
512
+ "name": "Saudi Arabia",
513
+ "population": 32248200
514
+ },
515
+ {
516
+ "id": "SG",
517
+ "name": "Singapore",
518
+ "population": 5607000
519
+ },
520
+ {
521
+ "id": "KR",
522
+ "name": "South Korea",
523
+ "population": 50982212
524
+ },
525
+ {
526
+ "id": "LK",
527
+ "name": "Sri Lanka",
528
+ "population": 20950000
529
+ },
530
+ {
531
+ "id": "SY",
532
+ "name": "Syria",
533
+ "population": 18564000
534
+ },
535
+ {
536
+ "id": "TW",
537
+ "name": "Taiwan",
538
+ "population": 23503349
539
+ },
540
+ {
541
+ "id": "TJ",
542
+ "name": "Tajikistan",
543
+ "population": 8593600
544
+ },
545
+ {
546
+ "id": "TH",
547
+ "name": "Thailand",
548
+ "population": 65327652
549
+ },
550
+ {
551
+ "id": "TR",
552
+ "name": "Turkey",
553
+ "population": 78741053
554
+ },
555
+ {
556
+ "id": "TM",
557
+ "name": "Turkmenistan",
558
+ "population": 4751120
559
+ },
560
+ {
561
+ "id": "AE",
562
+ "name": "United Arab Emirates",
563
+ "population": 9856000
564
+ },
565
+ {
566
+ "id": "UZ",
567
+ "name": "Uzbekistan",
568
+ "population": 31910641
569
+ },
570
+ {
571
+ "id": "VN",
572
+ "name": "Vietnam",
573
+ "population": 92700000
574
+ },
575
+ {
576
+ "id": "YE",
577
+ "name": "Yemen",
578
+ "population": 27478000
579
+ }
580
+ ]
581
+ },
582
+ {
583
+ "name": "Europe",
584
+ "children": [
585
+ {
586
+ "id": "AL",
587
+ "name": "Albania",
588
+ "population": 2876591
589
+ },
590
+ {
591
+ "id": "AD",
592
+ "name": "Andorra",
593
+ "population": 78014
594
+ },
595
+ {
596
+ "id": "AT",
597
+ "name": "Austria",
598
+ "population": 8735453
599
+ },
600
+ {
601
+ "id": "BY",
602
+ "name": "Belarus",
603
+ "population": 9500000
604
+ },
605
+ {
606
+ "id": "BE",
607
+ "name": "Belgium",
608
+ "population": 11319511
609
+ },
610
+ {
611
+ "id": "BA",
612
+ "name": "Bosnia and Herzegovina",
613
+ "population": 3531159
614
+ },
615
+ {
616
+ "id": "BG",
617
+ "name": "Bulgaria",
618
+ "population": 7153784
619
+ },
620
+ {
621
+ "id": "HR",
622
+ "name": "Croatia",
623
+ "population": 4190669
624
+ },
625
+ {
626
+ "id": "CY",
627
+ "name": "Cyprus",
628
+ "population": 847000
629
+ },
630
+ {
631
+ "id": "CZ",
632
+ "name": "Czech Republic",
633
+ "population": 10558524
634
+ },
635
+ {
636
+ "id": "DK",
637
+ "name": "Denmark",
638
+ "population": 5717014
639
+ },
640
+ {
641
+ "id": "EE",
642
+ "name": "Estonia",
643
+ "population": 1315819
644
+ },
645
+ {
646
+ "id": "FO",
647
+ "name": "Faroe Islands",
648
+ "population": 49188
649
+ },
650
+ {
651
+ "id": "FI",
652
+ "name": "Finland",
653
+ "population": 5491817
654
+ },
655
+ {
656
+ "id": "FR",
657
+ "name": "France",
658
+ "population": 66710000
659
+ },
660
+ {
661
+ "id": "DE",
662
+ "name": "Germany",
663
+ "population": 82667685
664
+ },
665
+ {
666
+ "id": "GI",
667
+ "name": "Gibraltar",
668
+ "population": 33140
669
+ },
670
+ {
671
+ "id": "GR",
672
+ "name": "Greece",
673
+ "population": 10858018
674
+ },
675
+ {
676
+ "id": "GG",
677
+ "name": "Guernsey",
678
+ "population": 62999
679
+ },
680
+ {
681
+ "id": "HU",
682
+ "name": "Hungary",
683
+ "population": 9823000
684
+ },
685
+ {
686
+ "id": "IS",
687
+ "name": "Iceland",
688
+ "population": 334300
689
+ },
690
+ {
691
+ "id": "IE",
692
+ "name": "Ireland",
693
+ "population": 6378000
694
+ },
695
+ {
696
+ "id": "IM",
697
+ "name": "Isle of Man",
698
+ "population": 84497
699
+ },
700
+ {
701
+ "id": "IT",
702
+ "name": "Italy",
703
+ "population": 60665551
704
+ },
705
+ {
706
+ "id": "JE",
707
+ "name": "Jersey",
708
+ "population": 100800
709
+ },
710
+ {
711
+ "id": "LV",
712
+ "name": "Latvia",
713
+ "population": 1961600
714
+ },
715
+ {
716
+ "id": "LI",
717
+ "name": "Liechtenstein",
718
+ "population": 37623
719
+ },
720
+ {
721
+ "id": "LT",
722
+ "name": "Lithuania",
723
+ "population": 2932367
724
+ },
725
+ {
726
+ "id": "LU",
727
+ "name": "Luxembourg",
728
+ "population": 576200
729
+ },
730
+ {
731
+ "id": "MK",
732
+ "name": "Macedonia",
733
+ "population": 2058539
734
+ },
735
+ {
736
+ "id": "MT",
737
+ "name": "Malta",
738
+ "population": 429344
739
+ },
740
+ {
741
+ "id": "MD",
742
+ "name": "Moldova",
743
+ "population": 3553100
744
+ },
745
+ {
746
+ "id": "MC",
747
+ "name": "Monaco",
748
+ "population": 38400
749
+ },
750
+ {
751
+ "id": "ME",
752
+ "name": "Montenegro",
753
+ "population": 621810
754
+ },
755
+ {
756
+ "id": "NL",
757
+ "name": "Netherlands",
758
+ "population": 17019800
759
+ },
760
+ {
761
+ "id": "NO",
762
+ "name": "Norway",
763
+ "population": 5223256
764
+ },
765
+ {
766
+ "id": "PL",
767
+ "name": "Poland",
768
+ "population": 38437239
769
+ },
770
+ {
771
+ "id": "PT",
772
+ "name": "Portugal",
773
+ "population": 10374822
774
+ },
775
+ {
776
+ "id": "RO",
777
+ "name": "Romania",
778
+ "population": 19861408
779
+ },
780
+ {
781
+ "id": "RU",
782
+ "name": "Russia",
783
+ "population": 146599183
784
+ },
785
+ {
786
+ "id": "SM",
787
+ "name": "San Marino",
788
+ "population": 33005
789
+ },
790
+ {
791
+ "id": "RS",
792
+ "name": "Serbia",
793
+ "population": 7076372
794
+ },
795
+ {
796
+ "id": "SK",
797
+ "name": "Slovakia",
798
+ "population": 5426252
799
+ },
800
+ {
801
+ "id": "SI",
802
+ "name": "Slovenia",
803
+ "population": 2064188
804
+ },
805
+ {
806
+ "id": "ES",
807
+ "name": "Spain",
808
+ "population": 46438422
809
+ },
810
+ {
811
+ "id": "SJ",
812
+ "name": "Svalbard and Jan Mayen",
813
+ "population": 3200
814
+ },
815
+ {
816
+ "id": "SE",
817
+ "name": "Sweden",
818
+ "population": 9851017
819
+ },
820
+ {
821
+ "id": "CH",
822
+ "name": "Switzerland",
823
+ "population": 8372098
824
+ },
825
+ {
826
+ "id": "UA",
827
+ "name": "Ukraine",
828
+ "population": 42692393
829
+ },
830
+ {
831
+ "id": "GB",
832
+ "name": "United Kingdom",
833
+ "population": 65110000
834
+ },
835
+ {
836
+ "id": "VA",
837
+ "name": "Vatican City",
838
+ "population": 451
839
+ }
840
+ ]
841
+ },
842
+ {
843
+ "name": "North America",
844
+ "children": [
845
+ {
846
+ "id": "AI",
847
+ "name": "Anguilla",
848
+ "population": 13452
849
+ },
850
+ {
851
+ "id": "AG",
852
+ "name": "Antigua and Barbuda",
853
+ "population": 86295
854
+ },
855
+ {
856
+ "id": "BS",
857
+ "name": "Bahamas",
858
+ "population": 378040
859
+ },
860
+ {
861
+ "id": "BB",
862
+ "name": "Barbados",
863
+ "population": 285000
864
+ },
865
+ {
866
+ "id": "BZ",
867
+ "name": "Belize",
868
+ "population": 360346
869
+ },
870
+ {
871
+ "id": "BM",
872
+ "name": "Bermuda",
873
+ "population": 61954
874
+ },
875
+ {
876
+ "id": "CA",
877
+ "name": "Canada",
878
+ "population": 36155487
879
+ },
880
+ {
881
+ "id": "KY",
882
+ "name": "Cayman Islands",
883
+ "population": 58238
884
+ },
885
+ {
886
+ "id": "CR",
887
+ "name": "Costa Rica",
888
+ "population": 4999441
889
+ },
890
+ {
891
+ "id": "CU",
892
+ "name": "Cuba",
893
+ "population": 11239004
894
+ },
895
+ {
896
+ "id": "DM",
897
+ "name": "Dominica",
898
+ "population": 71293
899
+ },
900
+ {
901
+ "id": "DO",
902
+ "name": "Dominican Republic",
903
+ "population": 10075045
904
+ },
905
+ {
906
+ "id": "SV",
907
+ "name": "El Salvador",
908
+ "population": 6520675
909
+ },
910
+ {
911
+ "id": "GL",
912
+ "name": "Greenland",
913
+ "population": 55877
914
+ },
915
+ {
916
+ "id": "GD",
917
+ "name": "Grenada",
918
+ "population": 103328
919
+ },
920
+ {
921
+ "id": "GT",
922
+ "name": "Guatemala",
923
+ "population": 16176133
924
+ },
925
+ {
926
+ "id": "HT",
927
+ "name": "Haiti",
928
+ "population": 11078033
929
+ },
930
+ {
931
+ "id": "HN",
932
+ "name": "Honduras",
933
+ "population": 8576532
934
+ },
935
+ {
936
+ "id": "JM",
937
+ "name": "Jamaica",
938
+ "population": 2723246
939
+ },
940
+ {
941
+ "id": "MX",
942
+ "name": "Mexico",
943
+ "population": 122273473
944
+ },
945
+ {
946
+ "id": "MS",
947
+ "name": "Montserrat",
948
+ "population": 4922
949
+ },
950
+ {
951
+ "id": "NI",
952
+ "name": "Nicaragua",
953
+ "population": 6262703
954
+ },
955
+ {
956
+ "id": "PA",
957
+ "name": "Panama",
958
+ "population": 3814672
959
+ },
960
+ {
961
+ "id": "PR",
962
+ "name": "Puerto Rico",
963
+ "population": 3474182
964
+ },
965
+ {
966
+ "id": "KN",
967
+ "name": "Saint Kitts and Nevis",
968
+ "population": 46204
969
+ },
970
+ {
971
+ "id": "LC",
972
+ "name": "Saint Lucia",
973
+ "population": 186000
974
+ },
975
+ {
976
+ "id": "PM",
977
+ "name": "Saint Pierre and Miquelon",
978
+ "population": 6069
979
+ },
980
+ {
981
+ "id": "VC",
982
+ "name": "Saint Vincent and the Grenadines",
983
+ "population": 109991
984
+ },
985
+ {
986
+ "id": "TT",
987
+ "name": "Trinidad and Tobago",
988
+ "population": 1228691
989
+ },
990
+ {
991
+ "id": "TC",
992
+ "name": "Turks and Caicos Islands",
993
+ "population": 31458
994
+ },
995
+ {
996
+ "id": "US",
997
+ "name": "United States",
998
+ "population": 326766748
999
+ },
1000
+ {
1001
+ "id": "VI",
1002
+ "name": "U.S. Virgin Islands",
1003
+ "population": 106235
1004
+ }
1005
+ ]
1006
+ },
1007
+ {
1008
+ "name": "South America",
1009
+ "children": [
1010
+ {
1011
+ "id": "AR",
1012
+ "name": "Argentina",
1013
+ "population": 43847430
1014
+ },
1015
+ {
1016
+ "id": "BO",
1017
+ "name": "Bolivia",
1018
+ "population": 11051600
1019
+ },
1020
+ {
1021
+ "id": "BR",
1022
+ "name": "Brazil",
1023
+ "population": 209288278
1024
+ },
1025
+ {
1026
+ "id": "CL",
1027
+ "name": "Chile",
1028
+ "population": 18191900
1029
+ },
1030
+ {
1031
+ "id": "CO",
1032
+ "name": "Colombia",
1033
+ "population": 49065615
1034
+ },
1035
+ {
1036
+ "id": "EC",
1037
+ "name": "Ecuador",
1038
+ "population": 16624858
1039
+ },
1040
+ {
1041
+ "id": "FK",
1042
+ "name": "Falkland Islands",
1043
+ "population": 2563
1044
+ },
1045
+ {
1046
+ "id": "GF",
1047
+ "name": "French Guiana",
1048
+ "population": 269352
1049
+ },
1050
+ {
1051
+ "id": "GY",
1052
+ "name": "Guyana",
1053
+ "population": 777859
1054
+ },
1055
+ {
1056
+ "id": "PY",
1057
+ "name": "Paraguay",
1058
+ "population": 6811297
1059
+ },
1060
+ {
1061
+ "id": "PE",
1062
+ "name": "Peru",
1063
+ "population": 32165485
1064
+ },
1065
+ {
1066
+ "id": "SR",
1067
+ "name": "Suriname",
1068
+ "population": 542975
1069
+ },
1070
+ {
1071
+ "id": "UY",
1072
+ "name": "Uruguay",
1073
+ "population": 3456750
1074
+ },
1075
+ {
1076
+ "id": "VE",
1077
+ "name": "Venezuela",
1078
+ "population": 31977065
1079
+ }
1080
+ ]
1081
+ },
1082
+ {
1083
+ "name": "Oceania",
1084
+ "children": [
1085
+ {
1086
+ "id": "AS",
1087
+ "name": "American Samoa",
1088
+ "population": 55641
1089
+ },
1090
+ {
1091
+ "id": "AU",
1092
+ "name": "Australia",
1093
+ "population": 24450561
1094
+ },
1095
+ {
1096
+ "id": "CK",
1097
+ "name": "Cook Islands",
1098
+ "population": 17380
1099
+ },
1100
+ {
1101
+ "id": "FJ",
1102
+ "name": "Fiji",
1103
+ "population": 905502
1104
+ },
1105
+ {
1106
+ "id": "PF",
1107
+ "name": "French Polynesia",
1108
+ "population": 271800
1109
+ },
1110
+ {
1111
+ "id": "GU",
1112
+ "name": "Guam",
1113
+ "population": 168564
1114
+ },
1115
+ {
1116
+ "id": "KI",
1117
+ "name": "Kiribati",
1118
+ "population": 113400
1119
+ },
1120
+ {
1121
+ "id": "MH",
1122
+ "name": "Marshall Islands",
1123
+ "population": 53127
1124
+ },
1125
+ {
1126
+ "id": "FM",
1127
+ "name": "Micronesia",
1128
+ "population": 105544
1129
+ },
1130
+ {
1131
+ "id": "NR",
1132
+ "name": "Nauru",
1133
+ "population": 10084
1134
+ },
1135
+ {
1136
+ "id": "NC",
1137
+ "name": "New Caledonia",
1138
+ "population": 268767
1139
+ },
1140
+ {
1141
+ "id": "NZ",
1142
+ "name": "New Zealand",
1143
+ "population": 4693200
1144
+ },
1145
+ {
1146
+ "id": "NU",
1147
+ "name": "Niue",
1148
+ "population": 1618
1149
+ },
1150
+ {
1151
+ "id": "NF",
1152
+ "name": "Norfolk Island",
1153
+ "population": 2302
1154
+ },
1155
+ {
1156
+ "id": "MP",
1157
+ "name": "Northern Mariana Islands",
1158
+ "population": 56940
1159
+ },
1160
+ {
1161
+ "id": "PW",
1162
+ "name": "Palau",
1163
+ "population": 21729
1164
+ },
1165
+ {
1166
+ "id": "PG",
1167
+ "name": "Papua New Guinea",
1168
+ "population": 8251162
1169
+ },
1170
+ {
1171
+ "id": "PN",
1172
+ "name": "Pitcairn Islands",
1173
+ "population": 56
1174
+ },
1175
+ {
1176
+ "id": "WS",
1177
+ "name": "Samoa",
1178
+ "population": 196440
1179
+ },
1180
+ {
1181
+ "id": "SB",
1182
+ "name": "Solomon Islands",
1183
+ "population": 611343
1184
+ },
1185
+ {
1186
+ "id": "TK",
1187
+ "name": "Tokelau",
1188
+ "population": 1411
1189
+ },
1190
+ {
1191
+ "id": "TO",
1192
+ "name": "Tonga",
1193
+ "population": 108020
1194
+ },
1195
+ {
1196
+ "id": "TV",
1197
+ "name": "Tuvalu",
1198
+ "population": 11323
1199
+ },
1200
+ {
1201
+ "id": "VU",
1202
+ "name": "Vanuatu",
1203
+ "population": 276244
1204
+ },
1205
+ {
1206
+ "id": "WF",
1207
+ "name": "Wallis and Futuna",
1208
+ "population": 11750
1209
+ }
1210
+ ]
1211
+ }
1212
+ ]
1213
+ }
1214
+
1215
+ // Group small countries into Others
1216
+ am5.array.each(data.children, (continent) => {
1217
+ var others = {
1218
+ name: "Others",
1219
+ id: "Others",
1220
+ population: 0
1221
+ };
1222
+
1223
+ for (var i = continent.children.length - 1; i >= 0; i--) {
1224
+ var country = continent.children[i];
1225
+ if (country.population < 5000000) {
1226
+ others.population += country.population
1227
+ am5.array.remove(continent.children, country);
1228
+ }
1229
+ }
1230
+ continent.children.push(others);
1231
+ });
1232
+
1233
+
1234
+ // Create series
1235
+ // https://www.amcharts.com/docs/v5/charts/hierarchy/#Adding
1236
+ var series = root.container.children.push(am5hierarchy.VoronoiTreemap.new(root, {
1237
+ paddingLeft: 5,
1238
+ paddingRight: 5,
1239
+ paddingTop: 5,
1240
+ paddingBottom: 5,
1241
+ singleBranchOnly: true,
1242
+ downDepth: 2,
1243
+ upDepth: 0,
1244
+ initialDepth: 2,
1245
+ valueField: "population",
1246
+ categoryField: "name",
1247
+ childDataField: "children",
1248
+ idField: "name",
1249
+ type: "polygon",
1250
+ cornerCount: 120
1251
+ }));
1252
+
1253
+ // Show full name if polygon is big and only the id if its small
1254
+ series.labels.template.adapters.add("x", (x, target) => {
1255
+ var dataItem = target.dataItem ;
1256
+ if (dataItem) {
1257
+ var polygon = dataItem.get("polygon");
1258
+ if (polygon) {
1259
+ var minX = polygon.getPrivate("minX", 0);
1260
+ var maxX = polygon.getPrivate("maxX", 0);
1261
+ var dataContext = dataItem.dataContext ;
1262
+
1263
+ if (dataContext) {
1264
+ if (maxX - minX < 50) {
1265
+ target.set("text", dataContext.id);
1266
+ }
1267
+ else {
1268
+ target.set("text", dataContext.name);
1269
+ }
1270
+ }
1271
+ }
1272
+ }
1273
+ return x;
1274
+ });
1275
+
1276
+ // WQhen last level node is clicked, zoom to parent
1277
+ series.nodes.template.events.on("click", (e) => {
1278
+ var dataItem = e.target.dataItem ;
1279
+ if (dataItem) {
1280
+ if (!dataItem.get("children")) {
1281
+ series.selectDataItem(dataItem.get("parent"));
1282
+ }
1283
+ }
1284
+ });
1285
+
1286
+
1287
+ // Set data
1288
+ // https://www.amcharts.com/docs/v5/charts/hierarchy/#Setting_data
1289
+ series.data.setAll([data]);
1290
+
1291
+
1292
+ // Select root node
1293
+ // https://www.amcharts.com/docs/v5/charts/hierarchy/#Pre_selected_branch
1294
+ series.set("selectedDataItem", series.dataItems[0]);
1295
+
1296
+
1297
+ // Make stuff animate on load
1298
+ series.appear(1000, 100);