I want to sort my nodes in Sankey chart. How can I do that? For example, for the following data:
const data0 = {
nodes: [
{ name: "L0" },
{ name: "L1" },
{ name: "L2" },
{ name: "L3" },
{ name: "L4" },
{ name: "R5" },
{ name: "R6" },
{ name: "R7" },
{ name: "R8" },
{ name: "R9" }
],
links: [
{ source: 0, target: 5, value: 30 },
{ source: 1, target: 8, value: 99 },
{ source: 1, target: 7, value: 20 },
{ source: 1, target: 6, value: 15 },
{ source: 4, target: 5, value: 6 },
{ source: 2, target: 8, value: 30 },
{ source: 0, target: 6, value: 15 },
{ source: 2, target: 9, value: 11 },
{ source: 3, target: 9, value: 8 },
{ source: 3, target: 8, value: 23 },
{ source: 2, target: 5, value: 20 }
]
};
For this data, the Sankey chart will be as follows:
But I want to sort the nods on each side. I want nodes to be on each side in this way:
How can I do that?