Hylograph.Flow.Render.Tree
- Package
- purescript-hylograph-flow-render
- Repository
- afcondon/purescript-hylograph-flow-render
A layout as a HATS tree: one SVG, edges under nodes.
An item (what holds a value) is an open box; a step (what computes) is a filled lozenge. An edge is one stroked path, as wide as the layout says: a hairline in a plain picture, a band in a Sankey; an edge turned back to close a cycle is dashed where it is a hairline.
Everything else about an element is the caller's: its label, a short
note beside the label, a class and a colour (Decoration), and
whatever an Overlay knows of it (withOverlay). Clicks and the
pointer's coming and going are told to the caller by element.
What is drawn, for a stylesheet or a test to find:
svg.flow
g.flow-edges > path.flow-edge[.flow-backward][data-edge][data-from][data-to]
g.flow-nodes > g.flow-node.flow-item|.flow-step[data-key]
> rect.flow-box, rect.flow-swatch?, text.flow-label, text.flow-note?
#Pointed Source
data PointedWhat a gesture was made on. A node is its element. An edge is a wire
where it is exactly one (Both, and any edge between a drawn item and
a drawn step); otherwise it is the path it stands for, with the undrawn
elements it passes through.
Constructors
PointedElement ElementKeyPointedPath { from :: ElementKey, to :: ElementKey, via :: Array ElementKey }
Instances
#plainDecoration Source
plainDecoration :: forall wire. Decoration wireEach node under its own label, nothing else said, gestures ignored.
#withOverlay Source
withOverlay :: forall a wire. Overlay a -> (a -> Mark -> Mark) -> (a -> Line -> Line) -> Decoration wire -> Decoration wireA decoration changed by what an overlay knows: of a node, by its key; of an edge that is one wire, by the wire's.
#keyName Source
keyName :: ElementKey -> StringAn element's key as one string, for data-key and for HATS's keys.
A closed group's step is group: and the group's id where a source's
step is step: and its name, so a step and a group never share a key.
Inside a wire's key the step and the port are written as they read
(stepLabel, portLabel).