ScaleXTime
Temporal x position scale (time-of-day).
Defaults
- helper
scaleXTime- family
position-temporal- aesthetic
x- scale type
time- temporalKind
time- options type
TemporalScaleOptions
Svelte component
import { GGPlot, GeomPoint, ScaleXTime } from "@ggsvelte/svelte";
<GGPlot data={rows} aes={{ x: "x", y: "y" }}>
<ScaleXTime />
<GeomPoint />
</GGPlot> JSON scales
{
"scales": {
"x": {
"type": "time",
"temporalKind": "time"
}
}
} Params
domainArray<DomainValue>Explicit domain, PINNING the scale: [min, max] for continuous scales (numbers, or temporal strings for time); the full category list for band scales. Data outside the domain is dropped with a warning.
nicebooleanRound the inferred domain to tick-friendly bounds. Default true. Ignored when `domain` is set.
reversebooleanReverse the scale's output direction. Default false.
breaksArray<number | string>Explicit tick positions in data units (numbers, or ISO date strings for time scales); for binned scales these are the bin boundaries. Omit for automatic ticks. Binned scales allow at most 65 boundaries (64 bins); non-binned explicit ticks are not capped.
labelsstringTick label format string. Time scales: strftime-style ("%Y-%m", "%b %d", "%H:%M"). Numeric scales: ",d" (grouped integer), ".1f" (fixed decimals), ".0%" (percent), "~s" (SI prefix). Omit for automatic formatting.
expandScaleExpansionDisplay-domain padding. Non-temporal continuous/binned axes default to { mult: 0.05, add: 0 }; time axes default to zero. Pinned domains still receive display expansion.
oob"censor" | "squish"Out-of-bounds policy for values outside explicit source limits, applied before stats. "censor" (default) drops them to missing; "squish" clamps them to the nearest source limit before transform.
naValuenumber | unknownReplacement for missing/censored positional values, resolved after OOB and before transform. A finite number substitutes; null (default) keeps them missing. The replacement is itself checked against the transform/domain rules.
minorBreaksArray<number>Explicit minor gridline positions in semantic source units. Coincident major/minor values render only the major tick. Time scales use dateMinorBreaks instead.
parseTemporalParserSpecExplicit deterministic parser for temporal source values. Omit for value-driven inference.
parseFailure"error" | "censor"Explicit parser failure policy: "error" (default) stops with bounded evidence; "censor" converts invalid values to missing and emits a warning.
timezonestringIANA timezone used for timezone-less temporal input. Default "UTC". Invalid zones fail with an actionable diagnostic.
disambiguation"compatible" | "earlier" | "later" | "reject"DST gap/fold policy for IANA local times. Default "reject"; choose "earlier", "later", or Temporal-compatible behavior explicitly.
dateBreaksstringA positive integer calendar interval such as "2 weeks", "3 months", or "10 years". Canonical units are millisecond, second, minute, hour, day, week, month, quarter, and year.
dateMinorBreaksstringA positive integer calendar interval such as "2 weeks", "3 months", or "10 years". Canonical units are millisecond, second, minute, hour, day, week, month, quarter, and year.
dateLabelsstringStrict temporal label format. Supported tokens: %Y %y %m %b %B %d %e %a %A %H %I %M %S %L %p %q %z %Z %%.
localestringBCP 47 locale for temporal labels. Default "en-US". JSON Schema bounds the portable string shape; runtime validation canonicalizes the tag and verifies Intl support before rendering.
weekStart"monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday"Week boundary used by temporal interval breaks. Default "monday".
guideGuideSpec | BandAxisGuideSpecGuide presentation override (legend, colorbar, colorsteps, or none).
Guide interaction
Axis guide on the position channel (band axis guide when type is band). Set guide to customize ticks/labels or guide: "none" to hide.