Skip to main content

Type Alias: TimeScaleFit

TimeScaleFit = "pane" | "preset" | number | TimeUnitWidth

Defined in: layout/viewport/time-scale-model.ts:39

The density mode — what pxPerMs resolves to (renamed from TimeScaleZoom, issue #84 — "zoom" was one word for this mode, the zoomTo density knob, and the zoomBy gesture). 'pane' (default) fits the measured pane width; 'preset' ignores it and uses the preset's own density; a TimeUnitWidth states one unit's width in pixels ("a day is 14px"); an explicit number is pixels per millisecond, what Viewport.zoomTo/zoomBy write.

The number form is the expert one, and TimeUnitWidth is the shorthand an app author reaches for. Both land on the same pxPerMs, but only one of them can be written by hand without asserting that a day is always 24 hours (#15) — see TimeUnitWidth.

'pane' fills the pane down to the preset's minTickWidthPx floor. A range wider than that scrolls, on purpose (issue #477): to see more, choose a coarser preset — the library never picks one for you.