A visualization of world population data from 2015 to 2100 using D3.js.
Have a look!
Here is a video that introduces this project in details.(Link to Youtube)
Select the Data Type
In the data type selector (middle bottom of the map), you can select the data type you want from Population, Median Age, Total Dependency Ratio and Old Age Dependency Ratio.
Select Country
By clicking any country in the map or selecting in the country selector (right bottom of the map) , the age pyramid and the bar chart below will change according to your selection.
Select Year
By drag the bottom year bar or clicking the bars in the bar chart, you can select the year you want and the map will change according to your selection.
Total dependency ratio is a measure showing the number of dependents, aged 0 to 14 and over the age of 65, to the total population aged 15 to 64. This indicator gives insight into the amount of people of nonworking age compared to the number of those of working age.
Old-age dependency ratio is aged over the age of 65, to the total population aged 15 to 64.
The data is from United Nations: World Population Prospects 2017.
Static Map
At first, I made a world map with 2050 Dependency Ratio data of each country. You can find it here.
Selectable Year and Country
Since this prototype only shows one year (2050) of Dependency Ratio data, I want to start a project that allows user to select the year to see the change of data in different years. I think a range input <input type="range">
would be a perfect choice for this year selector. Then I think clicking a country in the map to select a country is pretty good idea.
Selectable Data
After accomplishing selectable year and country, what about showing more kinds of data. Then I add a data selector which enables users to select diferent kinds of data, and the map will be in different colors. I use Python to pre-process the data instead of processing multiple CSV files using D3.
This project uses NPM and Webpack. To get started, clone the repository and install dependencies like this:
cd WorldPopulationData
npm install
You'll need to build the JavaScript bundle using WebPack, using this command:
npm run build
To see the page run, you'll need to serve the site using a local HTTP server.
npm install -g http-server
http-server
Now the site should be available at localhost:8080.
For automatic refreshing during development, you can start the Webpack Dev Server like this:
npm run serve
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。