help for himap(Thomas Roca)

Create heatmaps using highmap's library

Syntax

himap [ varlist iso3 time_id]
using filename
[ , options ]

Description

himap creates heatmaps for the web, using java api developped by highcharts (see: http://www.highcharts.com/)

To be displayed, the webpage needs to find in its folder, 13 java scripts, these are provided locally, but are also available online:
1. "jquery-1.9.1.js" http://code.jquery.com/jquery-1.9.1.js
2. "highmaps.js" http://code.highcharts.com/maps/highmaps.js
3. "exporting.js" http://code.highcharts.com/maps/modules/exporting.js
4. "world-highres.js" http://code.highcharts.com/mapdata/custom/world-highres.js
5. "world-eckert3-highres.js" http://code.highcharts.com/mapdata/custom/world-eckert3-highres.js
6. "world-robinson-highres.js" http://code.highcharts.com/mapdata/custom/world-robinson-highres.js
7. "africa.js" http://code.highcharts.com/mapdata/custom/africa.js
8. "asia.js" http://code.highcharts.com/mapdata/custom/asia.js
9. "europ.js" http://code.highcharts.com/mapdata/custom/europe.js
10. "middle-east.js" http://code.highcharts.com/mapdata/custom/middle-east.js
11. "north-america.js" http://code.highcharts.com/mapdata/custom/north-ameria.js
12. "oceania.js" http://code.highcharts.com/mapdata/custom/oceania.js
13. "south-america" http://code.highcharts.com/mapdata/custom/south-america.js

The program will create a folder in the present working directory, containing:
1. The heatmap (HTML) and a copy of the java files needed included in "himap.zip"
2. A dataset under json format, that will feed the HTML file
All the content of "himap.zip" must be unzipped in the ado directory. The program will copy the java files from the ado directory.
The ado files comes with a folder name "himap_js", this folder must be located in your ado directory, in the same directory as himap.ado
NB. Do not copy himap.ado into himap folder, leave it at the root, e.g. C:\ado\plus\h
NB. This programme might not work correctly under unix or mac os. I'm currently working on it, thanks for your comprehension.

The variable to map must be numeric. A country identifier variable must exist in the dataset and contains country ISO 3166-1 alpha-3 codes.
For more information about iso 3166-1 aplpha-3 codes, see: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
3 types of earth projection are available: 'world': Natural earth (default option); 'eckert' : Eckart III ; 'robinson' : Robinson.
NB. Note that if the option 'zone' is specified, the option 'projection' will not be implemented even if specified.

options alternatives

time(integer) Time (j) of the variable to display ->[default: 2000]
width(integer) Width of the map, expressed in pixel ->[default: 1000]
height(integer) Height of the map, expressed in pixel ->[default: 600]
projection(string) Projection type: eckert ; robinson ; world ->[default: world:natural earth]
zone(integer) 0=World |1=Africa |2=Asia |3=Europe |4=Middle-east |5=North-America |6=Oceania |7=South-America ->[default: world:natural earth]
rgb1(string) Set color for minimum value in rgb color ->[default: no ]
rgb2(string) Set color for maximum value in rgb color ->[default: no ]

Examples

. himap gdp iso3 year using map.html, time(2013)

. himap gdp country_iso3 year using map.html, time(2005)

. himap gdp country_iso3 year using map.html, time(1990) width(800) height(500)

. himap gdp country_iso3 year using map.html, time(1960) projection(robinson)

. himap gdp country_iso3 year using map.html, time(2013) zone(1)

. himap gdp iso3 year using map.html, time(2012) projection(eckert) rgb1(255, 225, 104) rgb2(221, 147, 0)

Acknowledgements

Note that I'm not the developper of the java engine, I adapted it and integrated it into a stata command.
The primary code was developped by highchart under a Creative Commons Attribution-NonCommercial 3.0 License for non commercial use.
For more information see: http://shop.highsoft.com/faq
For more information on the underneath html and java code see: http://www.highcharts.com/maps/demo/tooltip

Author

Thomas Roca,PhD, Research department, Agence Française de Développement(AFD), France.
Email:rocat@afd.fr