Skip to content

comark/charts/flow-cycle

Keep a sankey's flows from looping back

A sankey runs one way, from its first column to its last, so a flow back into a node it came from has no column to land in, and the chart shows its table instead. Remove the flow that closes the loop, or split the node in two, such as what comes in and what goes out.

Incorrect

fromtoducks
northsouth12
southnorth4
::chart{type="sankey" title="Ducks between ponds"}
| from | to | ducks |
| --- | --- | --: |
| north | south | 12 |
| south | north | 4 |
::
md

Correct

Ducks between ponds
north (spring)south (summer)south (spring)north (summer)
Data
fromtoducks
north (spring)south (summer)12
south (spring)north (summer)4
::chart{type="sankey" title="Ducks between ponds"}
| from | to | ducks |
| --- | --- | --: |
| north (spring) | south (summer) | 12 |
| south (spring) | north (summer) | 4 |
::
md