Module

DataViz.Layout.Sankey.Compute

Package
purescript-hylograph-layout
Repository
afcondon/purescript-hylograph-layout

DataViz.Layout.Sankey.Compute

Pure PureScript implementation of Sankey diagram layout computation. Uses State monad to thread graph model through all layout functions. Starts with Array SankeyLinkInput and generates nodes dynamically.

Reference: https://github.com/d3/d3-sankey (ISC License)

#computeLayout Source

computeLayout :: Array LinkCSVRow -> Number -> Number -> SankeyLayoutResult

Main entry point: Compute Sankey layout with default configuration Takes array of link inputs with named nodes (from CSV parsing)

#computeLayoutWithConfig Source

computeLayoutWithConfig :: Array LinkCSVRow -> SankeyConfig -> SankeyLayoutResult

Compute Sankey layout with custom configuration This is the main algorithm using State monad to thread the graph model