Interface: TimeScale
Defined in: time/scale.ts:63
Properties
contentWidth
readonlycontentWidth: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
readonlypxPerMs: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
readonlyrange:TimeSpan
Defined in: time/scale.ts:64
timeZone
readonlytimeZone: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
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
Returns
ticks()
ticks(
step,span): readonlyTick[]
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
span
Returns
readonly Tick[]
widthForDuration()
widthForDuration(
d,at):number
Defined in: time/scale.ts:73
Parameters
d
at
Returns
number
xForInstant()
xForInstant(
i):number
Defined in: time/scale.ts:71
Parameters
i
Returns
number