Case study

Ask the Planet

A month of live earthquakes on a 3D globe, explored by asking questions in plain English. The AI writes the filter. Every dot and every number comes from the USGS feed.

Role
Product design, front end, 3D, AI integration
Timeline
2026
Stack
Next.js 16, React 19, React Three Fiber, OpenAI, Vercel AI SDK, Tailwind v4
Links
Live · GitHub
Ask the Planet answering 'Near Japan': a blue globe turned to Japan with depth-colored quake dots inside a dashed violet ring, beside '41 earthquakes within 900 km of Japan, in the last 30 days' with the place in violet and the time in rose, a timeline of bars and a list of the biggest quakes
"Near Japan." The ring on the globe, the violet in the sentence and the chip all mean the same place.
01 · Problem

Public data, hard to ask.

USGS publishes every earthquake of magnitude 2.5 and up, worldwide, updated every minute: close to 1,900 a month. Narrowing them down on their map means sliders and dropdowns, so you need the vocabulary before you can ask anything.

I wanted to type the question I actually had, like "deep quakes under Fiji," and trust the answer. That's the catch: an AI that answers questions about data will, sooner or later, make up a number.

02 · Design

A light globe, and an answer you can read.

Before building, I mocked up the same answer, "Near Japan," in every direction I wanted to try: four color directions, four layouts and about twenty palettes. Holding the content still meant only the design changed between them.

The three mockups that won, left to right: a light sky-blue globe beside a side panel; an editorial page with the big headline '46 earthquakes' beside the globe; and the final palette, a blue globe with depth-colored dots, violet place and rose time beside the count '46'
The winner of each round, left to right: direction, layout, color.
  • Light, not outer space.Nearly every globe demo is a glowing planet on black, and my first wireframe was too. I tried it against sky, paper and matcha. On a light page it reads as a tool you work in, not a screensaver, and the data colors carry the screen instead of the glow.
  • The answer as a sentence.A card floating over the map hid the globe, a console turned the answer into tiles, and a ledger was a spreadsheet. The editorial layout led with one big count and a sentence saying what was counted. That pairing became the heart of every answer.
  • Every color gets one job.The early palettes used one hot accent for everything: the dots, the count, the chips, the button. The final one splits the work. Blue is the globe, a four-step ramp is depth, violet is place and rose is time. The sentence, the ring on the globe and the timeline share those colors, so they read as one answer.
03 · Making it readable

Every answer says exactly what it counted.

With the count and sentence settled, the rest of the panel had to stay readable at 5 quakes and at 1,900.

The default view: '1,871 earthquakes in the last 30 days', a bar chart of quakes per day stacked by depth with Oct 9 marked as the busiest, and the five biggest quakes listed
A busy month counts per day, stacked by depth.
The same view with Oct 9 picked: the other days fade, the list reads 'Showing Oct 9, 95 quakes, biggest first' led by an M 7.7 in Panama and its aftershocks, and the globe has turned to Central America
Click a day and the globe and list show only that day: Panama's M 7.7 and its aftershocks.
  • Color means depth, size means magnitude.Four depth bands, named in plain words, keep one color everywhere: globe, timeline, list and legend.
  • The timeline changes shape with the answer.Under 150 quakes, one bar per quake. Above that it counts per day, and each day is clickable.
  • Dense places stay readable.Fiji was one solid blob. Dots now shrink when other quakes sit within about 160 km, so a cluster still reads as many quakes.
04 · Live data

Always the last 30 days, minutes old.

The server fetches USGS's live feed, keeps the seven fields the app uses, and caches it for five minutes, so a thousand visitors make one request to USGS. The header says how fresh it is: "Live · USGS · 3m ago."

05 · AI as a filter

The AI writes the query, never the answer.

The model's only job is to turn a question into a structured query: magnitude, depth, a place with a radius, a time window, a sort order. The schema has no field for a count or a fact, so it can't return one. The app runs the query on the real data and writes the sentence from the results.

The question 'deep quakes under Fiji' with the panel 'See the query the AI wrote' open, showing minDepthKm 300, a region for Fiji with a 1,000 km radius, 30 days, sorted by magnitude, above '41 earthquakes deeper than 300 km within 1,000 km of Fiji', and dark deep-quake dots inside a ring on the globe
The query is one click away, under the question it answers.
The question 'will there be an earthquake in LA tomorrow?' answered with a one-line note, 'I can't predict earthquakes, but I can show you recent quakes in Los Angeles', above '18 earthquakes within 150 km of Los Angeles, in the last 30 days', a timeline and a list of the biggest quakes
A question the data can't fully answer still shows the place it names, with a one-line note.
  • You can see what it wrote.If an answer looks wrong, the query shows whether the AI misread you or the data really says so.
  • It never leaves you empty-handed.A question that names a place always shows that place's quakes, with a one-line note if the rest is off-topic. Only questions with no place and nothing to filter, like "write me a poem," get a plain no, and the guide opens to show what works.
  • It's cheap to run.The examples are pre-written queries, free and instant. Typed questions are capped at 200 characters, cached, and limited per visitor.

The hardest part was teaching it which questions are about earthquakes. Every prompt fix broke something else: catching "weather in Paris" turned "what happened in Japan?" into a refusal, and letting bare place names through broke "strong quakes." What held was taking the decision out of the prompt. The AI labels each question first (answerable, not in this data, or off-topic), and the server enforces the label, so a stray refusal can't block a real answer. A set of 23 test questions has passed every run so far.

06 · The globe

A globe, because the planet is round.

Earthquakes follow plate edges that wrap around the Pacific. A flat map cuts that ring in half; on a globe it reads as one line.

The globe zoomed in on Fiji with a dark label card reading 'M 5.9, Fiji region, 4d ago, 585.1 km deep' pointing at a quake ringed by pulse circles, while the matching row in the list on the right is highlighted
Pick a quake in the list or on the globe: the camera zooms in, labels it, and the row lights up.
  • The camera goes to the answer.It flies to the place and rings the radius, or turns to the side that shows the most of the answer.
  • Dots arrive in a ripple.Matching quakes grow outward from where the camera is heading, showing what changed without a word. With reduced motion, they simply appear.
  • Light, and optional.A still globe stops drawing, the map is drawn off the main thread, and without WebGL everything but the globe still works.
07 · How I checked it

Audited until the fixes ran out.

Rounds of scripted browser tests and accessibility audits (keyboard only, 200% text, high-contrast mode, WebGL off), each fixing what the last one found. A few of the fixes:

Ask the Planet on a phone: the globe turned to Japan, the legend folded to four colored dots, the answer '41 earthquakes within 900 km of Japan, in the last 30 days', the Near Japan chip, the timeline, and the question box pinned to the bottom
On phones the legend folds and the question box stays a thumb away.
  • The timeline couldn't be used by keyboard.Each day is now a button: arrow keys move between days, Enter shows one.
  • One crash took the whole page down.Without WebGL the page went blank. Now only the globe is replaced, with an explanation.
  • A new answer froze the page.Sizing clusters compared every quake with every other. Grouping nearby quakes first took it from 16 ms to 5 ms, with a test proving the same result.
08 · Outcome

What I'd do next.

It does the one thing I wanted: you ask the question you actually have, and the answer is only ever the data.

← All work Ask the Planet