Module

Hylograph.Flow.Render.Continuity

Package
purescript-hylograph-flow-render
Repository
afcondon/purescript-hylograph-flow-render

What is kept between two layouts of two cuts of one flow, measured (0.6).

When a group opens or closes, the reader must not lose their place. There is a ladder of what a pair of pictures can promise, best first; this module computes the three rungs that are laws of the pair, from the two layouts and nothing else, so that a page says which rung it is on and adds other signals accordingly. It claims a rung only where it has measured it.

  • Held: every node the change does not touch keeps its box exactly, and the pair is Nested.
  • Nested: each opened group's parts lie within the breadth its closed bar had, where the bar stood: every part's span across the flow is inside the bar's span. And the pair is Ordered.
  • Ordered: things move, but no two nodes of a tier and no two ribbons at a node change order.
  • Rearranged: none of these. (The ladder's other rungs, a watched transition and signals in colour and outline, are then all the reader has.)

HOW A CHANGE IS READ FROM TWO LAYOUTS. A node is untouched when its key is in both. A bar is a closed group's node (its step, or its summary) that is in one layout and not the other; its parts are the members of that group's outline in the other layout, which is why the layouts must have been made with the picture told of its groups. A node in one layout only that is neither a bar with parts nor a part of a bar is unaccounted for, and a pair with such a node is not called Nested. Nothing here is told which layout is the finer: several groups may open and others close between the two, and each bar is paired with its parts wherever they are.

ORDER, exactly. Two untouched nodes in one tier of both layouts are across the flow from one another the same way in both. A bar is to an untouched node of its tier as each of its parts is to that node, where they share a tier. On each side of an untouched node, the ribbons to (or from) two different other ends stand the same way in both, a ribbon to a part counting as a ribbon to its bar; and so the ribbons to the parts of one group stand together. Two things at one place (a node of no breadth, a ribbon of none) are in order either way. Nodes with no tier (the shelf) are not compared.

#Continuity Source

data Continuity

The best rung a pair keeps; see the module's header.

Constructors

Instances

#Bar Source

type Bar = { abreast :: Number, breadth :: Number, group :: GroupId, inPlace :: Boolean, parts :: Int, slot :: Number }

A closed group's bar in one layout and its parts in the other. breadth: the bar's, across the flow. slot: from the start of the first part to the end of the last, in any tier (so the parts fit a slot of the bar's breadth when slot <= breadth). abreast: the most the parts of one tier come to, added up. inPlace: every part's span is inside the span the bar had.

#Change Source

type Change = { bars :: Array Bar, disordered :: Array String, moved :: Array ElementKey, rung :: Continuity, unaccounted :: Array ElementKey }

Everything measured of a pair. moved: the untouched nodes whose box is not what it was. unaccounted: see the header. disordered: each breach of order, in words.

#Opened Source

type Opened = { bar :: PlacedNode, group :: GroupId, measured :: Bar, parts :: Array PlacedNode }

A closed group's bar in one layout, and its parts in another.

#opened Source

opened :: forall wire. Layout wire -> Layout wire -> Array Opened

The bars of the first layout that the second has not, each with its parts in the second: the members there of its group's outline. (A bar whose group has no outline in the second layout is not among them.)

#change Source

change :: forall wire. Layout wire -> Layout wire -> Change

What is kept between two layouts, and what is not.

#continuity Source

continuity :: forall wire. Layout wire -> Layout wire -> Continuity

The best rung two layouts of two cuts of one flow keep.