diff --git a/__tests__/data/countries.json b/__tests__/data/countries.json new file mode 100644 index 0000000000..186de4072c --- /dev/null +++ b/__tests__/data/countries.json @@ -0,0 +1,1718 @@ +[ + { + "iso3": "ARE", + "change in female rate": -0.7, + "change in male rate": 3.3000000000000043, + "female_2000": 1.9, + "male_2000": 34.3, + "female_2015": 1.2, + "male_2015": 37.6, + "income": "High income", + "pop": 9269612, + "EN": "United Arab Emirates", + "DE": "Vereinigte Arabische Emirate", + "FR": "Émirats arabes unis", + "IT": "Emirati Arabi Uniti", + "ES": "Emiratos Árabes Unidos", + "PT": "Emirados Árabes Unidos", + "RU": "Объединенные Арабские Эмираты", + "ZH": "阿拉伯联合酋长国", + "JA": "アラブ首長国連邦", + "AR": "الإمارات العربية المتحدة", + "continent": "Asia" + }, + { + "iso3": "ARG", + "change in female rate": -20.2, + "change in male rate": -16.8, + "female_2000": 36.4, + "male_2000": 45.1, + "female_2015": 16.2, + "male_2015": 28.3, + "income": "Upper middle income", + "pop": 43847430, + "EN": "Argentina", + "DE": "Argentinien", + "FR": "Argentine", + "IT": "Argentina", + "ES": "Argentina", + "PT": "Argentina", + "RU": "Аргентина", + "ZH": "阿根廷", + "JA": "アルゼンチン", + "AR": "الأرجنتين", + "continent": "Americas" + }, + { + "iso3": "AUS", + "change in female rate": -8.899999999999999, + "change in male rate": -10.100000000000001, + "female_2000": 21.7, + "male_2000": 26.6, + "female_2015": 12.8, + "male_2015": 16.5, + "income": "High income", + "pop": 24210809, + "EN": "Australia", + "DE": "Australien", + "FR": "Australie", + "IT": "Australia", + "ES": "Australia", + "PT": "Austrália", + "RU": "Австралия", + "ZH": "澳大利亚", + "JA": "オーストラリア", + "AR": "أستراليا", + "continent": "Oceania" + }, + { + "iso3": "AUT", + "change in female rate": -14.400000000000002, + "change in male rate": -23.499999999999996, + "female_2000": 39.7, + "male_2000": 53.8, + "female_2015": 25.3, + "male_2015": 30.3, + "income": "High income", + "pop": 8731471, + "EN": "Austria", + "DE": "Österreich", + "FR": "Autriche", + "IT": "Austria", + "ES": "Austria", + "PT": "Áustria", + "RU": "Австрия", + "ZH": "奥地利", + "JA": "オーストリア", + "AR": "النمسا", + "continent": "Europe" + }, + { + "iso3": "AZE", + "change in female rate": -0.3, + "change in male rate": -11.200000000000003, + "female_2000": 0.6, + "male_2000": 54.5, + "female_2015": 0.3, + "male_2015": 43.3, + "income": "Upper middle income", + "pop": 9757812, + "EN": "Azerbaijan", + "DE": "Aserbaidschan", + "FR": "Azerbaédjan", + "IT": "Azerbaigian", + "ES": "Azerbaiyán", + "PT": "Azerbaijão", + "RU": "Азербайджан", + "ZH": "阿塞拜疆", + "JA": "アゼルバイジャン", + "AR": "آذربيجان", + "continent": "Asia" + }, + { + "iso3": "BEL", + "change in female rate": -5.399999999999999, + "change in male rate": -12.600000000000001, + "female_2000": 28.4, + "male_2000": 43.1, + "female_2015": 23, + "male_2015": 30.5, + "income": "High income", + "pop": 11338476, + "EN": "Belgium", + "DE": "Belgien", + "FR": "Belgique", + "IT": "Belgio", + "ES": "Bélgica", + "PT": "Bélgica", + "RU": "Бельгия", + "ZH": "比利时", + "JA": "ベルギー", + "AR": "بلجيكا", + "continent": "Europe" + }, + { + "iso3": "BEN", + "change in female rate": -1.4, + "change in male rate": -3.5, + "female_2000": 2, + "male_2000": 15.1, + "female_2015": 0.6, + "male_2015": 11.6, + "income": "Low income", + "pop": 10872298, + "EN": "Benin", + "DE": "Benin", + "FR": "Bénin", + "IT": "Benin", + "ES": "Benín", + "PT": "Benin", + "RU": "Бенин", + "ZH": "贝宁", + "JA": "ベニン", + "AR": "بنين", + "continent": "Africa" + }, + { + "iso3": "BFA", + "change in female rate": -5.800000000000001, + "change in male rate": -2.900000000000002, + "female_2000": 7.4, + "male_2000": 27.3, + "female_2015": 1.6, + "male_2015": 24.4, + "income": "Low income", + "pop": 18646433, + "EN": "Burkina Faso", + "DE": "Burkina Faso", + "FR": "Burkina Faso", + "IT": "Burkina Faso", + "ES": "Burkina Faso", + "PT": "Burkina Faso", + "RU": "Буркина-Фасо", + "ZH": "布基纳法索", + "JA": "ブルキナファソ", + "AR": "بوركينا فاسو", + "continent": "Africa" + }, + { + "iso3": "BGD", + "change in female rate": -4.1, + "change in male rate": -9.200000000000003, + "female_2000": 5.1, + "male_2000": 53.6, + "female_2015": 1, + "male_2015": 44.4, + "income": "Lower middle income", + "pop": 162951560, + "EN": "Bangladesh", + "DE": "Bangladesch", + "FR": "Bangladesh", + "IT": "Bangladesh", + "ES": "Bangladés", + "PT": "Bangladesh", + "RU": "Бангладеш", + "ZH": "孟加拉", + "JA": "バングラデシュ", + "AR": "بنغلاديش", + "continent": "Asia" + }, + { + "iso3": "BLR", + "change in female rate": -2.8000000000000007, + "change in male rate": -17.099999999999994, + "female_2000": 12, + "male_2000": 64.6, + "female_2015": 9.2, + "male_2015": 47.5, + "income": "Upper middle income", + "pop": 9501534, + "EN": "Belarus", + "DE": "Weissrussland", + "FR": "Bélarus", + "IT": "Bielorussia", + "ES": "Belarús", + "PT": "Bielorrússia", + "RU": "Беларусь", + "ZH": "白俄罗斯", + "JA": "ベラルーシ", + "AR": "روسيا البيضاء", + "continent": "Europe" + }, + { + "iso3": "BRA", + "change in female rate": -9.200000000000001, + "change in male rate": -11.399999999999999, + "female_2000": 19.8, + "male_2000": 29.9, + "female_2015": 10.6, + "male_2015": 18.5, + "income": "Upper middle income", + "pop": 207652865, + "EN": "Brazil", + "DE": "Brasilien", + "FR": "Brésil", + "IT": "Brasile", + "ES": "Brasil", + "PT": "Brasil", + "RU": "Бразилия", + "ZH": "巴西", + "JA": "ブラジル", + "AR": "البرازيل", + "continent": "Americas" + }, + { + "iso3": "CAN", + "change in female rate": -13.7, + "change in male rate": -12.899999999999999, + "female_2000": 25.7, + "male_2000": 29.7, + "female_2015": 12, + "male_2015": 16.8, + "income": "High income", + "pop": 36264604, + "EN": "Canada", + "DE": "Kanada", + "FR": "Canada", + "IT": "Canada", + "ES": "Canadá", + "PT": "Canadá", + "RU": "Канада", + "ZH": "加拿大", + "JA": "カナダ", + "AR": "كندا", + "continent": "Americas" + }, + { + "iso3": "CHE", + "change in female rate": -2.8999999999999986, + "change in male rate": -8.5, + "female_2000": 23.5, + "male_2000": 36.5, + "female_2015": 20.6, + "male_2015": 28, + "income": "High income", + "pop": 8372413, + "EN": "Switzerland", + "DE": "Schweiz", + "FR": "Suisse", + "IT": "Svizzera", + "ES": "Suiza", + "PT": "Suíça", + "RU": "Швейцария", + "ZH": "瑞士", + "JA": "スイス", + "AR": "سويسرا", + "continent": "Europe" + }, + { + "iso3": "CHL", + "change in female rate": -20.800000000000004, + "change in male rate": -18.800000000000004, + "female_2000": 54.1, + "male_2000": 60.6, + "female_2015": 33.3, + "male_2015": 41.8, + "income": "High income", + "pop": 17909754, + "EN": "Chile", + "DE": "Chile", + "FR": "Chili", + "IT": "Cile", + "ES": "Chile", + "PT": "Chile", + "RU": "Чили", + "ZH": "智利", + "JA": "チリ", + "AR": "تشيلي", + "continent": "Americas" + }, + { + "iso3": "CHN", + "change in female rate": -0.6999999999999997, + "change in male rate": -5.899999999999999, + "female_2000": 2.9, + "male_2000": 56.5, + "female_2015": 2.2, + "male_2015": 50.6, + "income": "Upper middle income", + "pop": 1378665000, + "EN": "China", + "DE": "China", + "FR": "Chine", + "IT": "Cina", + "ES": "China", + "PT": "China", + "RU": "Китай", + "ZH": "中国", + "JA": "中国", + "AR": "الصين", + "continent": "Asia" + }, + { + "iso3": "COL", + "change in female rate": -7.800000000000001, + "change in male rate": -12.6, + "female_2000": 12.8, + "male_2000": 26.7, + "female_2015": 5, + "male_2015": 14.1, + "income": "Upper middle income", + "pop": 48653419, + "EN": "Colombia", + "DE": "Kolumbien", + "FR": "Colombie", + "IT": "Colombia", + "ES": "Colombia", + "PT": "Colômbia", + "RU": "Колумбия", + "ZH": "哥伦比亚", + "JA": "コロンビア", + "AR": "كولومبيا", + "continent": "Americas" + }, + { + "iso3": "CUB", + "change in female rate": -15, + "change in male rate": -2.6999999999999957, + "female_2000": 33.6, + "male_2000": 58.8, + "female_2015": 18.6, + "male_2015": 56.1, + "income": "Upper middle income", + "pop": 11475982, + "EN": "Cuba", + "DE": "Kuba", + "FR": "Cuba", + "IT": "Cuba", + "ES": "Cuba", + "PT": "Cuba", + "RU": "Куба", + "ZH": "古巴", + "JA": "キューバ", + "AR": "كوبا", + "continent": "Americas" + }, + { + "iso3": "CZE", + "change in female rate": 0.1999999999999993, + "change in male rate": -2.8000000000000043, + "female_2000": 26.8, + "male_2000": 39.7, + "female_2015": 27, + "male_2015": 36.9, + "income": "High income", + "pop": 10566332, + "EN": "Czech Republic", + "DE": "Tschechische Republik", + "FR": "République tchèque", + "IT": "Repubblica Ceca", + "ES": "República Checa", + "PT": "República Tcheca", + "RU": "Чешская Республика", + "ZH": "捷克共和国", + "JA": "チェコ", + "AR": "تشيكيا", + "continent": "Europe" + }, + { + "iso3": "DEU", + "change in female rate": -3.400000000000002, + "change in male rate": -8.299999999999997, + "female_2000": 27.1, + "male_2000": 38.8, + "female_2015": 23.7, + "male_2015": 30.5, + "income": "High income", + "pop": 82487842, + "EN": "Germany", + "DE": "Deutschland", + "FR": "Allemagne", + "IT": "Germania", + "ES": "Alemania", + "PT": "Alemanha", + "RU": "Германия", + "ZH": "德国", + "JA": "ドイツ", + "AR": "ألمانيا", + "continent": "Europe" + }, + { + "iso3": "DOM", + "change in female rate": -5.199999999999999, + "change in male rate": -1.6999999999999993, + "female_2000": 13.6, + "male_2000": 19.9, + "female_2015": 8.4, + "male_2015": 18.2, + "income": "Upper middle income", + "pop": 10648791, + "EN": "Dominican Republic", + "DE": "Dominikanische Republik", + "FR": "Dominicaine république", + "IT": "Repubblica dominicana", + "ES": "República Dominicana", + "PT": "República Dominicana", + "RU": "Доминиканская Республика", + "ZH": "多明尼加", + "JA": "ドミニカ共和国", + "AR": "جمهورية الدومينيكان", + "continent": "Americas" + }, + { + "iso3": "DZA", + "change in female rate": -4.8, + "change in male rate": 2.799999999999997, + "female_2000": 5.6, + "male_2000": 27.6, + "female_2015": 0.8, + "male_2015": 30.4, + "income": "Upper middle income", + "pop": 40606052, + "EN": "Algeria", + "DE": "Algerien", + "FR": "Algérie", + "IT": "Algeria", + "ES": "Argelia", + "PT": "Argélia", + "RU": "Алжир", + "ZH": "阿尔及利亚", + "JA": "アルジェリア", + "AR": "الجزائر", + "continent": "Africa" + }, + { + "iso3": "ECU", + "change in female rate": -3.4999999999999996, + "change in male rate": -8.899999999999999, + "female_2000": 5.6, + "male_2000": 21.4, + "female_2015": 2.1, + "male_2015": 12.5, + "income": "Upper middle income", + "pop": 16385068, + "EN": "Ecuador", + "DE": "Ecuador", + "FR": "Équateur", + "IT": "Ecuador", + "ES": "Ecuador", + "PT": "Equador", + "RU": "Эквадор", + "ZH": "厄瓜多尔", + "JA": "エクアドル", + "AR": "الاكوادور", + "continent": "Americas" + }, + { + "iso3": "EGY", + "change in female rate": -1.5, + "change in male rate": 16.200000000000003, + "female_2000": 1.7, + "male_2000": 31.9, + "female_2015": 0.2, + "male_2015": 48.1, + "income": "Lower middle income", + "pop": 95688681, + "EN": "Egypt", + "DE": "Ägypten", + "FR": "Égypte", + "IT": "Egitto", + "ES": "Egipto", + "PT": "Egito", + "RU": "Египет", + "ZH": "埃及", + "JA": "エジプト", + "AR": "مصر", + "continent": "Africa" + }, + { + "iso3": "ESP", + "change in female rate": -5.699999999999999, + "change in male rate": -15.599999999999998, + "female_2000": 28.3, + "male_2000": 45.9, + "female_2015": 22.6, + "male_2015": 30.3, + "income": "High income", + "pop": 46484533, + "EN": "Spain", + "DE": "Spanien", + "FR": "Espagne", + "IT": "Spagna", + "ES": "España", + "PT": "Espanha", + "RU": "Испания", + "ZH": "西班牙", + "JA": "スペイン", + "AR": "إسبانيا", + "continent": "Europe" + }, + { + "iso3": "ETH", + "change in female rate": -0.3, + "change in male rate": -0.7000000000000011, + "female_2000": 0.6, + "male_2000": 8.3, + "female_2015": 0.3, + "male_2015": 7.6, + "income": "Low income", + "pop": 102403196, + "EN": "Ethiopia", + "DE": "Äthiopien", + "FR": "Éthiopie", + "IT": "Etiopia", + "ES": "Etiopía", + "PT": "Etiópia", + "RU": "Эфиопия", + "ZH": "埃塞俄比亚", + "JA": "エチオピア", + "AR": "أثيوبيا", + "continent": "Africa" + }, + { + "iso3": "FRA", + "change in female rate": -1.9000000000000021, + "change in male rate": -5.5, + "female_2000": 26.8, + "male_2000": 38, + "female_2015": 24.9, + "male_2015": 32.5, + "income": "High income", + "pop": 66892205, + "EN": "France", + "DE": "Frankreich", + "FR": "France", + "IT": "Francia", + "ES": "Francia", + "PT": "França", + "RU": "Франция", + "ZH": "法国", + "JA": "フランス", + "AR": "فرنسا", + "continent": "Europe" + }, + { + "iso3": "GBR", + "change in female rate": -15.900000000000002, + "change in male rate": -13.3, + "female_2000": 35.1, + "male_2000": 37.5, + "female_2015": 19.2, + "male_2015": 24.2, + "income": "High income", + "pop": 65595565, + "EN": "United Kingdom", + "DE": "Vereinigtes Königreich", + "FR": "Royaume-Uni", + "IT": "Regno Unito", + "ES": "Reino Unido", + "PT": "Reino Unido", + "RU": "Британия", + "ZH": "英国", + "JA": "英国", + "AR": "المملكة المتحدة", + "continent": "Europe" + }, + { + "iso3": "GHA", + "change in female rate": -0.5, + "change in male rate": -2.5, + "female_2000": 0.8, + "male_2000": 9.6, + "female_2015": 0.3, + "male_2015": 7.1, + "income": "Lower middle income", + "pop": 28206728, + "EN": "Ghana", + "DE": "Ghana", + "FR": "Ghana", + "IT": "Ghana", + "ES": "Ghana", + "PT": "Gana", + "RU": "Гана", + "ZH": "加纳", + "JA": "ガーナ", + "AR": "غانا", + "continent": "Africa" + }, + { + "iso3": "GRC", + "change in female rate": -10.799999999999997, + "change in male rate": -9.100000000000001, + "female_2000": 43.4, + "male_2000": 60.4, + "female_2015": 32.6, + "male_2015": 51.3, + "income": "High income", + "pop": 10770521, + "EN": "Greece", + "DE": "Griechenland", + "FR": "Grèce", + "IT": "Grecia", + "ES": "Grecia", + "PT": "Grécia", + "RU": "Греция", + "ZH": "希腊", + "JA": "ギリシャ", + "AR": "اليونان", + "continent": "Europe" + }, + { + "iso3": "HND", + "change in female rate": -1.6999999999999997, + "change in male rate": null, + "female_2000": 3.8, + "male_2000": null, + "female_2015": 2.1, + "male_2015": null, + "income": "Lower middle income", + "pop": 9112867, + "EN": "Honduras", + "DE": "Honduras", + "FR": "Honduras", + "IT": "Honduras", + "ES": "Honduras", + "PT": "Honduras", + "RU": "Гондурас", + "ZH": "洪都拉斯", + "JA": "ホンジュラス", + "AR": "هندوراس", + "continent": "Americas" + }, + { + "iso3": "HTI", + "change in female rate": -2.4, + "change in male rate": 3.6999999999999993, + "female_2000": 5.3, + "male_2000": 17.8, + "female_2015": 2.9, + "male_2015": 21.5, + "income": "Low income", + "pop": 10847334, + "EN": "Haiti", + "DE": "Haiti", + "FR": "Haiti", + "IT": "Haiti", + "ES": "Haití", + "PT": "Haiti", + "RU": "Гаити", + "ZH": "海地", + "JA": "ハイチ", + "AR": "هايتي", + "continent": "Americas" + }, + { + "iso3": "HUN", + "change in female rate": -8.700000000000003, + "change in male rate": -12.100000000000001, + "female_2000": 32.2, + "male_2000": 46, + "female_2015": 23.5, + "male_2015": 33.9, + "income": "High income", + "pop": 9814023, + "EN": "Hungary", + "DE": "Ungarn", + "FR": "Hongrie", + "IT": "Ungheria", + "ES": "Hungría", + "PT": "Hungria", + "RU": "Венгрия", + "ZH": "匈牙利", + "JA": "ハンガリー", + "AR": "هنغاريا", + "continent": "Europe" + }, + { + "iso3": "IDN", + "change in female rate": -2, + "change in male rate": 15.500000000000007, + "female_2000": 4.7, + "male_2000": 59.4, + "female_2015": 2.7, + "male_2015": 74.9, + "income": "Lower middle income", + "pop": 261115456, + "EN": "Indonesia", + "DE": "Indonesien", + "FR": "Indonésie", + "IT": "Indonesia", + "ES": "Indonesia", + "PT": "Indonésia", + "RU": "Индонезия", + "ZH": "印度尼西亚", + "JA": "インドネシア", + "AR": "أندونيسيا", + "continent": "Asia" + }, + { + "iso3": "IND", + "change in female rate": -3.8, + "change in male rate": -11.699999999999996, + "female_2000": 5.6, + "male_2000": 32.3, + "female_2015": 1.8, + "male_2015": 20.6, + "income": "Lower middle income", + "pop": 1324171354, + "EN": "India", + "DE": "Indien", + "FR": "Inde", + "IT": "India", + "ES": "India", + "PT": "Índia", + "RU": "Индия", + "ZH": "印度", + "JA": "インド", + "AR": "الهند", + "continent": "Asia" + }, + { + "iso3": "IRN", + "change in female rate": -3.3, + "change in male rate": -5.300000000000001, + "female_2000": 4.1, + "male_2000": 26.5, + "female_2015": 0.8, + "male_2015": 21.2, + "income": "Upper middle income", + "pop": 80277428, + "EN": "Islamic Republic of Iran", + "DE": "Islamischen Republik Iran", + "FR": "République Islamique d'Iran", + "IT": "Iran", + "ES": "Irán", + "PT": "Irã", + "RU": "Иран, Исламская Республика", + "ZH": "伊朗", + "JA": "イラン", + "AR": "إيران", + "continent": "Asia" + }, + { + "iso3": "ISR", + "change in female rate": -8.6, + "change in male rate": -4.799999999999997, + "female_2000": 24, + "male_2000": 39.9, + "female_2015": 15.4, + "male_2015": 35.1, + "income": "High income", + "pop": 8546000, + "EN": "Israel", + "DE": "Israel", + "FR": "Israël", + "IT": "Israele", + "ES": "Israel", + "PT": "Israel", + "RU": "Израиль", + "ZH": "以色列", + "JA": "イスラエル", + "AR": "إسرائيل", + "continent": "Asia" + }, + { + "iso3": "ITA", + "change in female rate": -1.2999999999999972, + "change in male rate": -5.899999999999999, + "female_2000": 18.9, + "male_2000": 32.8, + "female_2015": 17.6, + "male_2015": 26.9, + "income": "High income", + "pop": 60627498, + "EN": "Italy", + "DE": "Italien", + "FR": "Italie", + "IT": "Italia", + "ES": "Italia", + "PT": "Itália", + "RU": "Италия", + "ZH": "意大利", + "JA": "イタリア", + "AR": "إيطاليا", + "continent": "Europe" + }, + { + "iso3": "JPN", + "change in female rate": -3.6999999999999993, + "change in male rate": -18.599999999999994, + "female_2000": 13, + "male_2000": 51.3, + "female_2015": 9.3, + "male_2015": 32.7, + "income": "High income", + "pop": 126994511, + "EN": "Japan", + "DE": "Japan", + "FR": "Japon", + "IT": "Giappone", + "ES": "Japón", + "PT": "Japão", + "RU": "Япония", + "ZH": "日本", + "JA": "日本", + "AR": "اليابان", + "continent": "Asia" + }, + { + "iso3": "KAZ", + "change in female rate": -3.3999999999999995, + "change in male rate": -11.299999999999997, + "female_2000": 10.6, + "male_2000": 55.8, + "female_2015": 7.2, + "male_2015": 44.5, + "income": "Upper middle income", + "pop": 17794397, + "EN": "Kazakhstan", + "DE": "Kasachstan", + "FR": "Kazakhstan", + "IT": "Kazakistan", + "ES": "Kazajistán", + "PT": "Cazaquistão", + "RU": "Казахстан", + "ZH": "哈萨克斯坦", + "JA": "カザフスタン", + "AR": "كازاخستان", + "continent": "Asia" + }, + { + "iso3": "KEN", + "change in female rate": -1.2999999999999998, + "change in male rate": -8.2, + "female_2000": 2.4, + "male_2000": 27.8, + "female_2015": 1.1, + "male_2015": 19.6, + "income": "Lower middle income", + "pop": 48461567, + "EN": "Kenya", + "DE": "Kenia", + "FR": "Kenya", + "IT": "Kenya", + "ES": "Kenia", + "PT": "Quênia", + "RU": "Кения", + "ZH": "肯尼亚", + "JA": "ケニア", + "AR": "كينيا", + "continent": "Africa" + }, + { + "iso3": "KHM", + "change in female rate": -4, + "change in male rate": -15, + "female_2000": 5.9, + "male_2000": 43.9, + "female_2015": 1.9, + "male_2015": 28.9, + "income": "Lower middle income", + "pop": 15762370, + "EN": "Cambodia", + "DE": "Kambodscha", + "FR": "Cambodge", + "IT": "Cambogia", + "ES": "Camboya", + "PT": "Camboja", + "RU": "Камбоджа", + "ZH": "柬埔寨", + "JA": "カンボジア", + "AR": "كمبوديا", + "continent": "Asia" + }, + { + "iso3": "KOR", + "change in female rate": -0.8999999999999995, + "change in male rate": -22.400000000000006, + "female_2000": 6.8, + "male_2000": 63.7, + "female_2015": 5.9, + "male_2015": 41.3, + "income": "High income", + "pop": 51245707, + "EN": "Republic of Korea", + "DE": "Republik Korea", + "FR": "République de Corée", + "IT": "Corea del Sud", + "ES": "República de Corea", + "PT": "República da Coreia", + "RU": "Республика Корея", + "ZH": "韩国", + "JA": "大韓民国", + "AR": "كوريا", + "continent": "Asia" + }, + { + "iso3": "LKA", + "change in female rate": -1.3, + "change in male rate": -2.599999999999998, + "female_2000": 1.6, + "male_2000": 30.7, + "female_2015": 0.3, + "male_2015": 28.1, + "income": "Lower middle income", + "pop": 21203000, + "EN": "Sri Lanka", + "DE": "Sri Lanka", + "FR": "Sri Lanka", + "IT": "Sri Lanka", + "ES": "Sri Lanka", + "PT": "Sri Lanka", + "RU": "Шри-Ланка", + "ZH": "斯里兰卡", + "JA": "スリランカ", + "AR": "سيريلانكا", + "continent": "Asia" + }, + { + "iso3": "MAR", + "change in female rate": -4, + "change in male rate": 12.300000000000004, + "female_2000": 4.9, + "male_2000": 34.3, + "female_2015": 0.9, + "male_2015": 46.6, + "income": "Lower middle income", + "pop": 35276786, + "EN": "Morocco", + "DE": "Marokko", + "FR": "Maroc", + "IT": "Marocco", + "ES": "Marruecos", + "PT": "Marrocos", + "RU": "Марокко", + "ZH": "摩洛哥", + "JA": "モロッコ", + "AR": "المغرب", + "continent": "Africa" + }, + { + "iso3": "MEX", + "change in female rate": -5.499999999999999, + "change in male rate": -14.100000000000001, + "female_2000": 12.7, + "male_2000": 36.5, + "female_2015": 7.2, + "male_2015": 22.4, + "income": "Upper middle income", + "pop": 127540423, + "EN": "Mexico", + "DE": "Mexiko", + "FR": "Mexique", + "IT": "Messico", + "ES": "México", + "PT": "México", + "RU": "Мексика", + "ZH": "墨西哥", + "JA": "メキシコ", + "AR": "المكسيك", + "continent": "Americas" + }, + { + "iso3": "MLI", + "change in female rate": -2.4, + "change in male rate": 1.0999999999999979, + "female_2000": 4, + "male_2000": 22.1, + "female_2015": 1.6, + "male_2015": 23.2, + "income": "Low income", + "pop": 17994837, + "EN": "Mali", + "DE": "Mali", + "FR": "Mali", + "IT": "Mali", + "ES": "Malí", + "PT": "Mali", + "RU": "Мали", + "ZH": "马里", + "JA": "マリ", + "AR": "مالي", + "continent": "Africa" + }, + { + "iso3": "MMR", + "change in female rate": -7, + "change in male rate": -14.399999999999999, + "female_2000": 13.5, + "male_2000": 50.1, + "female_2015": 6.5, + "male_2015": 35.7, + "income": "Lower middle income", + "pop": 52885223, + "EN": "Myanmar", + "DE": "Myanmar", + "FR": "Myanmar", + "IT": "Myanmar", + "ES": "Myanmar", + "PT": "Myanmar", + "RU": "Мьянма", + "ZH": "缅甸", + "JA": "ミャンマー", + "AR": "ميانمار", + "continent": "Asia" + }, + { + "iso3": "MOZ", + "change in female rate": -3.5, + "change in male rate": -10.2, + "female_2000": 8.4, + "male_2000": 38, + "female_2015": 4.9, + "male_2015": 27.8, + "income": "Low income", + "pop": 28829476, + "EN": "Mozambique", + "DE": "Mosambik", + "FR": "Mozambique", + "IT": "Mozambico", + "ES": "Mozambique", + "PT": "Moçambique", + "RU": "Мозамбик", + "ZH": "莫桑比克", + "JA": "モザンビーク", + "AR": "موزمبيق", + "continent": "Africa" + }, + { + "iso3": "MWI", + "change in female rate": -4, + "change in male rate": -7.300000000000001, + "female_2000": 7.8, + "male_2000": 28.5, + "female_2015": 3.8, + "male_2015": 21.2, + "income": "Low income", + "pop": 18091575, + "EN": "Malawi", + "DE": "Malawi", + "FR": "Malawi", + "IT": "Malawi", + "ES": "Malaui", + "PT": "Malavi", + "RU": "Малави", + "ZH": "马拉维", + "JA": "マラウィ", + "AR": "ملاوي", + "continent": "Africa" + }, + { + "iso3": "MYS", + "change in female rate": -1.6, + "change in male rate": -10.399999999999999, + "female_2000": 2.6, + "male_2000": 54, + "female_2015": 1, + "male_2015": 43.6, + "income": "Upper middle income", + "pop": 31187265, + "EN": "Malaysia", + "DE": "Malaysia", + "FR": "Malaisie", + "IT": "Malesia", + "ES": "Malasia", + "PT": "Malásia", + "RU": "Малайзия", + "ZH": "马来西亚", + "JA": "マレーシア", + "AR": "ماليزيا", + "continent": "Asia" + }, + { + "iso3": "NER", + "change in female rate": -0.30000000000000004, + "change in male rate": 2.5, + "female_2000": 0.4, + "male_2000": 13, + "female_2015": 0.1, + "male_2015": 15.5, + "income": "Low income", + "pop": 20672987, + "EN": "Niger", + "DE": "Niger", + "FR": "Niger", + "IT": "Niger", + "ES": "Níger", + "PT": "Níger", + "RU": "Нигер", + "ZH": "尼日尔", + "JA": "ニジェール", + "AR": "النيجر", + "continent": "Africa" + }, + { + "iso3": "NGA", + "change in female rate": -1.6, + "change in male rate": -2.1000000000000014, + "female_2000": 2.2, + "male_2000": 12.8, + "female_2015": 0.6, + "male_2015": 10.7, + "income": "Lower middle income", + "pop": 185989640, + "EN": "Nigeria", + "DE": "Nigeria", + "FR": "Nigéria", + "IT": "Nigeria", + "ES": "Nigeria", + "PT": "Nigéria", + "RU": "Нигерия", + "ZH": "尼日利亚", + "JA": "ナイジェリア", + "AR": "نيجيريا", + "continent": "Africa" + }, + { + "iso3": "NLD", + "change in female rate": -9.600000000000001, + "change in male rate": -14.400000000000002, + "female_2000": 33.1, + "male_2000": 41.7, + "female_2015": 23.5, + "male_2015": 27.3, + "income": "High income", + "pop": 17030314, + "EN": "Netherlands", + "DE": "Niederlande", + "FR": "Pays-Bas", + "IT": "Paesi Bassi", + "ES": "Países Bajos", + "PT": "Holanda", + "RU": "Нидерланды", + "ZH": "荷兰", + "JA": "オランダ", + "AR": "هولندا", + "continent": "Europe" + }, + { + "iso3": "NPL", + "change in female rate": -19.2, + "change in male rate": -5.299999999999997, + "female_2000": 28.4, + "male_2000": 40.8, + "female_2015": 9.2, + "male_2015": 35.5, + "income": "Low income", + "pop": 28982771, + "EN": "Nepal", + "DE": "Nepal", + "FR": "Népal", + "IT": "Nepal", + "ES": "Nepal", + "PT": "Nepal", + "RU": "Непал", + "ZH": "尼泊尔", + "JA": "ネパール", + "AR": "نيبال", + "continent": "Asia" + }, + { + "iso3": "PAK", + "change in female rate": -5.3999999999999995, + "change in male rate": -1.7000000000000028, + "female_2000": 8.1, + "male_2000": 36.6, + "female_2015": 2.7, + "male_2015": 34.9, + "income": "Lower middle income", + "pop": 193203476, + "EN": "Pakistan", + "DE": "Pakistan", + "FR": "Pakistan", + "IT": "Pakistan", + "ES": "Pakistán", + "PT": "Paquistão", + "RU": "Пакистан", + "ZH": "巴基斯坦", + "JA": "パキスタン", + "AR": "باكستان", + "continent": "Asia" + }, + { + "iso3": "PER", + "change in female rate": -7, + "change in male rate": null, + "female_2000": 12, + "male_2000": null, + "female_2015": 5, + "male_2015": null, + "income": "Upper middle income", + "pop": 31773839, + "EN": "Peru", + "DE": "Peru", + "FR": "Pérou", + "IT": "Perù", + "ES": "Perú", + "PT": "Peru", + "RU": "Перу", + "ZH": "秘鲁", + "JA": "ペルー", + "AR": "بيرو", + "continent": "Americas" + }, + { + "iso3": "PHL", + "change in female rate": -2.9000000000000004, + "change in male rate": -15.399999999999999, + "female_2000": 10.3, + "male_2000": 57, + "female_2015": 7.4, + "male_2015": 41.6, + "income": "Lower middle income", + "pop": 103320222, + "EN": "Philippines", + "DE": "Philippinen", + "FR": "Philippines", + "IT": "Filippine", + "ES": "Filipinas", + "PT": "Filipinas", + "RU": "Филиппины", + "ZH": "菲律宾", + "JA": "フィリピン", + "AR": "الفلبين", + "continent": "Asia" + }, + { + "iso3": "POL", + "change in female rate": -12.3, + "change in male rate": -11.400000000000006, + "female_2000": 34.6, + "male_2000": 45.7, + "female_2015": 22.3, + "male_2015": 34.3, + "income": "High income", + "pop": 37970087, + "EN": "Poland", + "DE": "Polen", + "FR": "Pologne", + "IT": "Polonia", + "ES": "Polonia", + "PT": "Polônia", + "RU": "Польша", + "ZH": "波兰", + "JA": "ポーランド", + "AR": "بولندا", + "continent": "Europe" + }, + { + "iso3": "PRT", + "change in female rate": -0.3000000000000007, + "change in male rate": -8.399999999999999, + "female_2000": 13.4, + "male_2000": 35.8, + "female_2015": 13.1, + "male_2015": 27.4, + "income": "High income", + "pop": 10325452, + "EN": "Portugal", + "DE": "Portugal", + "FR": "Portugal", + "IT": "Portogallo", + "ES": "Portugal", + "PT": "Portugal", + "RU": "Португалия", + "ZH": "葡萄牙", + "JA": "ポルトガル", + "AR": "البرتغال", + "continent": "Europe" + }, + { + "iso3": "ROU", + "change in female rate": -5, + "change in male rate": -15.199999999999996, + "female_2000": 25.3, + "male_2000": 51.9, + "female_2015": 20.3, + "male_2015": 36.7, + "income": "Upper middle income", + "pop": 19699312, + "EN": "Romania", + "DE": "Rumänien", + "FR": "Roumanie", + "IT": "Romania", + "ES": "Rumania", + "PT": "Romênia", + "RU": "Румыния", + "ZH": "罗马尼亚", + "JA": "ルーマニア", + "AR": "رومانيا", + "continent": "Europe" + }, + { + "iso3": "RUS", + "change in female rate": 0.8000000000000007, + "change in male rate": -9.499999999999993, + "female_2000": 18.8, + "male_2000": 68.6, + "female_2015": 19.6, + "male_2015": 59.1, + "income": "Upper middle income", + "pop": 144342396, + "EN": "Russian Federation", + "DE": "Russische Föderation", + "FR": "Fédération de Russie", + "IT": "Russia", + "ES": "Rusia", + "PT": "Federação Russa", + "RU": "Российская Федерация", + "ZH": "俄罗斯", + "JA": "ロシア", + "AR": "روسيا", + "continent": "Europe" + }, + { + "iso3": "RWA", + "change in female rate": -2.2, + "change in male rate": -7.100000000000001, + "female_2000": 6.5, + "male_2000": 25.5, + "female_2015": 4.3, + "male_2015": 18.4, + "income": "Low income", + "pop": 11917508, + "EN": "Rwanda", + "DE": "Ruanda", + "FR": "Rwanda", + "IT": "Ruanda", + "ES": "Ruanda", + "PT": "Ruanda", + "RU": "Руанда", + "ZH": "卢旺达", + "JA": "ルワンダ", + "AR": "رواندا", + "continent": "Africa" + }, + { + "iso3": "SAU", + "change in female rate": -2.4000000000000004, + "change in male rate": 3.1999999999999993, + "female_2000": 4.2, + "male_2000": 22.6, + "female_2015": 1.8, + "male_2015": 25.8, + "income": "High income", + "pop": 32275687, + "EN": "Saudi Arabia", + "DE": "Saudi-Arabien", + "FR": "Arabie Saoudite", + "IT": "Arabia Saudita", + "ES": "Arabia Saudita", + "PT": "Arábia Saudita", + "RU": "Саудовская Аравия", + "ZH": "沙特阿拉伯", + "JA": "サウジアラビア", + "AR": "السعودية", + "continent": "Asia" + }, + { + "iso3": "SEN", + "change in female rate": -1.2000000000000002, + "change in male rate": -3.700000000000003, + "female_2000": 1.6, + "male_2000": 20.6, + "female_2015": 0.4, + "male_2015": 16.9, + "income": "Low income", + "pop": 15411614, + "EN": "Senegal", + "DE": "Senegal", + "FR": "Sénégal", + "IT": "Senegal", + "ES": "Senegal", + "PT": "Senegal", + "RU": "Сенегал", + "ZH": "塞内加尔", + "JA": "セネガル", + "AR": "السنغال", + "continent": "Africa" + }, + { + "iso3": "SWE", + "change in female rate": -12.8, + "change in male rate": -12.100000000000001, + "female_2000": 31.6, + "male_2000": 31.3, + "female_2015": 18.8, + "male_2015": 19.2, + "income": "High income", + "pop": 9923085, + "EN": "Sweden", + "DE": "Schweden", + "FR": "Suède", + "IT": "Svezia", + "ES": "Suecia", + "PT": "Suécia", + "RU": "Швеция", + "ZH": "瑞典", + "JA": "スウェーデン", + "AR": "السويد", + "continent": "Europe" + }, + { + "iso3": "THA", + "change in female rate": -0.5, + "change in male rate": -7.799999999999997, + "female_2000": 2.7, + "male_2000": 48.3, + "female_2015": 2.2, + "male_2015": 40.5, + "income": "Upper middle income", + "pop": 68863514, + "EN": "Thailand", + "DE": "Thailand", + "FR": "Thaïlande", + "IT": "Thailandia", + "ES": "Tailandia", + "PT": "Tailândia", + "RU": "Таиланд", + "ZH": "泰国", + "JA": "タイ", + "AR": "تايلاند", + "continent": "Asia" + }, + { + "iso3": "TUN", + "change in female rate": -5.8999999999999995, + "change in male rate": 8.299999999999997, + "female_2000": 7.1, + "male_2000": 57.3, + "female_2015": 1.2, + "male_2015": 65.6, + "income": "Lower middle income", + "pop": 11403248, + "EN": "Tunisia", + "DE": "Tunesien", + "FR": "Tunisie", + "IT": "Tunisia", + "ES": "Túnez", + "PT": "Tunísia", + "RU": "Тунис", + "ZH": "突尼斯", + "JA": "チュニジア", + "AR": "تونس", + "continent": "Africa" + }, + { + "iso3": "TUR", + "change in female rate": -5.200000000000001, + "change in male rate": -16.9, + "female_2000": 19.6, + "male_2000": 59.6, + "female_2015": 14.4, + "male_2015": 42.7, + "income": "Upper middle income", + "pop": 79512426, + "EN": "Turkey", + "DE": "Türkei", + "FR": "Turquie", + "IT": "Turchia", + "ES": "Turquía", + "PT": "Turquia", + "RU": "Турция", + "ZH": "土耳其", + "JA": "トルコ", + "AR": "البيرو", + "continent": "Asia" + }, + { + "iso3": "TZA", + "change in female rate": -2.1, + "change in male rate": -11.2, + "female_2000": 5.2, + "male_2000": 37.4, + "female_2015": 3.1, + "male_2015": 26.2, + "income": "Low income", + "pop": 55572201, + "EN": "United Republic of Tanzania", + "DE": "Tansania", + "FR": "Tanzanie", + "IT": "Tanzania", + "ES": "República Unida de Tanzanía", + "PT": "Tanzânia", + "RU": "Объединенная Республика Танзания", + "ZH": "坦桑尼亚", + "JA": "タンザニア", + "AR": "تنزانيا", + "continent": "Africa" + }, + { + "iso3": "UGA", + "change in female rate": -1.5000000000000004, + "change in male rate": -10.4, + "female_2000": 4.4, + "male_2000": 25.5, + "female_2015": 2.9, + "male_2015": 15.1, + "income": "Low income", + "pop": 41487965, + "EN": "Uganda", + "DE": "Uganda", + "FR": "Ouganda", + "IT": "Uganda", + "ES": "Uganda", + "PT": "Uganda", + "RU": "Уганда", + "ZH": "乌干达", + "JA": "ウガンダ", + "AR": "أوغندا", + "continent": "Africa" + }, + { + "iso3": "UKR", + "change in female rate": -1.8999999999999986, + "change in male rate": -12.100000000000001, + "female_2000": 12.7, + "male_2000": 60.4, + "female_2015": 10.8, + "male_2015": 48.3, + "income": "Lower middle income", + "pop": 45004645, + "EN": "Ukraine", + "DE": "Ukraine", + "FR": "Ukraine", + "IT": "Ucraina", + "ES": "Ucrania", + "PT": "Ucrânia", + "RU": "Украина", + "ZH": "乌克兰", + "JA": "ウクライナ", + "AR": "أوكرانيا", + "continent": "Europe" + }, + { + "iso3": "USA", + "change in female rate": -9, + "change in male rate": -9.800000000000004, + "female_2000": 27.6, + "male_2000": 34.2, + "female_2015": 18.6, + "male_2015": 24.4, + "income": "High income", + "pop": 323127513, + "EN": "United States", + "DE": "Vereinigte Staaten", + "FR": "États-Unis", + "IT": "Stati Uniti d'America", + "ES": "Estados Unidos", + "PT": "Estados Unidos", + "RU": "Соединенные Штаты Америки", + "ZH": "美国", + "JA": "米国", + "AR": "الولايات المتحدة", + "continent": "Americas" + }, + { + "iso3": "UZB", + "change in female rate": -0.19999999999999996, + "change in male rate": -5.099999999999998, + "female_2000": 1.5, + "male_2000": 29.2, + "female_2015": 1.3, + "male_2015": 24.1, + "income": "Lower middle income", + "pop": 31847900, + "EN": "Uzbekistan", + "DE": "Usbekistan", + "FR": "Ouzbékistan", + "IT": "Uzbekistan", + "ES": "Uzbekistán", + "PT": "Uzbequistão", + "RU": "Узбекистан", + "ZH": "乌兹别克斯坦", + "JA": "ウズベキスタン", + "AR": "أوزبكستان", + "continent": "Asia" + }, + { + "iso3": "VNM", + "change in female rate": -0.6000000000000001, + "change in male rate": -1.0999999999999943, + "female_2000": 1.6, + "male_2000": 48.3, + "female_2015": 1, + "male_2015": 47.2, + "income": "Lower middle income", + "pop": 94569072, + "EN": "Vietnam", + "DE": "Vietnam", + "FR": "Viet Nam", + "IT": "Vietnam", + "ES": "Vietnam", + "PT": "Vietnã", + "RU": "Вьетнам", + "ZH": "越南", + "JA": "ベトナム", + "AR": "فيتنام", + "continent": "Asia" + }, + { + "iso3": "YEM", + "change in female rate": -6.4, + "change in male rate": -2.299999999999997, + "female_2000": 13.8, + "male_2000": 29.9, + "female_2015": 7.4, + "male_2015": 27.6, + "income": "Lower middle income", + "pop": 27584213, + "EN": "Yemen", + "DE": "Jemen", + "FR": "Yémen", + "IT": "Yemen", + "ES": "Yemen", + "PT": "Iêmen", + "RU": "Йемен", + "ZH": "也门", + "JA": "イエメン", + "AR": "اليمن", + "continent": "Asia" + }, + { + "iso3": "ZAF", + "change in female rate": -2.5999999999999996, + "change in male rate": -1.8000000000000043, + "female_2000": 10.6, + "male_2000": 34.6, + "female_2015": 8, + "male_2015": 32.8, + "income": "Upper middle income", + "pop": 56015473, + "EN": "South Africa", + "DE": "Südafrika", + "FR": "Afrique du Sud", + "IT": "Sudafrica", + "ES": "Sudáfrica", + "PT": "África do Sul", + "RU": "Южная Африка", + "ZH": "南非", + "JA": "南アフリカ", + "AR": "جنوب أفريقيا", + "continent": "Africa" + }, + { + "iso3": "ZMB", + "change in female rate": -2.1999999999999997, + "change in male rate": -4.600000000000001, + "female_2000": 4.6, + "male_2000": 26.8, + "female_2015": 2.4, + "male_2015": 22.2, + "income": "Lower middle income", + "pop": 16591390, + "EN": "Zambia", + "DE": "Sambia", + "FR": "Zambie", + "IT": "Zambia", + "ES": "Zambia", + "PT": "Zâmbia", + "RU": "Замбия", + "ZH": "赞比亚", + "JA": "ザンビア", + "AR": "زامبيا", + "continent": "Africa" + }, + { + "iso3": "ZWE", + "change in female rate": -1.2000000000000002, + "change in male rate": -1.7999999999999972, + "female_2000": 2.6, + "male_2000": 29.4, + "female_2015": 1.4, + "male_2015": 27.6, + "income": "Low income", + "pop": 16150362, + "EN": "Zimbabwe", + "DE": "Zimbabwe", + "FR": "Zimbabwe", + "IT": "Zimbabwe", + "ES": "Zimbabue", + "PT": "Zimbábue", + "RU": "Зимбабве", + "ZH": "津巴布韦", + "JA": "ジンバブエ", + "AR": "زيمبابوي", + "continent": "Africa" + } +] diff --git a/__tests__/integration/snapshots/static/countriesBubbleLegendSize.png b/__tests__/integration/snapshots/static/countriesBubbleLegendSize.png new file mode 100644 index 0000000000..3c68491f19 Binary files /dev/null and b/__tests__/integration/snapshots/static/countriesBubbleLegendSize.png differ diff --git a/__tests__/plots/static/countries-bubble-legend-size.ts b/__tests__/plots/static/countries-bubble-legend-size.ts new file mode 100644 index 0000000000..622059a7c1 --- /dev/null +++ b/__tests__/plots/static/countries-bubble-legend-size.ts @@ -0,0 +1,27 @@ +import { G2Spec } from '../../../src'; + +export function countriesBubbleLegendSize(): G2Spec { + return { + type: 'point', + data: { + type: 'fetch', + value: 'data/countries.json', + }, + encode: { + x: 'change in female rate', + y: 'change in male rate', + size: 'pop', + color: 'continent', + shape: 'point', + }, + scale: { + color: { + range: ['#ffd500', '#82cab2', '#193442', '#d18768', '#7e827a'], + }, + x: { nice: true }, + y: { nice: true }, + size: { range: [4, 30] }, + }, + style: { stroke: '#bbb', fillOpacity: 0.8 }, + }; +} diff --git a/__tests__/plots/static/index.ts b/__tests__/plots/static/index.ts index c6ace57dd8..1652791673 100644 --- a/__tests__/plots/static/index.ts +++ b/__tests__/plots/static/index.ts @@ -270,3 +270,4 @@ export { alphabetIntervalAutoRotate } from './alphabet-interval-auto-padding-rot export { mockLineSmallInterval } from './mock-line-small-interval'; export { unemploymentAreaStackedLegendSize } from './unemployment-area-stacked-legend-size'; export { alphabetIntervalAutoPaddingSlider } from './alphabet-interval-auto-padding-slider'; +export { countriesBubbleLegendSize } from './countries-bubble-legend-size'; diff --git a/src/runtime/layout.ts b/src/runtime/layout.ts index 57d1f4c148..1a5d14065a 100644 --- a/src/runtime/layout.ts +++ b/src/runtime/layout.ts @@ -265,22 +265,29 @@ function computePadding( const defaultSizeOf = (d) => { if (d.size === undefined) d.size = d.defaultSize; }; + const sizeOf = (d) => { + if (d.type === 'group') { + d.children.forEach(defaultSizeOf); + d.size = max(d.children, (d) => (d as any).size); + } else { + d.size = d.defaultSize; + } + }; const autoSizeOf = (d) => { if (d.size) return; - if (value !== 'auto') { - d.size = d.defaultSize; - return; + if (value !== 'auto') sizeOf(d); + else { + // Compute component size dynamically. + computeComponentSize( + d, + crossSize, + crossPadding, + position, + theme, + library, + ); + defaultSizeOf(d); } - // Compute component size dynamically. - computeComponentSize( - d, - crossSize, - crossPadding, - position, - theme, - library, - ); - defaultSizeOf(d); }; // Specified padding.