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#

readonly length: Real | null

Defined in: maps/timestamp.ts:58

Inherited from#

TimelineAxis.length

mapOrdinates?#

readonly optional mapOrdinates?: 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#

TimelineAxis.mapOrdinates

maps#

readonly maps: readonly ({ } | { } | { } | { } | { } | { } | { } | { } | { } | { })[]

Defined in: maps/timestamp.ts:67

Inherited from#

TimelineAxis.maps

name#

readonly name: string

Defined in: maps/timestamp.ts:55

The timeline’s name, or its whole ID without one.

Inherited from#

TimelineAxis.name

numberType#

readonly numberType: NumberType

Defined in: maps/timestamp.ts:57

Inherited from#

TimelineAxis.numberType

offset#

readonly offset: Real

Defined in: maps/timestamp.ts:113

ordinate?#

readonly optional ordinate?: 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#

TimelineAxis.ordinate

reach?#

readonly optional reach?: 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#

TimelineAxis.reach

scale?#

readonly optional scale?: Real

Defined in: maps/timestamp.ts:114

timeline#

readonly timeline: string

Defined in: maps/timestamp.ts:53

Inherited from#

TimelineAxis.timeline

unit#

readonly unit: TimeUnit

Defined in: maps/timestamp.ts:56

Inherited from#

TimelineAxis.unit

valueless?#

readonly optional valueless?: 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#

readonly anchor: TimelineAxis

Defined in: maps/timestamp.ts:168

block#

readonly block: string

Defined in: maps/timestamp.ts:166

granularity#

readonly granularity: Granularity

Defined in: maps/timestamp.ts:167

members#

readonly members: readonly CrossSectionMember[]

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#

readonly knots: Knots

Defined in: maps/timestamp.ts:569

named#

readonly named: { } | null

Defined in: maps/timestamp.ts:571

spec#

readonly spec: CrossSectionSpec

Defined in: maps/timestamp.ts:568

timestamp#

readonly timestamp: 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#

readonly map: string | null

Defined in: maps/timestamp.ts:220

timeline#

readonly timeline: 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#

readonly invertible: 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#

readonly member: CrossSectionMember

Defined in: maps/timestamp.ts:231

The timeline the row belongs to; the anchor’s offset is 0.

missingKnots#

readonly missingKnots: 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#

readonly numberType: 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#

readonly row: Row

Defined in: maps/timestamp.ts:229

start#

readonly start: Rational

Defined in: maps/timestamp.ts:233

Where the member starts on the anchor’s axis: its offset, exactly.

unit#

readonly unit: 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#

Rational

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#

CoordinateValue

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#

Rational

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#

readonly length: Real | null

Defined in: maps/timestamp.ts:58

mapOrdinates?#

readonly optional mapOrdinates?: 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#

readonly maps: readonly ({ } | { } | { } | { } | { } | { } | { } | { } | { } | { })[]

Defined in: maps/timestamp.ts:67

name#

readonly name: string

Defined in: maps/timestamp.ts:55

The timeline’s name, or its whole ID without one.

numberType#

readonly numberType: NumberType

Defined in: maps/timestamp.ts:57

ordinate?#

readonly optional ordinate?: 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?#

readonly optional reach?: 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#

readonly timeline: string

Defined in: maps/timestamp.ts:53

unit#

readonly unit: 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#

readonly block: string

Defined in: maps/timestamp.ts:209

granularity#

readonly granularity: Granularity

Defined in: maps/timestamp.ts:213

The granularity of its spec: decimals is how many places its floats are shown with.

parts#

readonly parts: readonly TimestampPart[]

Defined in: maps/timestamp.ts:214

timeline#

readonly timeline: 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#

readonly id: string

Defined in: maps/timestamp.ts:186

missingKnots#

readonly missingKnots: 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#

readonly name: string | null

Defined in: maps/timestamp.ts:187

targetUnit#

readonly targetUnit: TimeUnit | null

Defined in: maps/timestamp.ts:188

value#

readonly value: 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#

readonly maps: readonly TimestampMap[]

Defined in: maps/timestamp.ts:204

name#

readonly name: string

Defined in: maps/timestamp.ts:200

numberType#

readonly numberType: NumberType

Defined in: maps/timestamp.ts:202

position#

readonly position: CoordinateValue

Defined in: maps/timestamp.ts:203

timeline#

readonly timeline: string

Defined in: maps/timestamp.ts:199

unit#

readonly unit: 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#

readonly editable: boolean

Defined in: maps/timestamp.ts:656

label#

readonly label: string

Defined in: maps/timestamp.ts:653

missing#

readonly missing: string | null

Defined in: maps/timestamp.ts:655

row#

readonly row: Row

Defined in: maps/timestamp.ts:651

timeline#

readonly timeline: string

Defined in: maps/timestamp.ts:652

value#

readonly value: 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#

const VALUELESS_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#

Roots

timeline#

string

Returns#

CrossSectionMember[]


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#

MeasureKnot

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#

Pin

position#

Rational

Returns#

Pin


positionFor()#

positionFor(pin, row, value): Problem | Rational

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#

Pin

row#

Row

value#

Rational

Returns#

Problem | Rational


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#

CrossSectionSpec

row#

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 p minus 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 h of p minus the offset (snapValue), the offset added.

  • A map’s value of any other member: v, the map’s value at p, is snapped within hv, half the absolute difference of its values at p − h and p + 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#

CrossSectionSpec

row#

Row

p#

number

h#

number

knots?#

Knots = "no_server"

Returns#

Rational

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#

TimelineAxis


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#

CrossSectionSpec

position#

Rational

knots?#

Knots = "no_server"

Returns#

Timestamp


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#

Pin

Returns#

Json


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.

Parameters#

pin#

Pin

Returns#

TimestampRow[]