<!doctype HTML>
<link rel='stylesheet' href='http://timelyportfolio.github.io/rCharts_d3_sankey/css/sankey.css'>
<script src='http://timelyportfolio.github.io/rCharts_d3_sankey/js/d3.v3.js' type='text/javascript'></script>
<script src='http://timelyportfolio.github.io/rCharts_d3_sankey/js/sankey.js' type='text/javascript'></script>
<style>
.rChart {
display: block;
margin-left: auto;
margin-right: auto;
width: 900px;
height: 900px;
}
</style>
<div id = 'chart474c48377576' class = 'rChart rCharts_d3_sankey'></div>
<!--Attribution:
Mike Bostock https://github.com/d3/d3-plugins/tree/master/sankey Mike Bostock http://bost.ocks.org/mike/sankey/ -->
<script>
var colors = {};
d3.selectAll(' svg .node')[0].forEach(function(n) {
type = n.getElementsByTagName('text')[0].innerHTML.replace(/[0-9]/g, '');
if (typeof(colors[type]) == 'undefined') {
colors[type] = n.getElementsByTagName('rect')[0].style.fill;
} else {
n.getElementsByTagName('rect')[0].style.fill = colors[type] ;
};
});
d3.selectAll('svg path.link')
.style('stroke', function(d){
return d.source.color;
})
//.style('stroke-opacity', .7)
</script>