flowSwitch#

Interfaces#

ChunkMorph#

Defined in: arranger/src/flowSwitch.ts:177

The motion of one chunk of a card that became switched: its elements (indices of the drawing after), from the stretch it plays as written on the card’s line before (from) to its brace on the virtual axis (to).

Properties#

elements#

readonly elements: readonly number[]

Defined in: arranger/src/flowSwitch.ts:178

from#

readonly from: Span

Defined in: arranger/src/flowSwitch.ts:179

to#

readonly to: Span

Defined in: arranger/src/flowSwitch.ts:180


FlowChoice#

Defined in: arranger/src/flowSwitch.ts:39

One entry of the list: a FlowMap or virtual timeline flow of the root timeline, or “As written” (both null).

Properties#

flow#

readonly flow: string | null

Defined in: arranger/src/flowSwitch.ts:41

label#

readonly label: string

Defined in: arranger/src/flowSwitch.ts:42

timeline#

readonly timeline: string | null

Defined in: arranger/src/flowSwitch.ts:40


Span#

Defined in: arranger/src/flowSwitch.ts:167

An abscissa span [x1, x2] in block-local canvas units.

Properties#

x1#

readonly x1: number

Defined in: arranger/src/flowSwitch.ts:168

x2#

readonly x2: number

Defined in: arranger/src/flowSwitch.ts:169

Variables#

AS_WRITTEN#

const AS_WRITTEN: FlowChoice

Defined in: arranger/src/flowSwitch.ts:69

The list’s first entry.



SWITCH_GAP#

const SWITCH_GAP: 4 = 4

Defined in: arranger/src/flowSwitch.ts:52

The gap, in screen pixels, between the flow switch and the mode menu below it.


SWITCH_WIDTH#

const SWITCH_WIDTH: "11rem" = "11rem"

Defined in: arranger/src/flowSwitch.ts:66

The width of the switch’s list, the same whatever the names it lists: a name longer than it is cut with an ellipsis and shown whole on hover.

Functions#

chosenFlow()#

chosenFlow(manifest, box): FlowChoice

Defined in: arranger/src/flowSwitch.ts:119

The entry the switch above box shows chosen: the one flow its timelines’ cards are switched to where exactly one is (core’s cardFlow), else “As written”, as the drawing draws a frame with two switched members.

Parameters#

manifest#

Manifest

box#

DrawnBox

Returns#

FlowChoice


flowChoices()#

flowChoices(manifest, box): FlowChoice[] | null

Defined in: arranger/src/flowSwitch.ts:109

The list of the switch above box: “As written” (AS_WRITTEN), then the flows of every timeline it switches (flowsOf), a frame’s member by member; null where there is none to choose, so no switch is shown.

Parameters#

manifest#

Manifest

box#

DrawnBox

Returns#

FlowChoice[] | null


flowCommands()#

flowCommands(block, manifest, box, choice): StyleCommand[]

Defined in: arranger/src/flowSwitch.ts:147

The commands choosing choice on the switch above box of block block: first one removing flow from the cards of every other timeline the box switches that sets one (cardFlow; “As written” removes it from all), then, for a FlowMap or virtual timeline, one setting it on its timeline’s cards where they set another or none; none where choice is what the cards show already.

Parameters#

block#

string

manifest#

Manifest

box#

DrawnBox

choice#

FlowChoice

Returns#

StyleCommand[]


flowsOf()#

flowsOf(manifest, timeline): FlowChoice[]

Defined in: arranger/src/flowSwitch.ts:78

The FlowMaps and virtual timelines a card of timeline may switch to (section 2.4, the validators’ flow_rule): where it is a root, each FlowMap of it, then each virtual timeline applying one of those to it without through, in the manifest’s order, labelled by its name, else its ID; none for any other timeline.

Parameters#

manifest#

Manifest

timeline#

string

Returns#

FlowChoice[]


morphTransform()#

morphTransform(morph, text, t): string | null

Defined in: arranger/src/flowSwitch.ts:294

The transform an element of a moving chunk takes at the progress t (null at rest, t ≥ 1), drawn where the chunk lies at to: a text is moved by its span’s middle, translate(m(t) − m(to) 0); anything else is stretched along x onto the span at t, matrix(s 0 0 1 x1(t) − x1(to) × s 0), s the span’s width at t over its width at to (1 where that is 0).

Parameters#

morph#

ChunkMorph

text#

boolean

t#

number

Returns#

string | null


spanAt()#

spanAt(from, to, t): Span

Defined in: arranger/src/flowSwitch.ts:283

A span at the progress t from from (0) to to (1), each end moving straight.

Parameters#

from#

Span

to#

Span

t#

number

Returns#

Span


switchMorphs()#

switchMorphs(manifest, before, after): ChunkMorph[]

Defined in: arranger/src/flowSwitch.ts:228

The chunks moving where a card became switched between the drawing before and the drawing after of manifest (section 8.10): for every card of after holding chunk braces addressed with a timeline T of the manifest ({id: T, facet: "regions", part: [k]}, a switched card’s; a virtual card’s carry a virtual timeline’s ID) whose card of the same place key in before held none, each chunk k with a written stretch drawn on T’s line in that card of before: its elements in that card of after (its brace, label, leader and boundary), from that stretch’s abscissas there (the first of T’s lines drawing any of it, clipped to what it draws) to its brace’s x1 and x2.

Parameters#

manifest#

Manifest

before#

Drawing

after#

Drawing

Returns#

ChunkMorph[]


switchOffset()#

switchOffset(menu): number

Defined in: arranger/src/flowSwitch.ts:58

How far above its box the flow switch stands: clear of the mode menu, menu screen pixels high, where one is shown; MENU_GAP where none is.

Parameters#

Returns#

number