aleung
10/13/2017 - 6:42 AM

Sankey demo

const svg = d3.select("#chart").append("svg")
    .attr("width", 1000)
    .attr("height", 800)
  .append("g")
    .attr("transform", 
          "translate(10, 10)");
<!DOCTYPE html>
<meta charset="utf-8">
<title>SANKEY Demo</title>
<style>

.node rect {
  cursor: move;
  fill-opacity: .9;
  shape-rendering: crispEdges;
}

.node text {
  pointer-events: none;
  text-shadow: 0 1px 0 #fff;
}

.link {
  fill: none;
  stroke: #000;
  stroke-opacity: .2;
}

.link:hover {
  stroke-opacity: .5;
}

</style>
<body>

<div id="chart"></div>

<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="sankey.js"></script>

</body>
</html>