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 -> SankeyLayoutResultMain 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 -> SankeyLayoutResultCompute Sankey layout with custom configuration This is the main algorithm using State monad to thread the graph model
#configAtScale Source
configAtScale :: Scale -> Array LinkCSVRow -> SankeyConfig -> SankeyConfigThe configuration whose extent gives the chart that scale: it keeps
extent.x0 and extent.y0 and sets extent.x1 and extent.y1, so
that the fullest column is exactly full and the columns are
columnPitch apart. Lay out with the result:
computeLayoutWithConfig rows (configAtScale scale rows config)
It runs the layout as far as the columns (no relaxation), which is all the extent depends on. The scale comes out to within rounding: the layout still divides the height it is given by the fullest column.
- Modules
- DataViz.
Layout. Adjacency - DataViz.
Layout. Adjacency. Layout - DataViz.
Layout. Adjacency. Types - DataViz.
Layout. BlockCutTree - DataViz.
Layout. Chord - DataViz.
Layout. Chord. Layout - DataViz.
Layout. Chord. Types - DataViz.
Layout. Hierarchy. Cluster - DataViz.
Layout. Hierarchy. Core - DataViz.
Layout. Hierarchy. EdgeBundle - DataViz.
Layout. Hierarchy. EdgeBundle. Bilink - DataViz.
Layout. Hierarchy. EdgeBundle. BundleCurve - DataViz.
Layout. Hierarchy. EdgeBundle. Hierarchy - DataViz.
Layout. Hierarchy. EdgeBundle. RadialCluster - DataViz.
Layout. Hierarchy. EdgeBundle. Types - DataViz.
Layout. Hierarchy. Link - DataViz.
Layout. Hierarchy. Pack - DataViz.
Layout. Hierarchy. Partition - DataViz.
Layout. Hierarchy. Placed - DataViz.
Layout. Hierarchy. Tree - DataViz.
Layout. Hierarchy. TreeStyle - DataViz.
Layout. Hierarchy. Treemap - DataViz.
Layout. Hierarchy. Types - DataViz.
Layout. Pattern - DataViz.
Layout. Pattern. Adapters - DataViz.
Layout. Pattern. Types - DataViz.
Layout. Sankey. BackEdge - DataViz.
Layout. Sankey. CSV - DataViz.
Layout. Sankey. Compute - DataViz.
Layout. Sankey. ComputeWithSteps - DataViz.
Layout. Sankey. Lanes - DataViz.
Layout. Sankey. Path - DataViz.
Layout. Sankey. Types - DataViz.
Layout. Sankey. Whole - DataViz.
Layout. StateMachine - DataViz.
Layout. StateMachine. Layout - DataViz.
Layout. StateMachine. Path - DataViz.
Layout. StateMachine. Tree - DataViz.
Layout. StateMachine. Types - DataViz.
Layout. TidyDag