animation/unfold#

Interfaces#

Across#

Defined in: arranger/src/animation/unfold.ts:227

How an element moves sideways: left and right its extent at rest, fromLeft and fromRight where the motion starts them (equal ends for an element drawn at one abscissa, a text or a mark, which moves without stretching).

Properties#

fromLeft#

readonly fromLeft: number

Defined in: arranger/src/animation/unfold.ts:230

fromRight#

readonly fromRight: number

Defined in: arranger/src/animation/unfold.ts:231

left#

readonly left: number

Defined in: arranger/src/animation/unfold.ts:228


Frame#

Defined in: arranger/src/animation/unfold.ts:47

Where an element lies at a progress: shifted vertically by dy, drawn at opacity times its own.

Properties#

dy#

readonly dy: number

Defined in: arranger/src/animation/unfold.ts:48

opacity#

readonly opacity: number

Defined in: arranger/src/animation/unfold.ts:49


Knot#

Defined in: arranger/src/animation/unfold.ts:138

A point of a card’s horizontal axis: the abscissa x and the position at it draws, on the card’s root’s own axis, as a float. A card’s knots, sorted by x, draw its positions piecewise linearly between them: a full run at its own scale, a gap at its own width.

Properties#

across?#

readonly optional across?: true

Defined in: arranger/src/animation/unfold.ts:146

Set where the knot ends a run at a seam whose position lies on the other run (docs/drawing.md in TimeToShare, section 3.2): the position is drawn at the other run’s knot, never at this one.

at#

readonly at: number

Defined in: arranger/src/animation/unfold.ts:140

x#

readonly x: number

Defined in: arranger/src/animation/unfold.ts:139


Motion#

Defined in: arranger/src/animation/unfold.ts:239

How an element of a card moves between two drawings: sideways across (null: it does not), down by dy at the start (its start’s ordinate less its own), and whether it enters, blending in.

Properties#

across#

readonly across: Across | null

Defined in: arranger/src/animation/unfold.ts:240

dy#

readonly dy: number

Defined in: arranger/src/animation/unfold.ts:241

enters#

readonly enters: boolean

Defined in: arranger/src/animation/unfold.ts:242


Placed#

Defined in: arranger/src/animation/unfold.ts:266

Where an element lies at a progress, as the map x ↦ sx · x + dx, y ↦ y + dy and its opacity times its own: the identity with opacity 1 at rest.

Properties#

dx#

readonly dx: number

Defined in: arranger/src/animation/unfold.ts:268

dy#

readonly dy: number

Defined in: arranger/src/animation/unfold.ts:269

opacity#

readonly opacity: number

Defined in: arranger/src/animation/unfold.ts:270

sx#

readonly sx: number

Defined in: arranger/src/animation/unfold.ts:267


Rect#

Defined in: arranger/src/animation/unfold.ts:29

A rectangle in drawing units.

Properties#

height#

readonly height: number

Defined in: arranger/src/animation/unfold.ts:33

width#

readonly width: number

Defined in: arranger/src/animation/unfold.ts:32

x#

readonly x: number

Defined in: arranger/src/animation/unfold.ts:30

y#

readonly y: number

Defined in: arranger/src/animation/unfold.ts:31


Row#

Defined in: arranger/src/animation/unfold.ts:23

A row of a drawing: what pairs it with a row of another drawing, and the ordinate of its line.

Properties#

key#

readonly key: string

Defined in: arranger/src/animation/unfold.ts:24

y#

readonly y: number

Defined in: arranger/src/animation/unfold.ts:25


RowMotion#

Defined in: arranger/src/animation/unfold.ts:41

How a row of the end drawing moves: shift the vertical distance from its place at rest to where the motion starts it (the paired row’s ordinate less its own), enters whether it has no pair and so blends in.

Properties#

enters#

readonly enters: boolean

Defined in: arranger/src/animation/unfold.ts:43

shift#

readonly shift: number

Defined in: arranger/src/animation/unfold.ts:42

Variables#

AT_REST#

const AT_REST: Placed

Defined in: arranger/src/animation/unfold.ts:274

Where an element lies at rest.


UNFOLD_DURATION#

const UNFOLD_DURATION: 400 = 400

Defined in: arranger/src/animation/unfold.ts:53

The time a whole motion takes, from 0 to 1 or back, in milliseconds.


UNFOLD_EASING#

const UNFOLD_EASING: (t) => number = cubicInOut

Defined in: arranger/src/animation/unfold.ts:56

