Creating interactive circular migration plots for the web using D3, like http://www.global-migration.info/ and http://www.german-migration.info/
Install globally with npm:
npm install circular-migration-plot -gYou may want to filter countries with small migration flows:
cmp-filter data/countries.csv data/flows.csvBuild the matrix json processible by the library out of the csv input file.
cmp-compile file [OPTIONS]
--regions,-r: Sort order for regions--pretty,-p: Pretty print result JSON
cmp-compile flows.csv
cmp-compile -
cat flows.csv | cmp-compile
cmp-compile flows.csv --regions North,West
cmp-compile flows.csv --regions North,West --pretty <script src="dist/circular-migration-plot.js"></script>
<div id=timeline></div>
<div id=chart></div>
<script>
CircularMigrationPlot({
data: 'json/sample.json',
chart: '#chart',
timeline: '#timeline'
});
</script>See index.html.
head -n30 data/flows.csv | cmp-filter data/countries.csv | cmp-compile > migration-flows.jsonTo run the unit tests:
npm testFor JShint:
npm run jshint
The JavaScript is build using Browserify and then compressed with UglifyJS:
npm run build
Packagued files land in dist folder.
A development server can be run with
npm start
Copyright (c) 2014 null2 GmbH Berlin
This work as well as the sample data is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.