maps/timestamp#
Interfaces#
CrossSectionMember#
Defined in: maps/timestamp.ts:112
A timeline a timestamp may hold: its zero lies offset from the anchor’s
zero, on the anchor’s axis, exactly. A member of a group the anchor is a
member of, read by the group (a groupstamp’s), has a scale too: the
members of a group start and end together, so its coordinate is the
anchor’s times its drawn length over the anchor’s. Its coordinate at a
position p on the anchor’s axis is (p − offset) × scale, scale 1
where it is not given. Where the length of such a member, or of the
anchor’s member, is not known, the group gives it no coordinate (one
member’s length is never carried to another): it is valueless, its
scale (a drawn length over another) only says where its drawing is
crossed, and none of its rows has a value.
Extends#
Properties#
length#
readonlylength:Real|null
Defined in: maps/timestamp.ts:58
Inherited from#
mapOrdinates?#
readonlyoptionalmapOrdinates?:ReadonlyMap<string,number>
Defined in: maps/timestamp.ts:81
The ordinate, in the same units, of each map’s drawing (by the map’s ID)
in the card the reading crosses the timeline in; a map drawn nowhere
there has no entry. A part’s rows are listed top to bottom by these
and ordinate (timestampRows).
Inherited from#
maps#
readonlymaps: readonly ({ } | { } | { } | { } | { } | { } | { } | { } | { } | { })[]
Defined in: maps/timestamp.ts:67
Inherited from#
name#
readonlyname:string
Defined in: maps/timestamp.ts:55
The timeline’s name, or its whole ID without one.
Inherited from#
numberType#
readonlynumberType:NumberType
Defined in: maps/timestamp.ts:57
Inherited from#
offset#
readonlyoffset:Real
Defined in: maps/timestamp.ts:113
ordinate?#
readonlyoptionalordinate?:number
Defined in: maps/timestamp.ts:74
The ordinate, in canvas units of its block’s drawing, of the drawn line
at which the reading crosses the timeline (its own line, an ancestor
line, a segment line holding it); absent where it is not drawn there.
The rows of a timestamp are listed top to bottom by it (timestampRows).
Inherited from#
reach?#
readonlyoptionalreach?:Real
Defined in: maps/timestamp.ts:66
Where length is null, the coordinate on the timeline’s own axis at
which the drawing the reading crosses it in ends it (its reach there);
absent where it is not drawn there. Only which positions cross the
timeline (timestampAt) reads it: a value past it is still a value of
the timeline (positionFor).
Inherited from#
scale?#
readonlyoptionalscale?:Real
Defined in: maps/timestamp.ts:114
timeline#
readonlytimeline:string
Defined in: maps/timestamp.ts:53
Inherited from#
unit#
readonlyunit:TimeUnit
Defined in: maps/timestamp.ts:56
Inherited from#
valueless?#
readonlyoptionalvalueless?:boolean
Defined in: maps/timestamp.ts:115
CrossSectionSpec#
Defined in: maps/timestamp.ts:165
What a timestamp is read from: the anchor, the members its cross-section may hold (the anchor excluded, in the order given: by the canvas’s convention the anchor’s ancestors, parent first, then the timelines its line crosses), and the granularity its floats are shown with and its pointer positions picked to. An ancestor’s span holds its descendant’s, so an ancestor is crossed wherever its descendant is.
Properties#
anchor#
readonlyanchor:TimelineAxis
Defined in: maps/timestamp.ts:168
block#
readonlyblock:string
Defined in: maps/timestamp.ts:166
granularity#
readonlygranularity:Granularity
Defined in: maps/timestamp.ts:167
members#
readonlymembers: readonlyCrossSectionMember[]
Defined in: maps/timestamp.ts:169
Pin#
Defined in: maps/timestamp.ts:567
A pinned timestamp: what it is read from, the expanded MeasureMaps it was
read with (or why they are not at hand), the timestamp itself, and the
named timestamp it shows (null for an unnamed one), whose timeline is
the anchor.
Properties#
knots#
readonlyknots:Knots
Defined in: maps/timestamp.ts:569
named#
readonlynamed: { } |null
Defined in: maps/timestamp.ts:571
spec#
readonlyspec:CrossSectionSpec
Defined in: maps/timestamp.ts:568
timestamp#
readonlytimestamp:Timestamp
Defined in: maps/timestamp.ts:570
Row#
Defined in: maps/timestamp.ts:218
A row of a cross-section: the timeline’s own coordinate (map null) or the value of its map map.
Properties#
map#
readonlymap:string|null
Defined in: maps/timestamp.ts:220
timeline#
readonlytimeline:string
Defined in: maps/timestamp.ts:219
RowAxis#
Defined in: maps/timestamp.ts:228
A row read both ways. Forward, from a position on the anchor’s axis to the row’s value; backward, from a value to the position on the anchor’s axis where the row takes it.
Properties#
invertible#
readonlyinvertible:boolean
Defined in: maps/timestamp.ts:239
Whether a value of the row leads back to one position over the member’s span: always for a coordinate; for a map, while it is invertible there.
member#
readonlymember:CrossSectionMember
Defined in: maps/timestamp.ts:231
The timeline the row belongs to; the anchor’s offset is 0.
missingKnots#
readonlymissingKnots:KnotsAbsence|null
Defined in: maps/timestamp.ts:241
Why a map reading a MeasureMap without its expanded rows gives nothing; null for every other row.
numberType#
readonlynumberType:NumberType|null
Defined in: maps/timestamp.ts:237
The number type of the row’s values: the member’s for its coordinate, its target unit’s for a map (null without one).
row#
readonlyrow:Row
Defined in: maps/timestamp.ts:229
start#
readonlystart:Rational
Defined in: maps/timestamp.ts:233
Where the member starts on the anchor’s axis: its offset, exactly.
unit#
readonlyunit:TimeUnit|null
Defined in: maps/timestamp.ts:235
The unit of the row’s values: the member’s for its coordinate, the map’s target unit (null where it names none).
Methods#
expressedAt()#
expressedAt(
position):Expressed|null
Defined in: maps/timestamp.ts:250
The row’s value at position as readers show it, on its unit; null where it gives none.
Parameters#
position#
Returns#
Expressed | null
positionOf()#
positionOf(
value):Rational|null
Defined in: maps/timestamp.ts:261
The position on the anchor’s axis at which the row takes value,
exact: a map’s inverse over the member’s span [0, length], settled on
the member’s axis (a float on a fraction axis to the nearest multiple
of 1 / denominator, any value on an int axis to the nearest integer,
an exact value kept), divided by the scale, the offset added, settled on the anchor’s axis
alike; a coordinate is the value itself. null where none is: the map
is not invertible over the span or gives the value nowhere. The
position is not held to the member’s span.
Parameters#
value#
Returns#
Rational | null
valueAt()#
valueAt(
position):MapResult|undefined
Defined in: maps/timestamp.ts:248
The row’s raw value at position on the anchor’s axis: the member’s
coordinate (position minus the offset, times the scale, written in the
member’s number type), or the map’s result there; undefined where it
gives none.
Parameters#
position#
Returns#
MapResult | undefined
TimelineAxis#
Defined in: maps/timestamp.ts:52
A timeline as a cross-section reads it: its axis, its length (null
when unknown) and its drawn maps, in drawing order.
Extended by#
Properties#
length#
readonlylength:Real|null
Defined in: maps/timestamp.ts:58
mapOrdinates?#
readonlyoptionalmapOrdinates?:ReadonlyMap<string,number>
Defined in: maps/timestamp.ts:81
The ordinate, in the same units, of each map’s drawing (by the map’s ID)
in the card the reading crosses the timeline in; a map drawn nowhere
there has no entry. A part’s rows are listed top to bottom by these
and ordinate (timestampRows).
maps#
readonlymaps: readonly ({ } | { } | { } | { } | { } | { } | { } | { } | { } | { })[]
Defined in: maps/timestamp.ts:67
name#
readonlyname:string
Defined in: maps/timestamp.ts:55
The timeline’s name, or its whole ID without one.
numberType#
readonlynumberType:NumberType
Defined in: maps/timestamp.ts:57
ordinate?#
readonlyoptionalordinate?:number
Defined in: maps/timestamp.ts:74
The ordinate, in canvas units of its block’s drawing, of the drawn line
at which the reading crosses the timeline (its own line, an ancestor
line, a segment line holding it); absent where it is not drawn there.
The rows of a timestamp are listed top to bottom by it (timestampRows).
reach?#
readonlyoptionalreach?:Real
Defined in: maps/timestamp.ts:66
Where length is null, the coordinate on the timeline’s own axis at
which the drawing the reading crosses it in ends it (its reach there);
absent where it is not drawn there. Only which positions cross the
timeline (timestampAt) reads it: a value past it is still a value of
the timeline (positionFor).
timeline#
readonlytimeline:string
Defined in: maps/timestamp.ts:53
unit#
readonlyunit:TimeUnit
Defined in: maps/timestamp.ts:56
Timestamp#
Defined in: maps/timestamp.ts:208
The cross-section of a timeline at a position: the anchor’s part first, then each crossed member’s.
Properties#
block#
readonlyblock:string
Defined in: maps/timestamp.ts:209
granularity#
readonlygranularity:Granularity
Defined in: maps/timestamp.ts:213
The granularity of its spec: decimals is how many places its floats are shown with.
parts#
readonlyparts: readonlyTimestampPart[]
Defined in: maps/timestamp.ts:214
timeline#
readonlytimeline:string
Defined in: maps/timestamp.ts:211
The anchor’s timeline.
TimestampMap#
Defined in: maps/timestamp.ts:185
One map’s value at a timestamp’s position; value is null where the map gives none.
Properties#
id#
readonlyid:string
Defined in: maps/timestamp.ts:186
missingKnots#
readonlymissingKnots:KnotsAbsence|null
Defined in: maps/timestamp.ts:194
Why the map gives no value when it reads a MeasureMap whose expanded
rows are not at hand; null for every other map.
name#
readonlyname:string|null
Defined in: maps/timestamp.ts:187
targetUnit#
readonlytargetUnit:TimeUnit|null
Defined in: maps/timestamp.ts:188
value#
readonlyvalue:Expressed|null
Defined in: maps/timestamp.ts:189
TimestampPart#
Defined in: maps/timestamp.ts:198
One crossed timeline’s part of a timestamp: its coordinate, in its number type, and its maps’ values.
Properties#
maps#
readonlymaps: readonlyTimestampMap[]
Defined in: maps/timestamp.ts:204
name#
readonlyname:string
Defined in: maps/timestamp.ts:200
numberType#
readonlynumberType:NumberType
Defined in: maps/timestamp.ts:202
position#
readonlyposition:CoordinateValue
Defined in: maps/timestamp.ts:203
timeline#
readonlytimeline:string
Defined in: maps/timestamp.ts:199
unit#
readonlyunit:TimeUnit
Defined in: maps/timestamp.ts:201
TimestampRow#
Defined in: maps/timestamp.ts:650
One row of a pinned timestamp as every reader lists it: its row, the
timeline it belongs to, its label (the timeline’s name for its
coordinate; a map’s name, else its ID), its value (null where it has
none; a CombinationMap’s outputs are one value), the text shown instead
of a missing value, and whether an edited value moves the timestamp.
Properties#
editable#
readonlyeditable:boolean
Defined in: maps/timestamp.ts:656
label#
readonlylabel:string
Defined in: maps/timestamp.ts:653
missing#
readonlymissing:string|null
Defined in: maps/timestamp.ts:655
row#
readonlyrow:Row
Defined in: maps/timestamp.ts:651
timeline#
readonlytimeline:string
Defined in: maps/timestamp.ts:652
value#
readonlyvalue:Expressed|null
Defined in: maps/timestamp.ts:654
Type Aliases#
Knots#
Knots = readonly
MeasureKnots[] |KnotsAbsence
Defined in: maps/timestamp.ts:182
The expanded rows of a manifest’s MeasureMaps, or why they are not at hand.
KnotsAbsence#
KnotsAbsence =
"no_server"|"unsupported"|"unreachable"|"pending"|"failed"
Defined in: maps/timestamp.ts:179
Why the expanded rows of a manifest’s MeasureMaps are not at hand: there
is no server to expand them (no_server), the server cannot expand them
(unsupported), no server answered the request (unreachable), its
answer is awaited (pending), or the server refused the request or its
answer lacks a MeasureMap (failed).
Variables#
VALUELESS_TEXT#
constVALUELESS_TEXT:"no value: a length in the group is not known"="no value: a length in the group is not known"
Defined in: maps/timestamp.ts:641
What every row of a valueless member says instead of a value.
Functions#
ancestorMembers()#
ancestorMembers(
manifest,timeline):CrossSectionMember[]
Defined in: maps/timestamp.ts:143
The ancestors of the timeline timeline of manifest as members of its
cross-section, its parent first, up to its root: each one’s zero lies
minus the sum of the offsets from the timeline up to it from the
timeline’s zero, exactly (a parent’s coordinate is its child’s plus the
child’s offset), and each carries no map. Empty for a root and for an ID
no timeline carries.
Parameters#
manifest#
timeline#
string
Returns#
measureText()#
measureText(
record):string
Defined in: maps/timestamp.ts:618
What a measure is shown as: its name, else its number, else its count.
Parameters#
record#
Returns#
string
missingValueText()#
missingValueText(
map):string
Defined in: maps/timestamp.ts:636
What a map that gives no value says instead: why its MeasureMap’s rows are missing, or, for any other map, that it has no value at the position (the position lies outside its domain).
Parameters#
map#
Pick<TimestampMap, "missingKnots">
Returns#
string
pinAt()#
pinAt(
pin,position):Pin
Defined in: maps/timestamp.ts:575
pin moved to position on its anchor’s axis, its timestamp read anew.
Parameters#
pin#
position#
Returns#
positionFor()#
Defined in: maps/timestamp.ts:594
The position on the pin’s anchor axis, exact, at which the row row
takes the edited value (read by parseAxisValue), through the row’s
positionOf. Refused, each as invalid_value at []: a row of a
timeline the timestamp does not show, a map its timeline does not draw, a
row of a valueless member,
a value no position gives (the map is not invertible over its
timeline’s span, or gives the value nowhere), a position outside the
timeline’s [0, length], and one outside the anchor’s (an ancestor’s
value beyond the anchor’s span).
Parameters#
pin#
row#
value#
Returns#
rowAxis()#
rowAxis(
spec,row,knots?):RowAxis|null
Defined in: maps/timestamp.ts:381
The row row of spec read both ways, its maps compiled with knots
(the expanded rows of the manifest’s MeasureMaps, or why they are not at
hand); null where the spec has no such timeline or the timeline no
such map.
Parameters#
spec#
row#
knots?#
Knots = "no_server"
Returns#
RowAxis | null
snapOnRow()#
snapOnRow(
spec,row,p,h,knots?):Rational
Defined in: maps/timestamp.ts:520
The position on the anchor’s axis a pointer picks on the row row
(exact): p is the pointer, in units from the anchor’s zero, h half a
device pixel in the anchor’s units.
A member of an int axis (samples, ticks, pixels), on its coordinate’s row and on every map’s row alike: the integer nearest to
pminus the offset (a tie going up), the offset added, so such a timeline steps by 1 whatever the granularity; no map’s value axis decides its step.Any other member’s own coordinate: the simplest value of the member’s number type within
hofpminus the offset (snapValue), the offset added.A map’s value of any other member:
v, the map’s value atp, is snapped withinhv, half the absolute difference of its values atp − handp + h, under the cap of the map’s target number type (the value’s own kind where the map names no target unit); the snapped value is inverted exactly (RowAxis.positionOf). A map without an inverse there, a value that is no number, or one whose inverse gives nothing falls back to the member’s own coordinate.
The result is held to the member’s span within the anchor’s [0, length].
Parameters#
spec#
row#
p#
number
h#
number
knots?#
Knots = "no_server"
Returns#
Throws#
if p is not finite, h is not finite and
positive, or the spec has no such row.
timelineAxisOf()#
timelineAxisOf(
timeline,maps):TimelineAxis
Defined in: maps/timestamp.ts:85
timeline as a cross-section reads it, with the maps maps (those drawn for it, in drawing order).
Parameters#
timeline#
{ }
maps#
readonly ({ } | { } | { } | { } | { } | { } | { } | { } | { } | { })[]
Returns#
timestampAt()#
timestampAt(
spec,position,knots?):Timestamp
Defined in: maps/timestamp.ts:444
The timestamp of position, exact on the anchor’s axis: the anchor’s
part, then the part of each member, in the order given, whose closed
span [offset, offset + length] holds the position (a boundary two
contiguous members share is crossed by both). Each part’s coordinate is
the position minus its offset, written in its number type, and each map
is evaluated there in the order given. knots are the expanded rows of
the manifest’s MeasureMaps, or why they are not at hand (no_server
when not given); a map reading a MeasureMap without its rows gives no
value and says why (failed when the rows given lack it).
Parameters#
spec#
position#
knots?#
Knots = "no_server"
Returns#
timestampJson()#
timestampJson(
pin):Json
Defined in: maps/timestamp.ts:749
pin’s timestamp as one JSON value: the named timestamp’s members as the
manifest holds them, or, unnamed, {timeline, coordinate} (the anchor’s
coordinate as a bare value on its own axis), then mapping, keyed by ID
in part order: each crossed timeline but the anchor its coordinate dict,
each map of each part its value (null where it gives none); every row of
a valueless member null.
Parameters#
pin#
Returns#
timestampRows()#
timestampRows(
pin):TimestampRow[]
Defined in: maps/timestamp.ts:679
The rows of pin’s timestamp in order: its parts top to bottom where the
reading crosses each one’s timeline (its ordinate in the spec), and
within a part its rows top to bottom as they are drawn: its coordinate at
that ordinate, each map at its entry of the timeline’s mapOrdinates.
Both sorts are stable, every part or row without an ordinate after those
with one, so a part without ordinates lists its coordinate, then its maps
in drawing order. A coordinate is editable; a map while it is
invertible over its timeline’s span. Every row of a valueless member has
no value, says VALUELESS_TEXT instead and is not editable. The
timestamp’s own parts keep the anchor first.