Skip to content
All projects

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 question

    Do California’s power outages track fire weather, and how fast does power come back?

    See the analyst side
  • What it does

    A live map that keeps a 15-minute record of California power outages over fire weather.

    See the developer side
  • The brief

    Make an outage feed readable during fire weather, with a page for each event and county.

    See the designer side
  1. 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.

  2. 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.

  3. 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.

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

  1. Residents

    Checking whether their ZIP is out and what the weather is doing nearby.

  2. Reporters

    Who need a customer count with a timestamp and a named source mid-event.

  3. Local officials

    Comparing this event with the last one in their county.

  4. Researchers

    Testing whether shutoffs line up with the weather the utilities cite.

A live map with a memory.

  1. Live map

    Outages sized by customers out, over NWS fire and wind alerts and active fire perimeters, on 3D terrain.

  2. 48-hour replay

    Drag the scrubber to play back each snapshot and watch an event spread and restore.

  3. Overlap readout

    The share of customers out inside a Red Flag Warning, next to a 30-day baseline for the same zones.

  4. My area

    Type a ZIP or an address to see the outages and warnings within 10 miles.

  5. Event pages

    Any statewide event past 50,000 customers out gets a page with its peak and restoration curve.

  6. County pages

    One page for each of the 58 counties, with current status and history.

  7. Methodology

    Every formula and threshold in plain language, linked to its source.

When a live feed disagreed with the spec, the feed won.

  1. 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

  2. 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

  3. 03

    Pipeline tests

    38 Vitest tests, 7 on real Postgres with PostGIS

    8 Playwright passes at 375 and 1440 px

  4. 04

    Launch checks

    Four pages scored by Lighthouse on mobile

    90 files through the copy check

    Color The map palette measured under simulated deuteranopia

  5. 05

    Live on Nov 5

    pg_cron took the first scheduled snapshot at 1:45 PM

From the live feeds to the first scheduled snapshot

Each view answers one question.

  1. How many customers are out right now, and where?

    Metric
    Customers out, summed by county and utility
    Shows on
    Live map, county pages
  2. Which outages are fire shutoffs, and which are maintenance?

    Metric
    Shutoff class from the cause text
    Shows on
    Map legend and counts
  3. What share of customers out sit inside a Red Flag Warning?

    Metric
    Inside share
    Shows on
    Overlap readout
  4. Is that share higher than on calm days in the same zones?

    Metric
    Baseline share and lift
    Shows on
    Overlap readout
  5. How long do outages last?

    Metric
    Median and longest duration
    Shows on
    Live stats, county pages
  6. When does a bad day count as an event?

    Metric
    Open and close thresholds
    Shows on
    Event pages
  7. How fast does power come back after the peak?

    Metric
    Hours to 50% and 90% restored
    Shows on
    Event pages

A scheduled job writes the record every 15 minutes.

  1. 01

    Cal OES and NWS

    Outage points and areas

    Fire and wind alerts

  2. 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

  3. 03

    Postgres + PostGIS

    Tables closed by row-level security

    Public reads through views

    90 days of raw rows

  4. 04

    Next.js site

    Served at /gridwatch

    Cached server pages

    Map API routes

    Also reads NIFC fire perimeters, live and cached for 15 minutes

How a snapshot moves from the feeds to the page

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.

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.

  1. 01

    This snapshot

    Customers out at each point

    Active Red Flag Warning zones

  2. 02

    Inside share

    Customers out inside the zones

    ÷ all customers out

  1. 03

    Calm snapshots

    Last 30 days

    No warning anywhere in the state

  2. 04

    Baseline share

    Customers out inside the same zones

    ÷ all customers out

    Same zones as the warning in 01

05

Lift

Inside share ÷ baseline share

Left blank when the baseline is 0

How the overlap readout compares a warning with calm days

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.

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
  1. Nov 5 (from 1:36 PM)9,027
  2. Nov 610,097
  3. Nov 77,049
  4. Nov 88,118
  5. Nov 912,642
  6. Nov 1013,415
  7. Nov 118,015
  8. Nov 1215,684
  9. Nov 13 (to 9:45 PM)16,728
