0.0.1 • Published 5 years ago

dot-sankey v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

dot-sankey

Build Status

Converts directed acyclic graphs in DOT format into Sankey diagrams using D3.

Usage

$ echo '
digraph {
  A -> C [value=50]
  B -> C [value=50]
  C -> D [value=100]
}' > input.dot

$ npx dot-sankey < input.dot
{
  "nodes": [
    {
      "name": "A"
    },
    {
      "name": "C"
    },
    {
      "name": "B"
    },
    {
      "name": "D"
    }
  ],
  "links": [
    {
      "source": 0,
      "target": 1,
      "value": "50"
    },
    {
      "source": 2,
      "target": 1,
      "value": "50"
    },
    {
      "source": 1,
      "target": 3,
      "value": "100"
    }
  ]
}