04Data visualisation · WebGPU map
Third Mainland
A GPU-rendered night map of how Lagos moves through a day
An installable web app where 40,000 particles flow along Lagos’s real roads, BRT lanes, rail lines and ferry routes. Scrub the clock or switch to a Saturday or a rain day, and every corridor’s speed, journey time and timetable changes with it.

Everyone in Lagos knows Third Mainland Bridge is slow at 07:40, but traffic is usually shown as a red line on a map with no sense of rhythm. I wanted a map that shows the city breathing through a day — and runs smoothly on an ordinary phone, not just a gaming laptop.
- 01Scrub the day on a demand histogram, jump to the morning peak, midday, evening peak or night, or press play to run the clock.
- 02Switch between a weekday, a Saturday (midday market peak, thinner timetables) and a rain day (less road capacity, fewer ferries).
- 03Tap any corridor, or pick it from a sortable list, for both directions’ speed and end-to-end time, or headway and next departure for transit.
- 04Every figure on the map is also in a plain table view, and the app installs and works offline after the first visit.
- D-01
Move the dots on the GPU, write two numbers per road on the CPU
Each particle is one instance of a quad with its corridor, direction and phase packed into attributes once. Every frame the CPU writes only how far the flow has advanced and how full the road is into a small texture; the vertex shader looks up the route in a path texture and places the dot. When nothing moves, the map only redraws on change.
Trade-offShader code is harder to debug than DOM or Canvas 2D, but 40,000 moving points stay smooth on a mid-range phone.
- D-02
WebGPU first, with two fallbacks
The three.js WebGPU renderer falls back to WebGL 2 automatically, and again if a WebGPU device is lost at start-up. If neither starts, the table view becomes the whole app instead of a blank screen.
Trade-offEvery visual has to work on two backends, which limits some effects, but nobody gets an empty canvas.
- D-03
Real geometry, an honest model
A small TypeScript pipeline pulls roads and routes from OpenStreetMap, traces each corridor with Dijkstra and simplifies it into a 125 KB file. The traffic on top is a hand-tuned model using the BPR speed curve transport planners use, and an “Illustrative” badge on screen explains exactly that.
Trade-offIt cannot tell you about today’s traffic, but it never pretends to.
- Flows come from a modelled day, not live traffic data.
- Map data covers a box around central Lagos, not the whole state.