Peak statewide customers out each day, as of 9:45 PM on November 13, 2026. Days run midnight to midnight, Pacific time. A full bar would be 50,000, the count that opens an event.

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

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.

  1. “Planned” includes routine maintenance

    Risk
    Shutoff totals inflated by scheduled work
    Call
    Sort shutoffs by cause text
  2. Utilities schedule shutoffs because of the warning

    Risk
    Shutoffs inflate the overlap for unplanned outages
    Call
    Score the two kinds on their own
  3. The customers field is spelled Impacted_Cutomers_Not_Planned

    Risk
    A corrected spelling reads zero customers with no error
    Call
    Read the field as published
  4. The service hands back 1,000 records at a time

    Risk
    A big event gets undercounted with no error
    Call
    Page through every record each snapshot
  5. Only some utilities publish outage areas

    Risk
    Area-based totals skip whole utilities
    Call
    Count from incident points and draw areas for context
  6. A failed fetch looks like zero outages

    Risk
    Outages close early and restoration looks faster
    Call
    A failed fetch never counts as a miss
  7. Many NWS alerts list zone IDs with no outline

    Risk
    Warnings missing from the map and the overlap
    Call
    Fetch each zone’s outline, cache it, and refetch when a new ID appears
  8. Calm snapshots have no warning zones of their own

    Risk
    The baseline reads 0% and lift breaks
    Call
    Score calm snapshots against the current warning’s zones

Built so a bad feed can’t rewrite history.

  1. One transaction per snapshot

    A crash mid-run leaves no half-written snapshot behind.

  2. Close after 2 straight misses

    One dropped row doesn’t end an outage early.

  3. Metric rules as pure TypeScript

    The same code runs in Deno on Supabase and in Node for the backup job and the tests.

  4. Tests against real Postgres

    Spatial joins and the transaction get tested the way they run in production.

  5. 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.

  6. 14 live endpoints checked in CI

    Every pull request calls each source once and writes its status and record count to the run summary.

  7. A backup schedule

    GitHub Actions takes a snapshot whenever data goes 30 minutes stale.

  8. MapLibre pinned to 5

    Version 6 broke the deck.gl terrain overlay and crashed the map on load.

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
Grid Watch’s map key, color and shape together
  1. Type

    Chakra Petch for headings, Inter Tight for text, and Geist Mono for every number so digits hold still as counts change.

  2. Phones first

    At 375 px the panels sit in a bottom sheet you can drag, and the map keeps the whole screen.

  3. Reduced motion

    The event replay doesn’t autoplay, and the scrubber steps between frames.

Color distance between map colors (ΔE), normal vision and simulated deuteranopia
ItemNormalDeuteranopia
Outage vs wind alert113.7112.5
Outage vs Red Flag Warning67.440.5
Red Flag Warning vs fire perimeter66.333.8
Outage vs fire perimeter55.852.2
Outage vs planned maintenance33.331.3
Color distance between map colors (ΔE), normal vision and simulated deuteranopia. A script simulates deuteranopia and measures each pair that shares the map. The closest pairs also differ by shape, such as hatching or a ring.

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

  1. 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.

  2. Wind

    Streaks drape over the terrain from an Open-Meteo forecast grid, colored by gust. With reduced motion on, they hold still as arrows.

  3. 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.

  4. Conditions card

    Click the map for wind, gusts, humidity and temperature at that hour, plus the elevation and the nearest outage.

  5. Fly in downwind

    Click an outage of 1,000 or more customers and the camera flies in close, facing the way the wind blows.

  6. Key events

    Shutoff starts, warnings going up and coming down, the peak and the biggest restore. Each row jumps the replay to that moment.

  7. 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.

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.

Lighthouse on mobile, run against sample data
ItemPerformanceAccessibilityBest practicesSEO
County page96100100100
Methodology96100100100
Live map6910096100
Event page6810096100
Lighthouse on mobile, run against sample data. The map pages are the weak spot. The home page paints in 1.0 s with zero layout shift, then spends 4,100 ms of blocking time setting up the WebGL map and terrain.

What I’d do with a full fire season of data.

Next

  1. The first big event

    Write it up once something passes 50,000 customers, with its restoration times and lift.

  2. Shutoffs outside warnings

    Measure how many shutoff customers sat outside any Red Flag Warning, by utility.

  3. A faster map

    Load terrain and the outage layer after first paint to cut the 4,100 ms of blocking time.

  4. Open data

    Publish a daily CSV of statewide totals so others can check the work.

Known limits

  1. 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.

  2. Correlation

    Overlap can’t show that a warning caused a shutoff.

  3. Shutoff labels

    Grid Watch spots a shutoff by its cause text. One filed as Planned under a vaguer cause counts as maintenance.

  4. Line status

    The transmission layer shows where lines run. It can’t say whether a line is energized.

  5. Modeled wind

    Wind is a model forecast for 10 m above the ground. Replay frames older than 48 hours show none.

  6. A young record

    History starts in November 2026, so the 30-day baseline is still filling in.

  1. Built

    A live map of California power outages over fire weather, with a snapshot saved every 15 minutes.

  2. Found

    The first Red Flag Warning on the record came and went with no shutoff reported.

  3. By the numbers

    Snapshots stored
    802
    Snapshots with a Red Flag Warning up
    209
    Snapshots with a shutoff
    0
  4. The catch

    The record is young. One quiet warning says little about a full fire season.

  5. Next

    Write up the first big event once statewide customers out pass 50,000, with its restoration times.