2

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: enter image description here But I want to sort the nods on each side. I want nodes to be on each side in this way: enter image description here How can I do that?

Vahid Boreiri
  • 3,418
  • 1
  • 19
  • 34

0 Answers0