kurkle / chartjs-chart-sankey

Chart.js module for creating sankey diagrams
MIT License
152 stars 29 forks source link

Column Override breaks Flow graph #81

Closed MauriceHartmann closed 7 months ago

MauriceHartmann commented 2 years ago

Adding column Overrides can potentially break a graph.

An example:

column: {
          Oil: 0,
          Oil1: 1,
          Air1: 1,
          Air2: 2,
          Stuff1: 1,
          Stuff2: 2
        },

With the following Dataset

data: [
          { from: "Oil", to: "Air1", flow: 15 },
          { from: "Oil", to: "Stuff1", flow: 20 },
          { from: "Oil1", to: "Air2", flow: 25 },
          { from: "Oil1", to: "Stuff2", flow: 25 `},]`

completly breaks the graph, as shown here:

Screenshot_20221105_212016

How I would expect it to look (without the crossed out flow):

Screenshot 2022-11-05 212304

{ from: "Oil", to: "Oil1", flow: 15 }, was added for screenshot above

A modified codepen example: https://codepen.io/mh2207/pen/WNyGxPX

And Thanks for your hard work!