DataViz.Layout.Sankey.BackEdge
- Package
- purescript-hylograph-layout
- Repository
- afcondon/purescript-hylograph-layout
Back-edges, with a place. A link that closes a cycle (and every link from a node to itself is one) is set aside by the layout: it gives no node its column. It is still part of the picture. This module says which of the caller's links were set aside, by the caller's own names, where each stands on its two nodes, and gives one way to draw them: out of the source's right side, down to a channel under the chart, back along it, and up into the target's left side.
let laid = computeLayoutWithConfig rows config
let under = routeUnder { top: chartBottom + 10.0, gap: 5.0 } (backEdges laid)
under.routed <#> \r -> generateBackEdgePath 30.0 r -- stroke r.backEdge.width wide
#BackEdge Source
type BackEdge = { index :: Int, source :: String, target :: String, value :: Number, width :: Number, x0 :: Number, x1 :: Number, y0 :: Number, y1 :: Number }A link the layout set aside. index: its place in the caller's rows.
source, target: the names the caller gave (the same name twice for a
link from a node to itself). width: value at the chart's scale. It
leaves its source at (x0, y0), on the node's right side, and enters
its target at (x1, y1), on the node's left side; both are the centre
of the link, which stands width / 2 either side, inside the node and
below the node's links that go forward.
#RoutedBackEdge Source
type RoutedBackEdge = { backEdge :: BackEdge, channel :: Number }A back-edge with the channel it runs back along: channel is the y of
the channel's centre.
#backEdges Source
backEdges :: SankeyLayoutResult -> Array BackEdgeThe back-edges of a layout, in the order of the caller's rows.
#backEdgesAmong Source
backEdgesAmong :: Array SankeyNode -> CycleAnalysis -> Array BackEdgeThe same, from the parts: for a layout whose nodes are held apart from
the result (Lanes). index is the link's own number.
#routeUnder Source
routeUnder :: { gap :: Number, top :: Number } -> Array BackEdge -> { bottom :: Number, routed :: Array RoutedBackEdge }A channel for each back-edge, one under another in the order given,
the first with its upper edge at top and gap between one and the
next. bottom is the lower edge of the last channel (top where there
are none), so what is drawn under the channels starts there.
#generateBackEdgePath Source
generateBackEdgePath :: Number -> RoutedBackEdge -> StringThe centre line of a routed back-edge, to be stroked width wide: out
of the source's right side, round and down to the channel, back along
it, and round and up into the target's left side. reach: how far each
turn swings out beyond the node's side.
- 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