country_infos = d3
.tsv(
'https://gist.githubusercontent.com/JiHanran/' +
'2d0a236854216359d1d550809c8e5bdb/raw/' +
'440fb9b96b42a0cd612c22f0ca205e3f04b70e74/country.tsv',
d3.autoType
)
.then(d =>
aq
.from(d)
.derive({
总人口: d => op.trunc(d.总人口 * 1000),
大洲: d => {
const trimed = op.trim(d.DZ01);
return op.includes(['NULL', 'null', '中东'], trimed) ? null : trimed;
}
})
.derive({
continent: d =>
op.recode(d.大洲, {
欧洲: 'Europe',
非洲: 'Africa',
亚洲: 'Asia',
南美洲: 'South America',
北美洲: 'North America',
大洋洲: 'Oceania'
}),
continent: d =>
op.recode(d.大洲, {
欧洲: 'Europe',
非洲: 'Africa',
亚洲: 'Asia',
南美洲: 'South America',
北美洲: 'North America',
大洋洲: 'Oceania'
}),
})
.select(
{ 'Country-hpjs':'Country_hpjs'},
{ GJ: '国家' },
'总人口',
{'DZ_WHO_full':'WHOen'},
{ 'DZ-WHO-cha': 'WHO分区' },
'周边14中国',
'Country Code',
{ 'DZ-WHO': 'WHO' },
'大洲',
'continent',
'人均GDP'
)
)