Visualization of World Births and Deaths in Real-Time (A D3 Simulation)

Note (Nov 16, 2013): I am gradually tweaking this to look a little better on some mobile devices.  This visualization also requires significant processing power that can be a challenge for mobile devices. Viewing it on the desktop is still the best option.

Last year I put together (with Bill Snebold) a D3 visualization for a statistical simulation of US births and deaths in real-time.  When I had started that project, I had meant to do one for the entire world. However, I found a nice county svg map for the US, and decided to start with that.

Recently I came across Michael Bostock's work with world maps, and decided I would look at incorporating world birth/death rates to do something similar with that.  I also wanted to build on the earlier work, in that the births/deaths in specific locations in the US would still be included.

A beta(!) version of such a world birth/death simulation is available via:
  • A  Google Chrome app from the Chrome store for this visualization
    • This is an app that contains this visualization that runs in your Google Chrome browser, and thus is unaffected by the load on the googledrive sites below. You can get the Google Chrome browser here

Simulation of Real-Time Births/Deaths around the World

This has not been tweaked yet to run well on smaller screens.

There are different challenges with this thing.  First, the events happen at a fairly higher pace - about four births per second, a little more than one death per second, on average (roughly).  It's still amazing to think about that, btw.  Anyway, this means that it did not seem to be possible to bring each event to the forefront as they occur as was done in the previous US-only visualization, since too many would get "backed up".  The summary information is prepended to the lists, although there is an option to have it appended.  This makes the list move fast, but also helps to convey the rates involved.  Putting your mouse on the list will pause the list, although events will still be "backing up".  Moving your mouse off of the list will result in the backed up events flooding back in.

A few (slightly out of date) screenshots are below.  There are still tweaks to be done on different browsers and mobile, as getting the svg map area to line up properly for more screen sizes is yet to be implemented.  Nevertheless, the change in perspective from US-only to the whole world is interesting.

The lists can be scrolled, and as each list element is moused over, the corresponding location on the map is shown, accompanied by a small popup with summary info.

Similarly, on mouseover of a country itself on the map, a similar summary popup is displayed.

As for the mathematical approach, each country (there are about 230 included) is modeled separately for each one second interval, since different birth/death rates are used for each country.  Most of the annual average birth and death rates are mostly from the CIA factbook (Births, Deaths) - these are so-called "crude" rates, representing the average number of events per thousand population at midyear, with some values from wikipedia.  These are of course only approximations.  For births/deaths in the United States, an additional step is performed in which a specific location is chosen at random based on the population of counties and places (as was done in the US-only visualization).  Things have been implemented in such a way that this can also be done for other countries as the needed data are rounded up.  Note that I finally got around to getting a list of world cities and populations so that that could be incorporated as well, based on Josh Smith's worldwide-city-database on github, which itself is based on the Maxmind WorldCities Database.  A particular city is chosen based on relative population size in its country - of course, there are probably fancier ways to do this using additional data that may be available.

The flag images are from

Seeing the magnitude of the events at other locations around the world, 
while of course technically expected based on the birth/death rates, 
is still surprising

Moving your mouse over a country will
bring up summary and current information for the simulation
for that country

As mentioned, there are some things to tidy up on the display for tablets, etc., and while the simulated results seem to be qualitatively similar to other world birth meters out there, there may be some refinements still needed at some point with that as well with the underlying implementation here.

This is an evolving project. Please feel free to send me any info weirdness or problems you happen to see, as well as what additional summary information made available during the simulation might be interesting.

Popular Posts