Air quality has been added!
Today I turned my attention to the layer that sits much closer to the ground: the air quality index, or AQI, for cities around the world. I added a proper GPU-driven point cloud. Instead of rendering each city as a flat marker, I built a custom shader that makes every data point glow with intensity and fade softly at the edges, exactly like the aurora points but in a different colour palette. The ingestion logic is now hooked into the Open‑Meteo API, which gives me live AQI readings for hundreds of cities. I parse the response, extract the pollutant concentrations, and map each value to a colour gradient: green for good, yellow for moderate, orange for unhealthy, red for hazardous, and purple for the really nasty stuff. Each point also gets a weight that controls its size and opacity, so the worst‑off cities stand out immediately.
But I didn’t want it static. I added an update loop that pulses the points over time, a gentle breathing effect that makes the data feel alive. The breathing speed and amplitude are tied to the AQI value itself, so a city with dangerous air pulses more anxiously than one with clean air. It is a small touch, but it adds a layer of storytelling to the numbers. The points are also queryable. I exposed a set of hooks so you can hover or click a city and pull up its name, AQI reading, and pollutant breakdown. The data pipeline follows the same pattern as the quakes and the aurora: fetch with a timeout, fall back to a sample dataset if the API stumbles, and refresh on a sensible interval.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.