Live updating election map

Another thing to consider when creating maps is which projection to use.

At the Washington Post, our style is to show the continental United States in an Albers USA projection, a conic equal-area projection that minimizes distortion, with Alaska and Hawaii positioned under the southwestern states.

Also, using the new Feature State API meant we could push data updates to our features more quickly, and that interaction with the maps themselves would be faster We originally built our election map app in 2016, and since two years is an eternity in the world of online media, there was a lot that we needed to rebuild or refactor, including how we integrated Mapbox itself.

This new update not only helped us in publishing performant interactive maps on a desktop, but it also enabled us to make those interactive maps available on mobile as well, which is a huge improvement from our 2016 election rig.

There is another style of maps that is making its way into the traditional election visualizations: the cartogram.

Cartograms are maps that are distorted by a variable, by population or GDP, for example, to favor information over geography.

live updating election map-88live updating election map-87

Luckily for us, the new Feature State API was just released into beta and has been a part of the library now since v0.46.

Feature state allows us to dynamically set and update properties on a feature in a source.

So as vote totals update in real time and races are called for one candidate or another, we can quickly update the visualization to show the latest results.

You’ve seen them; they’re everywhere on election night.

They’re displayed on a blank background, showing the continental U. typically with Alaska and Hawaii positioned underneath.

Leave a Reply