Mall:Choropleth world map
[visa] [redigera] [rensa sidcachen]
Dokumentation
Draft version.
Usage
[redigera wikitext]This template creates an interactive world choropleth map, indicating some statistical value with different colors for different countries. A tooltip with country data is shown when the mouse is over a country.
Example
[redigera wikitext]{{Choropleth world map | title=Net official development assistance and official aid (ODA) received in 2019 |
---|
See or edit source data. |
{{Choropleth world map | title=CO2 Per Capita |
---|
See or edit source data. |
{{Choropleth world map | title=Share of the population infected with HIV |
---|
See or edit source data. |
Dataset format
[redigera wikitext]The dataset should be stored at Wikimedia commons, in the Data namespace, as a tabular data (.tab) file. Currently, the file format should be JSON, representing a three column table, where the first column is the three-letter ISO country code, the second is the year and the third is the value. In the future, CSV-files may be possible.
Steps:
- Download a .csv file, for example from https://ourworldindata.org
- Trim to three columns in a spreadsheet program
- Upload it at https://www.csvjson.com/csv2json . Select "parse numbers".
- Copy the json output and paste it into Notepad. Find and replace { with [, and "Country:" with nothing
- Paste this data below the heading data, at for example [:commons:Data:Child Mortality.tab]
Be aware of some minor bugs.
See also
[redigera wikitext]{{Graph:Map}}
{{Animerad världskarta}}
{{Choropleth world map}}