The easing of the progress: slow at both ends, so the rows leave and settle softly.

Parameters#

t#

number

Returns#

number

Functions#

abscissaAt()#

abscissaAt(knots, at): number | null

Defined in: arranger/src/animation/unfold.ts:178

The abscissa drawing the position at among knots (sorted by x, so by at too): linear between the two knots around it, a knot’s own abscissa exactly at its position (but a knot across a seam’s), the first or the last knot’s beyond them (a position the knots do not reach is drawn at their nearer end); null without knots.

Parameters#

knots#

readonly Knot[]

at#

number

Returns#

number | null


composed()#

composed(outer, inner): Placed

Defined in: arranger/src/animation/unfold.ts:299

inner, then outer: the map of both, the opacities multiplied.

Parameters#

outer#

Placed

inner#

Placed

Returns#

Placed


durationOf()#

durationOf(from, to, reduced): number

Defined in: arranger/src/animation/unfold.ts:128

The milliseconds a progress takes from from to to: the part of UNFOLD_DURATION the distance is, so a motion reversed half-way takes half the time back; 0 under reduced motion, a plain switch.

Parameters#

from#

number

to#

number

reduced#

boolean

Returns#

number


frameAt()#

frameAt(motion, t): Frame

Defined in: arranger/src/animation/unfold.ts:107

Where an element moving by motion lies at progress t: shifted by shift × (1 − t), opaque when its row is paired and at t when it enters; an element of no row (null) does not move and blends in.

Parameters#

motion#

RowMotion | null

t#

number

Returns#

Frame


framePlaced()#

framePlaced(__namedParameters): Placed

Defined in: arranger/src/animation/unfold.ts:294

A raise’s frame (frameAt) as the map placedAt gives.

Parameters#

__namedParameters#

Frame

Returns#

Placed


pairRows()#

pairRows(from, to): ReadonlyMap<string, RowMotion>

Defined in: arranger/src/animation/unfold.ts:68

The motion of every row of to, the end drawing, keyed by its row’s key, against from, the drawing the motion starts from. A row whose key from holds is paired with the first such row of from and shifted by its ordinate less its own. A row from lacks enters, shifted as the paired rows around it: by the paired rows’ ordinates in to, the shift interpolated linearly between the nearest paired row above it and the nearest below, the nearest one’s beyond the first or the last, 0 where no row is paired. A key repeated in to keeps its first row.

Parameters#

from#

readonly Row[]

to#

readonly Row[]

Returns#

ReadonlyMap<string, RowMotion>


placedAt()#

placedAt(motion, t): Placed

Defined in: arranger/src/animation/unfold.ts:282

Where an element moving by motion lies at progress t: its extent spanAt (stretched from its start’s to its own, moved without stretching where it has no width), shifted down by dy × (1 − t), at opacity t when it enters and 1 otherwise; exactly AT_REST at 1.

Parameters#

motion#

Motion

t#

number

Returns#

Placed


positionAt()#

positionAt(knots, x): number | null

Defined in: arranger/src/animation/unfold.ts:154

The position the abscissa x draws among knots (sorted by x): linear between the two knots around it, a knot’s own position exactly at it, the first or the last knot’s beyond them; null without knots.

Parameters#

knots#

readonly Knot[]

x#

number

Returns#

number | null


rectAt()#

rectAt(from, to, t): Rect

Defined in: arranger/src/animation/unfold.ts:113

The rectangle between from (at t = 0) and to (at t = 1), each edge linearly.

Parameters#

from#

Rect

to#

Rect

t#

number

Returns#

Rect


spanAt()#

spanAt(across, t): object

Defined in: arranger/src/animation/unfold.ts:249

An element’s extent at a progress: each end linearly from where the motion starts it to its own, exactly its start at 0 and its own at 1.

Parameters#

across#

Across

t#

number

Returns#

object

left#

readonly left: number

right#

readonly right: number


startOf()#

startOf(from, to, offset, x): number

Defined in: arranger/src/animation/unfold.ts:205

Where the motion starts the abscissa x of the end drawing, whose card draws through to: at the abscissa the start drawing’s card draws the same position through from, plus offset (the move of the place origin between the two drawings, so both are read on the canvas); x itself moved by offset where either drawing has no knots. An abscissa beyond to’s first or last knot starts as far beyond that knot’s start, so a card’s names and padding travel with its line’s ends.

Parameters#

from#

readonly Knot[]

to#

readonly Knot[]

offset#

number

x#

number

Returns#

number