Compare observed, forecast and timetable train trajectories. Scrub time to check a train’s position and open reported alerts at their exact times.
Train Time–Distance Chart · Preview
Loading widget…
Preparing integration examples…
Source under review
The source code and files will be available after this version passes review.
Idle
API contract
Props for integrating the React component in your app.
snapshotTrainGraphSnapshot | null (optional)
One corridor and time window with station chainages, train trajectories, report time and optional reported alerts. Omit for the example or pass null for an unavailable report.
indexnumber (optional)
Offsets the path entrance in a widget grid.
Data and integration
Preview
Five trains on a fictional coastal route with one telemetry gap, a timetable-only service and a reported alert.
Inputs
Send corridor, startsAt, endsAt, optional observedAt and optional IANA timeZone. Every station needs id, name, km and optional short code. Each service needs id and may include label, description, delayMinutes and separate observed, forecast and timetable series. A series contains ordered { at, km } points or null for a break. Each alert has id, label and at, with optional km, location, serviceIds and details.
Source options
Map observations, predictions and published schedules independently onto the same corridor distance reference and report window. Use Unix milliseconds for every timestamp and kilometres for every distance. Positive delayMinutes means late, negative means early and zero means on time. The host refreshes the snapshot and supplies authoritative alerts.
Actions
Tap a path or use the trains sheet to choose a service. Tap or drag the time cursor, or use the keyboard. An alert with an inspection action moves the cursor to its reported time and selects a linked train when available.
Integration requirements
Provide at least two stations at distinct distances and a positive time window. Points must increase in time and lie within the corridor distance bounds. Invalid points and null entries break a trace. The cursor interpolates only inside a continuous segment, labels approximations and uses observed, forecast, then timetable in that order. It never extrapolates beyond a segment. The timetable of the selected service and services with timetable-only data is visible. Only supplied alerts within the window are shown. Pass services: [] for a confirmed empty window and null for unavailable services. Missing alerts remain unavailable, and an empty list means no alerts reported. An invalid or missing time zone uses UTC.