Sankey diagram in javascript
问题 I want to draw a Sankey diagram using Javascript. Can anyone provide some direction regarding the algorithms or libraries that are available for this? 回答1: This is a basic Sankey diagram using raphaeljs function Sankey(x0, y0, height, losses) { var initialcolor = Raphael.getColor(); var start = x0 + 200; var level = y0 + height; var heightunit = height / 100; var remaining = 100 * heightunit; function drawloss(start, level, loss) { var thecolor = Raphael.getColor(); paper.path("M" + (start -