Circular Migration Plot
Creating interactive circular migration plots for the web using D3.
Installation
Install globally with npm:
npm install circular-migration-plot -g
Usage
1. Filtration
You may want to filter countries with small migration flows:
cmp-filter data/countries.csv data/flows.csv
2. Compilation
Build the matrix json processible by the library out of the csv input file:
cmp-compile data/flows.csv
3. Integration
<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.
Lets get dirty
head -n30 data/flows.csv | cmp-filter data/countries.csv | cmp-compile > migration-flows.json
Development
Hint & Test
To run the unit tests:
npm test
For JShint:
npm run jshint
Build
The JavaScript is build using Browserify
and then compressed with UglifyJS:
npm run build
Packagued files land in dist
folder.
Server
A development server can be run with
npm start
License
Copyright (c) 2014 null2 GmbH Berlin
Licensed under the MIT license.