Skip to main content

Interface: TimeScale

Defined in: time/scale.ts:63

Properties​

contentWidth​

readonly contentWidth: number

Defined in: time/scale.ts:89

Px extent of the whole range at this zoom — what the x ScrollAxis binds as its content width.


pxPerMs​

readonly pxPerMs: number

Defined in: time/scale.ts:70

Density: content px per ms, constant across the whole range at this zoom. What Viewport.zoomBy reads before scaling it — every other quantity zoomTo/zoomBy need already existed. It's a Cartesian scale — constant by construction, not a per-point read.


range​

readonly range: TimeSpan

Defined in: time/scale.ts:64


timeZone​

readonly timeZone: string

Defined in: time/scale.ts:66

Dataset's IANA timeZone (D6, #37 — one name for this concept, matching plans/02's DatasetOptions).

Methods​

instantForX()​

instantForX(x): Instant

Defined in: time/scale.ts:72

Parameters​

x​

number

Returns​

Instant


spanForPixels()​

spanForPixels(span): TimeSpan

Defined in: time/scale.ts:87

What time a pixel extent stands for. Clamps to [0, contentWidth] first (there is no time outside the content), so a caller hands over whatever pixels it has and never repeats the bound itself. Half-open, like every other span. A zero-width extent answers a degenerate span, which is the honest reading: no pixels stand for no time.

Parameters​

span​

PixelSpan

Returns​

TimeSpan


ticks()​

ticks(step, span): readonly Tick[]

Defined in: time/scale.ts:82

Ticks whose cell [x, x + width) intersects span, aligned to step's boundary in the dataset zone — the cell covering span.x is emitted even when its own x is left of span. Whole-range callers pass { x: 0, width: contentWidth } — and are greppable.

Throws InvalidSnapIncrementError when step.increment is not a positive whole number — a step-driven caller normally never sees this: every shipped and custom preset already rejects a bad tickIncrement/header increment at registration (time/presets.ts), so the throw only reaches a caller building a TickStep by hand.

Parameters​

step​

TickStep

span​

PixelSpan

Returns​

readonly Tick[]


widthForDuration()​

widthForDuration(d, at): number

Defined in: time/scale.ts:73

Parameters​

d​

Duration

at​

Instant

Returns​

number


xForInstant()​

xForInstant(i): number

Defined in: time/scale.ts:71

Parameters​

i​

Instant

Returns​

number