DataViz.Layout.Abacus.Types
- Package
- purescript-hylograph-layout
- Repository
- afcondon/purescript-hylograph-layout
DataViz.Layout.Abacus.Types
The types of the abacus diagram: a flow drawn with counted units inside
each node where a Sankey has ribbons of a width. See
DataViz.Layout.Abacus for the layout and its laws.
#AbacusLink Source
type AbacusLink kind = { kind :: kind, s :: String, t :: String, v :: Number }A link: a Sankey's row (s, t, v) and the kind of what flows along
it. A quantity below zero counts as none.
#kindedBy Source
kindedBy :: forall kind. (LinkCSVRow -> kind) -> Array LinkCSVRow -> Array (AbacusLink kind)A Sankey's rows, each given a kind.
#ofOneKind Source
ofOneKind :: Array LinkCSVRow -> Array (AbacusLink Unit)A Sankey's rows where nothing tells one flow from another.
#Composition Source
data CompositionWhich kinds a node's units are, and which of them were carried in and which arose in the node, where what comes in and what goes out differ. The node's total is the larger of the two whichever is chosen.
IncomingAndArising(the default): what comes in, by kind, at its own amounts,Carried; if more goes out than comes in, the rest is what arises in the node: it is shared among the kinds of what goes out, in their proportions, and isArising. So a node that nothing comes into (a source) is allArising.IncomingScaled: the kinds of what comes in, each scaled bytotal / incomingso that they sum to the total, allCarried; a node that nothing comes into has the kinds of what goes out,Arising.LargerSide: the kinds of whichever side is larger (what comes in, when they are equal):Carried, butArisingwhere nothing comes in.
Constructors
Instances
#Lanes Source
data LanesWhether a wire that passes over one or more columns is given a lane: a
place kept for it in each column it passes, between the nodes there, so
that it runs through no node and no name. gap is the room a lane takes
in a column, top to bottom; the wire runs along its middle.
Constructors
WithoutLanesWithLanes { gap :: Number }
Instances
#AbacusConfig Source
type AbacusConfig = { backWireDip :: Number, backWireGap :: Number, composition :: Composition, labelRoom :: LabelRoom, lanes :: Lanes, layerGap :: Number, nodeGap :: Number, nodeMinWidth :: String -> Number, origin :: Point, sankey :: SankeyConfig, tally :: Tally, unitGap :: Number, unitSize :: Number, unitsPerLine :: Int, worth :: UnitWorth }worth: what one unit is worth. unitsPerLine: how many units to a
line before the next line starts. unitSize: a unit's side. unitGap:
between one unit and the next, across and down. tally: grouping.
composition: see Composition. lanes: see Lanes.
nodeGap: between one node and the next below it (beyond the label
room). layerGap: between the widest node of one column and the left of
the next column. labelRoom: see LabelRoom. nodeMinWidth: a node's
least width in its column, by name (room for its label); the units keep
to the left of it. backWireDip: from the bottom of the lowest node
(its label room counted) to the channel of the first wire that turns
back, and the most a wire's turns are rounded by. backWireGap: from
one such channel to the next.
origin: the top left corner of the picture.
sankey: the Sankey layout that says which column a node is in, the
order of the nodes (and of the lanes) down a column, and which links
turn back. Its
alignment, nodeLayer and nodeSort mean here what they mean there.
Its sizes (extent, nodeWidth, nodePadding) reach the abacus only
through the order that the Sankey's relaxation settles on.
#defaultAbacusConfig Source
defaultAbacusConfig :: UnitWorth -> AbacusConfigTen units to a line, each 4 square and 1 apart, in no groups; kinds by what comes in and what arises; lanes, each 6 deep; columns 20 apart, nodes 12 apart with no room kept for labels; the Sankey's own defaults for a chart 960 by 600.
#KindQuantity Source
type KindQuantity kind = { kind :: kind, origin :: Origin, quantity :: Number }#Throughput Source
type Throughput kind = { byKind :: Array (KindQuantity kind), name :: String, total :: Number }What passes through a node: total is the larger of what comes in and
what goes out, and byKind is the total by kind and origin as the
Composition shares it out, the largest first (of equal quantities,
kinds in the order the links first name them, and carried before
arising). The quantities of byKind sum to total.
#UnitMark Source
data UnitMark kindWhat a unit says. Whole: one unit's worth of a kind, carried into the
node or arising in it. Part: an amount of that kind which is more
than nothing and less than one unit; drawn smaller. Empty: nothing;
drawn open.
Constructors
Instances
#AbacusUnit Source
type AbacusUnit kind = { mark :: UnitMark kind, size :: Number, x :: Number, y :: Number }A unit's place: its top left corner and its side. A Part and an
Empty have the same place as a Whole; drawing them smaller or open
is the caller's.
#AbacusNode Source
type AbacusNode kind = { layer :: Int, name :: String, returnsToItself :: Boolean, total :: Number, units :: Array (AbacusUnit kind), x0 :: Number, x1 :: Number, y0 :: Number, y1 :: Number }A node. Its box (x0, y0, x1, y1) is exactly the box around its
units. layer: its column, as the Sankey numbers them. total: see
Throughput. returnsToItself: some link of a quantity runs from this
node to itself; it is drawn as a mark on the node and has no wire.
#WireCourse Source
data WireCourseHow a wire runs. Every wire leaves the right side of its source at
from and enters the left side of its target at to, and first runs
level to the right side of its source's column.
Onward: from leaves, the right side of its source's column, across
to its target, which is in the next column (or, with WithoutLanes,
in any later one). Laned: its target is two or more columns on; from
leaves it goes through a lane in each column it passes, in order,
crossing from one column to the next in the space between them.
TurningBack: it closes a cycle (the Sankey set it aside as a
back-edge); it goes down at down, in the space after its source's
column, back along a channel at under, below every node, and up at
up, in the space before its target's column. turn: how far its
four turns are rounded.
Constructors
Onward { leaves :: Number }Laned { leaves :: Number, through :: Array LaneSlot }TurningBack { down :: Number, turn :: Number, under :: Number, up :: Number }
Instances
#AbacusWire Source
type AbacusWire kind = { course :: WireCourse, from :: Point, kind :: kind, links :: Array Int, source :: String, target :: String, to :: Point }A wire says only that two nodes are joined, and which way: there is one
for each pair of different nodes that links of a quantity join in one
direction, however many such links there are. links: their places in
the input. kind: the kind of the largest of them. from, to: its
two ends.
#turnsBack Source
turnsBack :: forall kind. AbacusWire kind -> Boolean#AbacusLayout Source
type AbacusLayout kind = { extent :: Extent, nodes :: Array (AbacusNode kind), wires :: Array (AbacusWire kind), worth :: UnitWorth }nodes: in the order of the Sankey's own nodes for the same rows, so
that what is given by a node's place there (a colour, say) is the same
in both pictures. wires: in the order the links first join each pair. worth: what a
unit is worth, to be said beside the picture. extent: the box around
everything, label room, lanes and the wires that turn back included;
such a wire may run to the left of origin or to the right of the last
column.
- Modules
- DataViz.
Layout. Abacus - DataViz.
Layout. Abacus. Types - 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