Creating interactive circular migration plots for the web using D3.
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 data/flows.csv <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
Licensed under the MIT license.