Module

DataViz.Layout.Sankey.Types

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

DataViz.Layout.Sankey.Types

Pure PureScript implementation of Sankey diagram layout types. This replaces the FFI-based approach with first-class PureScript types that integrate naturally with the phantom type system.

#LinkCSVRow Source

type LinkCSVRow = { s :: String, t :: String, v :: Number }

Input format for links from CSV (user-provided flow data with named nodes)

#NodeID Source

newtype NodeID

Constructors

Instances

#LinkID Source

newtype LinkID

Constructors

Instances

#NodeNameMap Source

#SankeyNodeInput Source

type SankeyNodeInput = { name :: String }

Input format for nodes (minimal user-provided data) - for backward compatibility

#SankeyNode Source

type SankeyNode = { color :: String, depth :: Int, index :: NodeID, layer :: Int, name :: String, nodeHeight :: Int, sourceLinks :: Set NodeID, targetLinks :: Set NodeID, value :: Number, x0 :: Number, x1 :: Number, y0 :: Number, y1 :: Number }

Internal node representation after layout computation This has all computed properties needed for rendering

#SankeyLayoutResult Source

type SankeyLayoutResult = { links :: Array SankeyLink, nodes :: Array SankeyNode }

Result of Sankey layout computation

#SankeyConfig Source

type SankeyConfig = { alignment :: Alignment, extent :: { x0 :: Number, x1 :: Number, y0 :: Number, y1 :: Number }, iterations :: Int, linkColorMode :: LinkColorMode, nodePadding :: Number, nodeWidth :: Number }

Configuration for Sankey layout algorithm

#SankeyStep Source

type SankeyStep = { iteration :: Int, label :: String, links :: Array SankeyLink, nodes :: Array SankeyNode }

A captured step for debugging/visualization

#Alignment Source

data Alignment

Node alignment strategy

Constructors

Instances

#defaultSankeyConfig Source

defaultSankeyConfig :: Number -> Number -> SankeyConfig

Default configuration matching D3 defaults

#SankeyGraphModel Source

type SankeyGraphModel = { capturedSteps :: Array SankeyStep, config :: SankeyConfig, graph :: DAG NodeID Number, linkCount :: Int, nodeCount :: Int, nodeIDToName :: NodeNameMap, nodeNameToID :: NodeIDMap, nodeOrder :: Array NodeID, sankeyLinks :: Array SankeyLink, sankeyNodes :: Array SankeyNode }

Graph model for State monad - contains all intermediate computation state SankeyGraphModel is created by folding rows of CSV