This is mostly based on Scape Toad a GPL-licensed Cartogram Generator written in Java.
Serves carthagogram on localhost:8000 and opens it in a browser.
The algorithm is based on Gastner et al. paper "Diffusion-based method for producing density-equalizing maps".
Carthagogram tries to improve on the following:
- web-based: accessible to everyone in an easy way
- SVG files as input
- area value editor
Uses Web Workers to perform calculation in background. Calculation takes about 3-5 minutes in Chrome.
Note: The (over)use of the module pattern in the code might make it memory intensive because functions are not reused for the same object types.
Currently only SVGs where no path has holes are known to work. Berlin is an example of that. SVGs with paths that have holes go crazy.
The index.html represents an example interface. Due to ajax svg loading it works only when executed on a webserver (like localhost), not via file:///.
build.sh uses sprocketize to insert the separate js modules into one web worker. Web worker have an own dependency API that could be used. build.sh also uses closure compiler to make the code smaller and faster.
The included image of Cato is from wikimedia and in the public domain.