Read the train formation from front to rear, compare reported passenger loads and inspect each car’s amenities, temperature, doors and alerts.
Train Formation and Loads · 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.
snapshotTrainConsistSnapshot | null (optional)
One service with cars ordered front to rear, measured counts, optional journey information and reported car or door flags. Omit for the example or pass null when the service report is unavailable.
indexnumber (optional)
Offsets the entrance cascade in a widget grid.
Data and integration
Preview
An eight-car fictional service with two coupled units. One car has a ventilation alert, one has a reported isolated door and one is missing a passenger count.
Inputs
Send serviceId and cars in physical order, front to rear. Optional route, nextStop with name and etaMinutes, observedAt with an ISO 8601 offset, and stale describe that report. Each car needs a stable id and may include label, unitId, passengers, seats, temperatureC, amenities, doors and alerts. Door states are in-service, fault, isolated or unknown. Each alert supplies id and label, with optional severity advisory, warning or critical.
Source options
Join the confirmed train formation to passenger counters and car telemetry by car ID. Report passenger counts and seat capacity separately. Send the current stop estimate in whole minutes and temperature in degrees Celsius. Publish a fresh snapshot when the source changes. Refresh and door status are owned by the host.
Actions
Swipe, scroll or use the arrow keys along the train. A fade marks each edge with more cars to show. Open a car to inspect its counts, amenities, temperature, door states and alerts. Open the flagged-cars summary to review all reported issues.
Integration requirements
Pass cars: [] for a confirmed empty formation or null for unavailable car data. Use nonnegative whole counts. Reported on board sums available passenger counts and shows coverage. The load ratio is passengers divided by a positive seat count. Zero passengers remains valid. Values above 100% are kept in the text and the bar stops at full width. The plot highlights ratios at or above 85%, with a distinct tone above 100%. Lowest load compares only known ratios and breaks ties in formation order. Stale reports retain readings and hide the ETA and lowest-load shortcut. Reported time is shown in UTC. Nonblank duplicate IDs use the first occurrence. An empty doors or alerts array is explicit, and null or omission means unavailable or unreported. Reported door faults and isolations contribute to the flagged-car count.