ribbons#

Interfaces#

ChunkLights#

Defined in: arranger/src/ribbons.ts:53

What a hovered or selected chunk shows: its ribbons, and the other chunks of its source it lights.

Properties#

lit#

readonly lit: readonly ElementAddress[]

Defined in: arranger/src/ribbons.ts:56

The addresses of the braces lit ({id: W, facet: "regions", part: [j]}), each drawn once at least.

ribbons#

readonly ribbons: readonly Ribbon[]

Defined in: arranger/src/ribbons.ts:54


ChunkRef#

Defined in: arranger/src/ribbons.ts:27

A chunk of a virtual timeline: the virtual timeline’s ID and the chunk’s index in its FlowMap.

Properties#

index#

readonly index: number

Defined in: arranger/src/ribbons.ts:29

timeline#

readonly timeline: string

Defined in: arranger/src/ribbons.ts:28


LitBrace#

Defined in: arranger/src/ribbons.ts:60

A lit brace as a block node draws it: a copy of its descriptor’s shape, its address left out.

Properties#

attributes#

readonly attributes: Readonly<Record<string, string>>

Defined in: arranger/src/ribbons.ts:64

key#

readonly key: string

Defined in: arranger/src/ribbons.ts:62

Its descriptor’s key in the node.

tag#

readonly tag: string

Defined in: arranger/src/ribbons.ts:63


Ribbon#

Defined in: arranger/src/ribbons.ts:44

One ribbon: from a stretch of a chunk’s brace on its virtual card’s line (from) to that stretch as written on a line of the source (to), and its path, the two ends joined by cubic curves leaving each line upright.

Properties#

d#

readonly d: string

Defined in: arranger/src/ribbons.ts:49

from#

readonly from: RibbonEnd

Defined in: arranger/src/ribbons.ts:47

key#

readonly key: string

Defined in: arranger/src/ribbons.ts:46

Unique within a block: the chunk, the card, the stretch and the source line.

to#

readonly to: RibbonEnd

Defined in: arranger/src/ribbons.ts:48


RibbonEnd#

Defined in: arranger/src/ribbons.ts:33

One end of a ribbon: from x1 to x2 on the line at the ordinate y, in block-local canvas units.

Properties#

x1#

readonly x1: number

Defined in: arranger/src/ribbons.ts:34

x2#

readonly x2: number

Defined in: arranger/src/ribbons.ts:35

y#

readonly y: number

Defined in: arranger/src/ribbons.ts:36

Variables#

NO_LIGHTS#

const NO_LIGHTS: ChunkLights

Defined in: arranger/src/ribbons.ts:96

Nothing shown: no chunk hovered or selected.

Functions#

allLights()#

allLights(manifest, drawing, chunks): ChunkLights

Defined in: arranger/src/ribbons.ts:72

Every chunk’s lights together: the ribbons of each in turn, each key prefixed by its chunk’s address key, and the braces they light, each once, none of them one of chunks.

Parameters#

manifest#

Manifest

drawing#

Drawing

chunks#

readonly ChunkRef[]

Returns#

ChunkLights


cardHolding()#

cardHolding(drawing, index): PlaceKey | null

Defined in: arranger/src/ribbons.ts:152

The card drawing the element at index: the innermost card box whose range holds it.

Parameters#

drawing#

Drawing

index#

number

Returns#

PlaceKey | null


chunkAddress()#

chunkAddress(chunk): ElementAddress

Defined in: arranger/src/ribbons.ts:108

The address of a chunk’s brace.

Parameters#

chunk#

ChunkRef

Returns#

ElementAddress


chunkLights()#

chunkLights(manifest, drawing, chunk): ChunkLights

Defined in: arranger/src/ribbons.ts:247

The ribbons of chunk in drawing, the drawing of manifest, and the chunks it lights; nothing where its virtual timeline does not resolve through a FlowMap of its own root (resolveVirtualTimeline), or where the chunk is a gap.

For every brace of the chunk drawn (one per card drawing its virtual timeline: a run drawn once draws only its first entry’s, section 8.10) and every stretch the chunk plays (one, or a virtual timeline’s several), the ribbon leaves the card’s line of the virtual timeline over the stretch’s share of the brace, x1 + share × (x2 − x1) at the played start and end, the chunk’s span from its first stretch’s played start to its last’s played end; and reaches every line of the source root drawn in a card that is not switched, over the written stretch clipped to what that line draws (abscissaOf). Ribbons come in the order of the braces, then the stretches, then the source’s lines.

It lights the brace of every other chunk, of any virtual timeline drawn, that names the same source.

Parameters#

manifest#

Manifest

drawing#

Drawing

chunk#

ChunkRef

Returns#

ChunkLights


chunkOf()#

chunkOf(manifest, address): ChunkRef | null

Defined in: arranger/src/ribbons.ts:99

The chunk address names: {id: V, facet: "regions", part: [k, ...]} of a virtual timeline V; else null.

Parameters#

manifest#

Manifest

address#

ElementAddress

Returns#

ChunkRef | null


clippedOn()#

clippedOn(axis, start, end): readonly [number, number] | null

Defined in: arranger/src/ribbons.ts:191

The abscissas of [start, end] on the line axis, clipped to what it draws (from its start over its length, or its drawn length where the end is not known); null where nothing of it is drawn there.

Parameters#

axis#

LineAxis

start#

Real

end#

Real

Returns#

readonly [number, number] | null


ribbonPath()#

ribbonPath(from, to): string

Defined in: arranger/src/ribbons.ts:215

The path of a ribbon from from to to: along from’s line from x1 to x2, a cubic curve to to’s x2, along its line back to its x1, and a cubic curve home, each curve’s control points at the ordinate halfway between the two lines, straight above or below its ends.

Parameters#

from#

RibbonEnd

to#

RibbonEnd

Returns#

string