问题
I need to draw a sankey-diagram in my laravel project. And the data consist of some rows on which from and to nodes are same. An example data is given bellow.
var data = [
{from: "A", to: "A", weight: 12},
{from: "A", to: "X", weight: 10},
{from: "A", to: "Y", weight: 15},
{from: "A", to: "Z", weight: 20},
{from: "B", to: "X", weight: 15},
{from: "B", to: "Y", weight: 5},
{from: "B", to: "Z", weight: 8}
];
Tried Google chart, but it didn't work. they also mentioned in the documentation that
Note: Avoid cycles in your data: if A links to itself, or links to B which links to C which links to A, your chart will not render.
So How can I draw a sankey chart withcycles in my data ?(A->A, B->B... )
来源:https://stackoverflow.com/questions/60036602/how-to-draw-a-sankey-diagram-with-a-connection-a-a