d3-simple-sankey
Reusable Sankey graph visualization using d3.js.
This is a very simple wrapper around http://bl.ocks.org/d3noob/5028304.
Deprecation
In d3 >=4.0, you should use mbostock own d3-sankey plugin here https://github.com/d3/d3-sankey.
Installation
You can install d3-simple-sankey using npm
:
npm install d3-simple-sankey
For Bower users, even if Bower is not officially supported, you can still use GitHub URL such as:
{
"dependencies": {
"eventDrops": "cerisier/d3-simpe-sankey#0.1.0"
}
}
Usage
Include the dist/d3.sankey.min.js
script in your page after d3:
In the HTML source, create a new Sankey chart, bind data to a DOM element, then call the chart on the element.
var chart = d3chart;d3 ;
See for the required data format.
Data example coming soon...
License
MIT