Case study · Build · 2026
Grid Watch
The analyst sideThe developer sideThe design side
A live map of California power outages over fire weather. It saves a snapshot every 15 minutes, so every shutoff keeps its history.
Grid Watch is a live map of California power outages set over fire weather, built because the state's outage feed shows only what is out right now. It saves a snapshot every 15 minutes and lines each outage up with the Red Flag Warnings around it. It is built with Next.js, MapLibre, deck.gl and Supabase with PostGIS, and it has been live since November 5, 2026.
- The questionSee the analyst side
Do California’s power outages track fire weather, and how fast does power come back?
- What it doesSee the developer side
A live map that keeps a 15-minute record of California power outages over fire weather.
- The briefSee the designer side
Make an outage feed readable during fire weather, with a page for each event and county.
The short version
- 01
The problem
California’s outage feed only shows what’s out right now. Once the lights come back, that outage is gone from the record.
- 02
What I did
Built a map that saves the feed every 15 minutes and lines each outage up with the Red Flag Warnings around it.
- 03
Where it stands
Live since November 5, 2026. The record grows with every snapshot, and the first big event will get its own page.
Why I built it
When the lights come back, the outage disappears.
California utilities cut power on purpose when wind and dry brush make a downed line dangerous. In October 2019 those shutoffs first reached about 800,000 customer accounts, roughly 2.5 million people.
Cal OES runs a live statewide outage map, and it only shows what’s out right now. Once power returns, the outage drops off the feed. Nobody can go back and check how long a county stayed dark, or whether the outage sat inside a Red Flag Warning.
So I built the record myself. Every 15 minutes Grid Watch saves the feed along with the alerts in force at that moment.
Source for the 2019 figures: 2019 California power shutoffs
Who it’s for
Residents
Checking whether their ZIP is out and what the weather is doing nearby.
Reporters
Who need a customer count with a timestamp and a named source mid-event.
Local officials
Comparing this event with the last one in their county.
Researchers
Testing whether shutoffs line up with the weather the utilities cite.
What it does
A live map with a memory.
Live map
Outages sized by customers out, over NWS fire and wind alerts and active fire perimeters, on 3D terrain.
48-hour replay
Drag the scrubber to play back each snapshot and watch an event spread and restore.
Overlap readout
The share of customers out inside a Red Flag Warning, next to a 30-day baseline for the same zones.
My area
Type a ZIP or an address to see the outages and warnings within 10 miles.
Event pages
Any statewide event past 50,000 customers out gets a page with its peak and restoration curve.
County pages
One page for each of the 58 counties, with current status and history.
Methodology
Every formula and threshold in plain language, linked to its source.
How I built it
When a live feed disagreed with the spec, the feed won.
- 01
Every source, live
Cal OES, NWS, NIFC, map tiles and geocoders
14 of 14 answered in CI on November 5
Caught A module error that hid the check on its first CI run and would have broken the backup job
- 02
Rules from the replies
Paging at the real cap of 1,000 records
The misspelled county field, read as spelled
Planned Covers maintenance and shutoffs alike, so cause text splits the two
- 03
Pipeline tests
38 Vitest tests, 7 on real Postgres with PostGIS
8 Playwright passes at 375 and 1440 px
- 04
Launch checks
Four pages scored by Lighthouse on mobile
90 files through the copy check
Color The map palette measured under simulated deuteranopia
- 05
Live on Nov 5
pg_cron took the first scheduled snapshot at 1:45 PM
The questions
Each view answers one question.
How many customers are out right now, and where?
Which outages are fire shutoffs, and which are maintenance?
What share of customers out sit inside a Red Flag Warning?
Is that share higher than on calm days in the same zones?
How long do outages last?
When does a bad day count as an event?
How fast does power come back after the peak?
How it works
A scheduled job writes the record every 15 minutes.
- 01
Cal OES and NWS
Outage points and areas
Fire and wind alerts
- 02
Snapshot job
Supabase Edge Function
Reconciles open outages
One transaction per run
Runs on pg_cron every 15 minutes, with a GitHub Action as backup if data goes 30 minutes stale
- 03
Postgres + PostGIS
Tables closed by row-level security
Public reads through views
90 days of raw rows
- 04
Next.js site
Served at /gridwatch
Cached server pages
Map API routes
Also reads NIFC fire perimeters, live and cached for 15 minutes
An outage opens the first time its incident ID shows up. It closes once it’s missing from 2 successful snapshots in a row.
A failed fetch never counts as a miss. That way a feed hiccup can’t make it look like power came back.
The math
Every number on the map has a rule behind it.
Counts are customer accounts. One account is one meter, which can cover a whole household.
Customers out and duration
- customers outthe sum of customers across open incidents in a snapshot
- durationlast seen minus start
The start is the utility’s own start time when it’s no later than Grid Watch’s first sighting. A later utility time is treated as a data error, and the first sighting wins.
Shutoff or maintenance
- shutoffa planned outage whose cause text names a shutoff or fire risk
Cal OES files routine maintenance as Planned too. Terms such as PSPS, power shutoff, wildfire and fire weather mark the real shutoffs. Every other planned outage counts as maintenance.
- 01
This snapshot
Customers out at each point
Active Red Flag Warning zones
- 02
Inside share
Customers out inside the zones
÷ all customers out
- 03
Calm snapshots
Last 30 days
No warning anywhere in the state
- 04
Baseline share
Customers out inside the same zones
÷ all customers out
Same zones as the warning in 01
Lift
Inside share ÷ baseline share
Left blank when the baseline is 0
Fire-weather overlap
Calm snapshots come from the last 30 days with no Red Flag Warning anywhere in California. Shutoffs and unplanned outages get scored on their own, since utilities schedule shutoffs because of the warning. The site calls lift a correlation.
Events and restoration
- event openswhen statewide customers out reaches 50,000
- event closesafter customers out stays under 10,000 for 6 hours
- time to 50%hours from the peak to the first snapshot at or under half the peak
- time to 90%hours from the peak to the first snapshot at or under a tenth of the peak
Thresholds live in a config table. Restoration times carry 15 minutes of resolution, since that’s how often snapshots land.
What it found
The first Red Flag Warning on the record came and went with no shutoff reported.
- Snapshots stored
- 802
- Snapshots stored
- Snapshots with a Red Flag Warning up
- 209
- Snapshots with a Red Flag Warning up
- Snapshots with a shutoff
- 0
- Snapshots with a shutoff
- Failed Cal OES fetches
- 0
- Failed Cal OES fetches
NWS Los Angeles/Oxnard issued a Red Flag Warning at 1:36 PM on November 5, and the first scheduled snapshot caught it nine minutes later. It stayed up until 6 PM on November 7. No planned outage named a shutoff or fire risk as its cause, then or since.
The highest count so far was 16,728 customers out, at 1:30 PM on November 13. An event opens at 50,000, so the events page is still empty. Since its first run, pg_cron hasn’t missed a quarter hour. These figures run through the 9:45 PM snapshot on November 13, 2026.
Where the first event will show up: Grid Watch events
What the data got wrong
The raw feeds broke a few of my assumptions.
I pulled every feed live before writing a single metric. Each of these would have changed a number on the map.
“Planned” includes routine maintenance
Utilities schedule shutoffs because of the warning
The customers field is spelled Impacted_Cutomers_Not_Planned
The service hands back 1,000 records at a time
Only some utilities publish outage areas
A failed fetch looks like zero outages
Many NWS alerts list zone IDs with no outline
Calm snapshots have no warning zones of their own
Decisions
Built so a bad feed can’t rewrite history.
One transaction per snapshot
A crash mid-run leaves no half-written snapshot behind.
Close after 2 straight misses
One dropped row doesn’t end an outage early.
Metric rules as pure TypeScript
The same code runs in Deno on Supabase and in Node for the backup job and the tests.
Tests against real Postgres
Spatial joins and the transaction get tested the way they run in production.
Reads only through views
Every table is closed by row-level security, so the public site can read the record and has no way to change it.
14 live endpoints checked in CI
Every pull request calls each source once and writes its status and record count to the run summary.
A backup schedule
GitHub Actions takes a snapshot whenever data goes 30 minutes stale.
MapLibre pinned to 5
Version 6 broke the deck.gl terrain overlay and crashed the map on load.
Design
The map reads like an instrument panel at night.
Outages glow amber over a near-black map, and Red Flag Warnings get red hatching. Every color on the map also has a shape, so nothing depends on color alone.
Map keyGrid Watch
- Unplanned outage
- PSPS shutoff
- Planned maintenance
- Red Flag Warning
- Wind alert
- Fire perimeter
- Canvas#050607
- Outage#ffb000
- Red Flag#e5383b
- Wind#7fb2e5
- Perimeter#f2c9a0
Type
Chakra Petch for headings, Inter Tight for text, and Geist Mono for every number so digits hold still as counts change.
Phones first
At 375 px the panels sit in a bottom sheet you can drag, and the map keeps the whole screen.
Reduced motion
The event replay doesn’t autoplay, and the scrubber steps between frames.
| Item | Normal | Deuteranopia |
|---|---|---|
| Outage vs wind alert | 113.7 | 112.5 |
| Outage vs Red Flag Warning | 67.4 | 40.5 |
| Red Flag Warning vs fire perimeter | 66.3 | 33.8 |
| Outage vs fire perimeter | 55.8 | 52.2 |
| Outage vs planned maintenance | 33.3 | 31.3 |
The 3D map
In 3D you can see which way the wind blows over each outage.
I modeled this view on FireTrace, Dilum Sanjaya’s wildfire map. It recolors its satellite imagery with a Mapbox paint property that MapLibre doesn’t have.
So Grid Watch repaints each USGS imagery tile in the browser before the map draws it. A custom tile protocol maps every pixel onto a warm charcoal ramp, and water stays dark.
The map I modeled this on: FireTrace
Outage columns
From zoom 8.5 each outage stands as a column. Shutoffs show as wireframes, and the five tallest carry a chip like PG&E PSPS · 12,400 out · since 6:10 AM.
Wind
Streaks drape over the terrain from an Open-Meteo forecast grid, colored by gust. With reduced motion on, they hold still as arrows.
Transmission lines
The California Energy Commission’s map of overhead lines at 60 kV and up. Pieces inside a Red Flag Warning glow red at the frame you’re on.
Conditions card
Click the map for wind, gusts, humidity and temperature at that hour, plus the elevation and the nearest outage.
Fly in downwind
Click an outage of 1,000 or more customers and the camera flies in close, facing the way the wind blows.
Key events
Shutoff starts, warnings going up and coming down, the peak and the biggest restore. Each row jumps the replay to that moment.
Event view
Event pages open low over the terrain at 2x height, with the same controls as the live map.
Column height
- height18 m × √customers out, capped at 4,500 m
A square root keeps big shutoffs readable next to small outages. 100 customers stand 180 m tall and 10,000 stand 1,800 m. The cap arrives at 62,500.
Wind and lines
- state gridabout 170 points at 0.5°, cached 3 hours
- close-up gridup to 300 points at about 0.1° around a zoomed 3D view, cached 3 hours
- line in a warninga piece of line 2 km or shorter whose midpoint sits inside an active Red Flag Warning
Open-Meteo’s free tier allows 10,000 calls a day, and each point counts as one. Close-up grids snap to half degrees so nearby views share a cache, which keeps the worst case near 1,400 calls for the state grid plus 2,400 per busy view.
Where it stands
Live, with the record still filling in.
- Between snapshots
- 15 min
- Between snapshots
- County pages
- 58
- County pages
- Unit tests passing, plus 7 that run on real Postgres
- 31
- Unit tests passing, plus 7 that run on real Postgres
- Live source checks passing in CI
- 14/14
- Live source checks passing in CI
The first source check saw 263 outage incidents and 121 outage areas. No fire or wind alerts were up that morning, and a Red Flag Warning followed in the afternoon.
| Item | Performance | Accessibility | Best practices | SEO |
|---|---|---|---|---|
| County page | 96 | 100 | 100 | 100 |
| Methodology | 96 | 100 | 100 | 100 |
| Live map | 69 | 100 | 96 | 100 |
| Event page | 68 | 100 | 96 | 100 |
What’s next
What I’d do with a full fire season of data.
Next
The first big event
Write it up once something passes 50,000 customers, with its restoration times and lift.
Shutoffs outside warnings
Measure how many shutoff customers sat outside any Red Flag Warning, by utility.
A faster map
Load terrain and the outage layer after first paint to cut the 4,100 ms of blocking time.
Open data
Publish a daily CSV of statewide totals so others can check the work.
Known limits
Reported data
Grid Watch shows what utilities report to Cal OES. Each utility’s own map stays the official word, and the site links to it.
Correlation
Overlap can’t show that a warning caused a shutoff.
Shutoff labels
Grid Watch spots a shutoff by its cause text. One filed as Planned under a vaguer cause counts as maintenance.
Line status
The transmission layer shows where lines run. It can’t say whether a line is energized.
Modeled wind
Wind is a model forecast for 10 m above the ground. Replay frames older than 48 hours show none.
A young record
History starts in November 2026, so the 30-day baseline is still filling in.
TL;DR
Built
A live map of California power outages over fire weather, with a snapshot saved every 15 minutes.
Found
The first Red Flag Warning on the record came and went with no shutoff reported.
By the numbers
- Snapshots stored
- 802
- Snapshots with a Red Flag Warning up
- 209
- Snapshots with a shutoff
- 0
The catch
The record is young. One quiet warning says little about a full fire season.
Next
Write up the first big event once statewide customers out pass 50,000, with its restoration times.