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-replay -
Install dependencies:
npm install -
Add 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 -
Open your browser to
http://localhost:3000and you should see the replay interface. The repo includes sample data from the 2024 Australian Grand Prix to get you started immediately.
Final Thoughts
As a developer, projects like this are inspiring. They take a public but complex data source and make it accessible and engaging. Whether you’re an F1 fan wanting to analyze a race, a frontend dev looking for a cool timeline project to study, or someone interested in sports data visualization, f1-race-replay is a great resource. It’s practical, open, and demonstrates how a bit of code can unlock the stories hidden in streams of data.
Check out the project, run the sample race, and maybe even fork it to add your own features—like telemetry overlays or different track maps.
Follow for more cool projects: @githubprojects
Repository: https://github.com/IAmTomShaw/f1-race-replay