Turn F1 Timing Data Into a Live Race Replay
Ever wondered what happens to all the raw timing data generated during a Formula One race? The lap times, sector splits, and driver positions are a goldmine for storytelling, but they usually just scroll by in a table or get summarized in a graphic. What if you could take that data and reconstruct the entire race, lap by lap, as an interactive replay?
That’s exactly what the f1-race-replay project does. It’s a developer tool that ingests the raw, often messy, timing data from an F1 session and transforms it into a clean, visual, and interactive race replay you can run in your browser. It’s for developers, data enthusiasts, and F1 fans who want to go deeper than the broadcast.
What It Does
In simple terms, this project is a data pipeline and a visualizer. You feed it a JSON file containing the official F1 timing data (which you can capture from live streams or find in archives). The tool then processes this data, calculating gaps, positions, and lap history, and finally serves up a local web application. This app lets you play, pause, and scrub through the entire race session, watching the driver positions update on a mini-track, alongside a live leaderboard and detailed lap time tables.
Why It’s Cool
The clever part isn’t just the visualization—it’s the data transformation. Raw F1 timing data isn’t a simple log of positions; it’s a stream of stateful messages. This project reverse-engineers that stream to build a coherent timeline of the race. It handles pit stops, retirements, and sector times, turning a complex data feed into a structured narrative.
For developers, it’s a fantastic case study in parsing real-time data, state management, and building a timeline-based UI. You can see how the race unfolded strategically, like watching a pit window open or seeing how a driver’s pace changed on different tire compounds. It turns abstract numbers into a tangible story.
How to Try It
Getting your own replay up and running is straightforward. You’ll need Node.js installed.
Clone the repo:
git clone https://github.com/IAmTomShaw/f1-race-replay.git cd f1-race-replayInstall dependencies:
npm installAdd your data: Place your F1 timing data JSON file (often named
session.json) in the project'sdata/directory.Run the processing script and server:
npm run process-data npm start