traversal#
Interfaces#
CardAxis#
Defined in: layout/src/traversal.ts:348
The elided axis of a card (section 3.2): its gaps from the left, its runs,
and the distance L × u − D of a position from the root’s start, D the
shrinks of the gaps ending at or before it, summed from the left.
Properties#
gaps#
readonlygaps: readonlyGap[]
Defined in: layout/src/traversal.ts:349
runGaps#
Defined in: layout/src/traversal.ts:386
The run gaps of its runs drawn once (section 8.10, Runs), each [a, b] on its root’s axis,
from the left: what no line drawn on it draws, so that a line’s axes leave them out.
runs#
readonlyruns: readonlyRun[]
Defined in: layout/src/traversal.ts:355
seams#
readonlyseams: readonlyReal[]
Defined in: layout/src/traversal.ts:354
The positions of its seams, from the left: an ancestor card’s room under its frame’s borders (section 8.8, step 2), where its axis jumps right by the seam’s width and nothing is left out.
total#
readonlytotal:number
Defined in: layout/src/traversal.ts:357
The sum of every shrink, a seam’s its negated width: D at the root’s end, DG of a frame.
Methods#
crosses()#
crosses(
gap,start,end):boolean
Defined in: layout/src/traversal.ts:399
Whether a row spanning start to end (null: open, as the root’s open end or an ancestor
line running on to the right) crosses gap: its span holds the whole gap (section 6.6).
Parameters#
gap#
start#
end#
Real | null
Returns#
boolean
endAt()#
endAt(
value):number
Defined in: layout/src/traversal.ts:363
L − D at the open end of a root of unknown length lying at value (section 3.2): D the
sum of every shrink, summed from the left, a seam at value counted on the side facing the
protected span, so the end lies left of the seam at the span’s end.
Parameters#
value#
Returns#
number
gapOf()#
gapOf(
value):Gap|undefined
Defined in: layout/src/traversal.ts:381
The gap a position lies in, its ends excluded; undefined for a position in no gap.
Parameters#
value#
Returns#
Gap | undefined
relative()#
relative(
value):number
Defined in: layout/src/traversal.ts:368
L × u − D of a position in no gap; a position at a seam lies on the side of the seam that
faces the protected span.
Parameters#
value#
Returns#
number
relativeAt()#
relativeAt(
value,side):number
Defined in: layout/src/traversal.ts:373
L × u − D of a position as the end ("before") or the start ("after") of a run: at a seam
on its left or its right side, elsewhere as relative.
Parameters#
value#
side#
"before" | "after"
Returns#
number
runGapOf()#
runGapOf(
value):number|undefined
Defined in: layout/src/traversal.ts:392
The run gap of a run drawn once a position lies in, its ends excluded (section 8.10, Runs):
L × u − D of its drawn start, where it takes no room and is not drawn; undefined for a
position in none.
Parameters#
value#
Returns#
number | undefined
shrinkBefore()#
shrinkBefore(
value):number
Defined in: layout/src/traversal.ts:394
D at a position: the shrinks of the gaps ending at or before it, summed from the left.
Parameters#
value#
Returns#
number
startAt()#
startAt(
value):number
Defined in: layout/src/traversal.ts:379
L × u − D of a position as the start of a line, of a region or as a jump’s target: at a
seam that puts starts on its right side (between two anchors of a root drawn once, section
8.8), the start of the run right of it, elsewhere as relative.
Parameters#
value#
Returns#
number
Context#
Defined in: layout/src/traversal.ts:172
What every member drawing of one manifest shares.
Extended by#
Properties#
cascade#
readonlycascade:Cascade
Defined in: layout/src/traversal.ts:176
manifest#
readonlymanifest:Manifest
Defined in: layout/src/traversal.ts:174
The manifest drawn, in canonical order: the band order of each timeline is read from it.
measure#
readonlymeasure:TextMeasure
Defined in: layout/src/traversal.ts:177
placement#
readonlyplacement:Placement
Defined in: layout/src/traversal.ts:175
reading#
readonlyreading:FlowReading|null
Defined in: layout/src/traversal.ts:179
The reading in force of flow control (section 1): what it does not read is faded; null for none.
DrawnChunk#
Defined in: layout/src/traversal.ts:148
One entry of a FlowMap’s chunks as a line draws it (section 8.10): its
index k, whether it is a gap, its span on the virtual axis, its label’s
text, whether it is drawn (the second and later entries of a run drawn
once are not), and whether a boundary marks its drawn start.
Properties#
boundary#
readonlyboundary:boolean
Defined in: layout/src/traversal.ts:155
drawn#
readonlydrawn:boolean
Defined in: layout/src/traversal.ts:154
end#
readonlyend:Real
Defined in: layout/src/traversal.ts:152
gap#
readonlygap:boolean
Defined in: layout/src/traversal.ts:150
index#
readonlyindex:number
Defined in: layout/src/traversal.ts:149
start#
readonlystart:Real
Defined in: layout/src/traversal.ts:151
text#
readonlytext:string
Defined in: layout/src/traversal.ts:153
DrawnFlow#
Defined in: layout/src/traversal.ts:165
The chunks a line draws (section 8.10): timeline the ID its chunks’
addresses carry (a virtual timeline’s, or a switched card’s timeline’s),
its entries in the order of chunks, and the run gaps of its runs drawn
once, each over [a, b], the end of a run’s first entry to the end of its
last, from the left.
Properties#
chunks#
readonlychunks: readonlyDrawnChunk[]
Defined in: layout/src/traversal.ts:167
runGaps#
Defined in: layout/src/traversal.ts:168
timeline#
readonlytimeline:string
Defined in: layout/src/traversal.ts:166
Entry#
Defined in: layout/src/traversal.ts:63
A timeline as the traversal visits it: its key and style, where it starts and ends on the root’s axis, its name, its bands, and whether it is drawn.
Extends#
Properties#
bands#
readonlybands:Readonly<Record<Facet,Holder>>
Defined in: layout/src/traversal.ts:104
Its five bands (sections 2.1 and 2.2): each band’s key, held by this timeline, and its style.
drawn#
readonlydrawn:boolean
Defined in: layout/src/traversal.ts:112
Its drawing may be drawn (sections 2.4 and 6.4): it is displayed (its own display and that
of every band holding it, at any depth, are inline) and, for any timeline but the root, its
parent’s drawing may be drawn. A line that is not displayed hides its timeline’s whole
drawing, the root’s as a child’s: a child is then not placed, a segment adds nothing, and a
root draws nothing of its own.
end#
readonlyend:Real
Defined in: layout/src/traversal.ts:74
Where it ends on the root’s axis (section 3.4); on a switched card, where its drawing ends.
endCut#
readonlyendCut:boolean
Defined in: layout/src/traversal.ts:87
first#
readonlyfirst:boolean
Defined in: layout/src/traversal.ts:100
The first segment of its segment line, in canonical order.
key#
readonlykey:ElementKey
Defined in: layout/src/traversal.ts:55
Inherited from#
line#
readonlyline:boolean
Defined in: layout/src/traversal.ts:102
Drawn as a line of its own: the root, a child, a segment that is a segment line.
manifest#
readonlymanifest:object
Defined in: layout/src/traversal.ts:65
The timeline itself.
name#
readonlyname:Styled
Defined in: layout/src/traversal.ts:96
Its name: drawn for the root and a child, counted for a segment line among segments. A segment that is no line has no name element; its name is its own style, never resolved.
open#
readonlyopen:boolean
Defined in: layout/src/traversal.ts:89
Its end is open: no length and nothing else fixes it (section 3.4).
parent#
readonlyparent:Entry|undefined
Defined in: layout/src/traversal.ts:67
The entry of its parent; undefined for the root.
piece#
readonlypiece:Piece|null
Defined in: layout/src/traversal.ts:84
The stretch piece of a switched card’s FlowMap it is drawn in (section 8.10); null on a card drawn as written, and for a switched card’s root, which holds nothing of its own.
rootEnd#
readonlyrootEnd:boolean
Defined in: layout/src/traversal.ts:91
Its end is the open end of the root, drawn at x0 + L whatever the reach (section 3.4).
segment#
readonlysegment:boolean
Defined in: layout/src/traversal.ts:98
A child of a segment line: it has a boundary unless it is the first, and a label.
start#
readonlystart:Real
Defined in: layout/src/traversal.ts:72
Where it starts on the root’s axis: the sum of its offsets and its ancestors’; on a switched card (section 8.10), where its drawing in its piece starts on the virtual axis.
startCut#
readonlystartCut:boolean
Defined in: layout/src/traversal.ts:86
Its drawing starts or ends at its piece’s end, not at its own, and keeps no mark there.
style#
readonlystyle:Style
Defined in: layout/src/traversal.ts:56
Inherited from#
written#
readonlywritten:object
Defined in: layout/src/traversal.ts:79
Where it starts and ends on the axis of the member drawing’s root as written (sections 3.1
and 3.4): start and end, but on a switched card.
end#
readonlyend:Real
start#
readonlystart:Real
Gap#
Defined in: layout/src/traversal.ts:316
A gap of an elided axis (section 3.2), with its widths and its edges.
Properties#
a#
readonlya:Real
Defined in: layout/src/traversal.ts:319
Its stretch on the axis of the card’s root: exact for a card’s gap, p × λ for a frame’s.
b#
readonlyb:Real
Defined in: layout/src/traversal.ts:320
entry#
readonlyentry:Entry|undefined
Defined in: layout/src/traversal.ts:340
The timeline in the card whose markers band holds its label stack; none where it has none there.
exact?#
Defined in: layout/src/traversal.ts:331
A frame’s gap: the exact proportions of its ends (section 8.9, Carried gaps), each the exact
quotient of the stretch’s end on its member’s axis and that member’s length or reach (a
float at its exact binary value), clipped to [0, 1], or, where an earlier piece cut the
stretch, that piece’s exact end; ua and ub are the doubles nearest them. Absent on a
card’s gap.
g#
readonlyg:number
Defined in: layout/src/traversal.ts:334
left#
readonlyleft:number
Defined in: layout/src/traversal.ts:337
L × u − D at its two ends: its edges x(a) and x(b) less x0.
n#
readonlyn:number
Defined in: layout/src/traversal.ts:333
Its natural width n, drawn width g and shrink n − g.
right#
readonlyright:number
Defined in: layout/src/traversal.ts:338
shrink#
readonlyshrink:number
Defined in: layout/src/traversal.ts:335
source#
readonlysource:GapSource
Defined in: layout/src/traversal.ts:317
ua#
readonlyua:number
Defined in: layout/src/traversal.ts:322
The proportions of its ends.
ub#
readonlyub:number
Defined in: layout/src/traversal.ts:323
GapLabel#
Defined in: layout/src/traversal.ts:283
A label of a gap: its element’s key, style and text, measured and cut to its max-width.
Properties#
address#
readonlyaddress:ElementAddress
Defined in: layout/src/traversal.ts:285
style#
readonlystyle:Style
Defined in: layout/src/traversal.ts:286
text#
readonlytext:string
Defined in: layout/src/traversal.ts:287
width#
readonlywidth:number
Defined in: layout/src/traversal.ts:288
word#
readonlyword:"id"|"name"|"coordinate"
Defined in: layout/src/traversal.ts:284
GapSource#
Defined in: layout/src/traversal.ts:299
What a gap draws, shared by every drawing of it (sections 2.4, 6.6 and 8.9): its address and key, its cascaded style and its ellipses’ (null where it draws none), whether it draws continuations, its displayed labels, the timeline it lies on with the elided coordinates of its piece on that timeline’s own axis, and the proportion its label stack is centred on at full scale.
Properties#
address#
readonlyaddress:OwnerAddress
Defined in: layout/src/traversal.ts:301
continuation#
readonlycontinuation:boolean
Defined in: layout/src/traversal.ts:305
ellipsis#
readonlyellipsis:Style|null
Defined in: layout/src/traversal.ts:304
end#
readonlyend:Real
Defined in: layout/src/traversal.ts:309
framed#
readonlyframed:boolean
Defined in: layout/src/traversal.ts:312
It belongs to a frame: drawn across it after every item, never by a card (section 8.5).
key#
readonlykey:ElementKey
Defined in: layout/src/traversal.ts:302
labels#
readonlylabels: readonlyGapLabel[]
Defined in: layout/src/traversal.ts:306
origin#
readonlyorigin:GapOrigin
Defined in: layout/src/traversal.ts:300
start#
readonlystart:Real
Defined in: layout/src/traversal.ts:308
style#
readonlystyle:Style
Defined in: layout/src/traversal.ts:303
timeline#
readonlytimeline:object
Defined in: layout/src/traversal.ts:307
um#
readonlyum:number
Defined in: layout/src/traversal.ts:310
Holder#
Defined in: layout/src/traversal.ts:54
An element of the tree whose children inherit from it: its key and its cascaded style.
Extended by#
Properties#
key#
readonlykey:ElementKey
Defined in: layout/src/traversal.ts:55
style#
readonlystyle:Style
Defined in: layout/src/traversal.ts:56
Measured#
Defined in: layout/src/traversal.ts:122
A text ready to draw.
Extended by#
Properties#
clean#
readonlyclean:string
Defined in: layout/src/traversal.ts:124
The text with every character U+0000–U+001F replaced by a space (cleanText).
width#
readonlywidth:number
Defined in: layout/src/traversal.ts:126
The width of clean at its owner’s font size.
Owned#
Defined in: layout/src/traversal.ts:116
An element a timeline’s band holds: a map, a region, a break, a section break, a barline, a jump or a wedge.
Extends#
Properties#
address#
readonlyaddress:ElementAddress
Defined in: layout/src/traversal.ts:49
Inherited from#
entry#
readonlyentry:Entry
Defined in: layout/src/traversal.ts:117
label#
Defined in: layout/src/traversal.ts:118
style#
readonlystyle:Style
Defined in: layout/src/traversal.ts:50
Inherited from#
Scope#
Defined in: layout/src/traversal.ts:183
One timeline drawn as a root, traversed, with the measures of its axis and its texts.
Extends#
Properties#
a#
readonlya: (size) =>number
Defined in: layout/src/traversal.ts:256
Parameters#
size#
number
Returns#
number
at#
readonlyat: (entry,value) =>Real|undefined
Defined in: layout/src/traversal.ts:207
Where the coordinate value of the own axis of entry’s timeline is drawn on the root’s
axis: its position (section 3.1), played in entry’s piece on a switched card, undefined
where it is played elsewhere.
Parameters#
entry#
value#
Returns#
Real | undefined
axis#
readonlyaxis:CardAxis|undefined
Defined in: layout/src/traversal.ts:247
The elided axis of the card drawing it (sections 3.2 and 8.9), where that card draws gaps: its own, or its frame’s read on its member’s proportions.
byTraversal#
readonlybyTraversal: (left,right) =>number
Defined in: layout/src/traversal.ts:227
Compares two of entries by their traversal order (section 6.1), for sorting.
Parameters#
left#
right#
Returns#
number
carried#
readonlycarried:boolean
Defined in: layout/src/traversal.ts:201
Its root is a member carried through a switched frame onto another member’s FlowMap (section 8.10): its root’s line, and a virtual member’s chunks, are drawn once in each piece.
cascade#
readonlycascade:Cascade
Defined in: layout/src/traversal.ts:176
Inherited from#
d#
readonlyd: (size) =>number
Defined in: layout/src/traversal.ts:257
Parameters#
size#
number
Returns#
number
drawnX#
readonlydrawnX: (value) =>number|undefined
Defined in: layout/src/traversal.ts:252
The distance of a drawn position from the root’s start: L × u − D on the elided axis, L × u without one; undefined for a position in a gap, which has no x.
Parameters#
value#
Returns#
number | undefined
entries#
readonlyentries: readonlyEntry[]
Defined in: layout/src/traversal.ts:222
Every timeline of its tree in traversal order, the root first.
flow#
readonlyflow:DrawnFlow|null
Defined in: layout/src/traversal.ts:189
The chunks of the FlowMap its root’s line draws (section 8.10): a virtual timeline’s, or a switched card’s; null for a line that draws none.
frame#
readonlyframe:GroupFrame|null
Defined in: layout/src/traversal.ts:191
The frame whose member card draws it, null for an ungrouped root’s card and an ancestor card.
h#
readonlyh: (size) =>number
Defined in: layout/src/traversal.ts:255
Parameters#
size#
number
Returns#
number
index#
readonlyindex:TraversalIndex
Defined in: layout/src/traversal.ts:225
Its children by parent and its lines’ sources, built once by the traversal.
L#
readonlyL:number
Defined in: layout/src/traversal.ts:231
The graphical length L.
lambda#
readonlylambda:Real
Defined in: layout/src/traversal.ts:229
The root’s length λ, or its reach when its length is not known.
leaderOf#
readonlyleaderOf: (label) =>Styled
Defined in: layout/src/traversal.ts:261
The leader line joining the label label to its element, held by the label (section 6.6).
Parameters#
label#
Returns#
manifest#
readonlymanifest:Manifest
Defined in: layout/src/traversal.ts:174
The manifest drawn, in canonical order: the band order of each timeline is read from it.
Inherited from#
mapped#
Defined in: layout/src/traversal.ts:264
A conversion map, which has no label element.
Parameters#
at#
entry#
map#
{ } | { } | { } | { } | { } | { } | { } | { } | { } | { }
Returns#
measure#
readonlymeasure:TextMeasure
Defined in: layout/src/traversal.ts:177
Inherited from#
measured#
readonlymeasured: (owner,text) =>Measured
Defined in: layout/src/traversal.ts:262
Parameters#
owner#
text#
string
Returns#
member#
readonlymember:MemberDrawing
Defined in: layout/src/traversal.ts:184
over#
readonlyover: (entry,start,end) =>PlayedSpan|undefined
Defined in: layout/src/traversal.ts:213
The span from start to end of the own axis of entry’s timeline as it is drawn (section
8.10): whole on a card drawn as written; in entry’s piece on a switched card, undefined
where it does not reach into it.
Parameters#
entry#
start#
end#
Returns#
PlayedSpan | undefined
owned#
Defined in: layout/src/traversal.ts:273
The element at of entry, held by its band of facet; types the classes a region’s type
statement names (core’s regionClasses), which its key carries.
Parameters#
type#
"symbol" | "name" | "timeline" | "child" | "ancestor" | "block" | "frame" | "card" | "band" | "ancestor_card" | "ellipsis" | "region" | "jump" | "label" | "break" | "section_break" | "barline" | "boundary" | "cross_section" | "fork" | "alignment_anchor" | "leader" | "wedge" | "elision"
at#
entry#
facet#
Facet
types?#
readonly string[]
Returns#
placement#
readonlyplacement:Placement
Defined in: layout/src/traversal.ts:175
Inherited from#
play#
readonlyplay: (entry,value) =>Real|undefined
Defined in: layout/src/traversal.ts:218
A position of the member drawing’s root’s axis as written, drawn in entry’s piece: itself
on a card drawn as written.
Parameters#
entry#
value#
Returns#
Real | undefined
reading#
readonlyreading:FlowReading|null
Defined in: layout/src/traversal.ts:179
The reading in force of flow control (section 1): what it does not read is faded; null for none.
Inherited from#
relativeEnd#
readonlyrelativeEnd: (entry) =>number
Defined in: layout/src/traversal.ts:254
The distance of a timeline’s end Xe from the root’s start: L for the root’s open end.
Parameters#
entry#
Returns#
number
relativeX#
readonlyrelativeX: (value) =>number
Defined in: layout/src/traversal.ts:242
L × u: an exact position’s distance from the root’s start at full scale, which every first
fit measures (section 3.2).
Parameters#
value#
Returns#
number
root#
readonlyroot:object
Defined in: layout/src/traversal.ts:220
The timeline drawn as the root.
rootEntry#
readonlyrootEntry:Entry
Defined in: layout/src/traversal.ts:223
S#
readonlyS:number
Defined in: layout/src/traversal.ts:233
The card spacing S (sections 6.2 and 8.6): the gap between its rows and between its bands.
styled#
readonlystyled: (key,parent) =>Styled
Defined in: layout/src/traversal.ts:258
Parameters#
key#
parent#
Returns#
textOf#
Defined in: layout/src/traversal.ts:259
Parameters#
owner#
kind#
"name" | "label"
Returns#
u#
readonlyu: (value) =>number
Defined in: layout/src/traversal.ts:237
The proportion u of an exact position on the root’s axis (section 3.2).
Parameters#
value#
Returns#
number
unfolding#
readonlyunfolding:Unfolding|null
Defined in: layout/src/traversal.ts:196
How its tree is unfolded onto a FlowMap’s virtual axis, on a switched card or a card of a switched frame (section 8.10); null for a card drawn as written.
V#
readonlyV:number
Defined in: layout/src/traversal.ts:235
The card margin V (sections 6.5 and 8.6): empty space above its first row or band and below its last.
Styled#
Defined in: layout/src/traversal.ts:48
A drawn element: its address and its cascaded style.
Extended by#
Properties#
address#
readonlyaddress:ElementAddress
Defined in: layout/src/traversal.ts:49
style#
readonlystyle:Style
Defined in: layout/src/traversal.ts:50
TraversalIndex#
Defined in: layout/src/traversal.ts:130
The relationships every later layout pass reads from the one pre-order traversal.
Properties#
childrenByParent#
Defined in: layout/src/traversal.ts:132
Direct children in traversal order, keyed by their parent’s entry.
segmentsByLine#
Defined in: layout/src/traversal.ts:139
The segments of each segment line, in traversal order, its pieces’ on a switched card’s root.
sourcesByLine#
Defined in: layout/src/traversal.ts:137
The line itself and the segments without a line whose bands join it, in traversal order; a switched card’s root followed by its pieces.
Functions#
endOf()#
endOf(
timeline,topLevel,open?):LineEnd
Defined in: layout/src/traversal.ts:440
How a timeline drawn up to its end ends (section 6.6): an open end with three chevrons.
Parameters#
timeline#
{ }
topLevel#
boolean
open?#
boolean = false
Returns#
known()#
known<
K,V>(map,key):V
Defined in: layout/src/traversal.ts:418
What map holds under key: a stage reads only what an earlier stage of the pipeline set.
Type Parameters#
K#
K
V#
V
Parameters#
map#
ReadonlyMap<K, V>
key#
K
Returns#
V
maxSize()#
maxSize(
items,fallback?):number
Defined in: layout/src/traversal.ts:432
The largest font size among items, or fallback when there are none.
Parameters#
items#
readonly Styled[]
fallback?#
number = 9
Returns#
number
nth()#
nth<
T>(items,index):T
Defined in: layout/src/traversal.ts:425
The item at index of items, which holds one there.
Type Parameters#
T#
T
Parameters#
items#
readonly T[]
index#
number
Returns#
T
rootPieces()#
rootPieces(
scope): readonlyEntry[]
Defined in: layout/src/traversal.ts:409
The pieces of the root of scope (section 8.10), in their order: the
entries a switched card’s or a carried card’s root draws its tree in,
one per stretch piece, held by the root itself (a segment without a line
joins the root’s line too, held by a piece); none on a card drawn as
written.
Parameters#
scope#
Returns#
readonly Entry[]
rowPitch()#
rowPitch(
scope,size):number
Defined in: layout/src/traversal.ts:436
The pitch max(10 + S, h(size)) of a row whose name has font size size.
Parameters#
scope#
size#
number
Returns#
number
shown()#
shown(
style):boolean
Defined in: layout/src/traversal.ts:415
Whether a style displays its element: its display is inline.
Parameters#
style#
Returns#
boolean
traverse()#
traverse(
context,member,holder,S,V,frame,flow?,switched?):Scope
Defined in: layout/src/traversal.ts:457
Traverse one timeline drawn as a root (section 6.1), its line held by
holder, the block or its group’s frame, in a card of spacing S and
margin V, a member card of frame where one is given, its line drawing
the chunks flow where they are given (section 8.10). Where switched
is given, the card is switched or a card of a switched frame (section
8.10): the root holds nothing and spans the virtual axis, named name
where that is given, and every element of its tree is visited once per
stretch piece it reaches into, clipped to it, in the order of the pieces.
Parameters#
context#
member#
holder#
S#
number
V#
number
frame#
GroupFrame | null
flow?#
DrawnFlow | null = null
switched?#
{ name: string | null; unfolding: Unfolding; } | null = null
Returns#
withAxis()#
withAxis(
scope,axis):Scope
Defined in: layout/src/traversal.ts:754
scope drawn on the elided axis axis of its card (sections 3.2 and 8.9).