DataViz.Layout.Sankey.Whole
- Package
- purescript-hylograph-layout
- Repository
- afcondon/purescript-hylograph-layout
The whole picture. The Sankey layout places the nodes that links
mention and routes the links that go forward. Two things are left over:
the links that close a cycle, and the nodes that no link mentions at
all. computeWholeLayout places those too, under the chart, and leaves
the chart itself exactly as computeLayoutWithLanes (or
computeLayoutWithLanesAtScale) gives it:
extent.y0 ┌──────────── the chart: columns, lanes ───────────┐
└──────────────────────────────────────────────────┘
backEdges.margin
══ a channel for each back-edge, in input order ════
shelf.margin
▭ ▭ ▭ ▭ the shelf: the isolated nodes, in the order
▭ ▭ given, in rows, left to right from extent.x0
A node that only a link to itself mentions is not isolated: it stands in the chart, in the first column, as tall as that link is wide.
#BackEdgeRouting Source
type BackEdgeRouting = { gap :: Number, margin :: Number, reach :: Number }margin: from the bottom of the chart to the first channel. gap:
between one channel and the next. reach: how far a back-edge swings
out beyond a node's side as it turns (generateBackEdgePath).
#ShelfOptions Source
type ShelfOptions = { columnPitch :: Number, margin :: Number, minimumColumns :: Int, nodeHeight :: Number, rowGap :: Number }margin: from what is above the shelf (the channels, or the chart) to
its first row. A row holds as many nodes as the chart has columns, and
at least minimumColumns. columnPitch: from the left of one node to
the left of the next. Each node is config.nodeWidth wide and
nodeHeight tall, with rowGap between rows.
#WholeOptions Source
type WholeOptions = { backEdges :: BackEdgeRouting, shelf :: ShelfOptions, sizing :: Sizing }#WholeLayout Source
type WholeLayout = { backEdges :: Array RoutedBackEdge, chart :: Extent, cycleAnalysis :: CycleAnalysis, extent :: Extent, isolated :: Array IsolatedNode, nodes :: Array SankeyNode, routes :: Array Route, waypoints :: Array SankeyNode }nodes, waypoints, routes, cycleAnalysis: as in LaneLayout.
backEdges: the links set aside, each with its channel, in input order.
isolated: the nodes no link mentions, in the order given. chart: the
box around the nodes and waypoints. extent: the box around everything,
the turns of the back-edges included.
#computeWholeLayout Source
computeWholeLayout :: WholeOptions -> (Int -> LinkCSVRow -> Boolean) -> Array String -> Array LinkCSVRow -> SankeyConfig -> WholeLayoutThe layout of rows, with lanes for the long links that wants
chooses, and with a place for every back-edge and for every name in
names that no row mentions. names may be all of the caller's nodes
or only the ones that may be isolated; with none, and with FitExtent,
the nodes, waypoints and routes are computeLayoutWithLanes's.
#isolatedAmong Source
isolatedAmong :: Array String -> Array LinkCSVRow -> Array StringThe names among names that no row mentions, each once, in order.
- 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