Post

For the German election we wanted to use a cartogram of German election districts but didn't find anything good, so we created our own. Here's a little nerd thread how the final algorithm worked 🤓 🧵 #gis #cartogram #election #datavis #cartography

Then we used a Delaunay tessellation of the district centroids. This later helps the districts to stay close to their geographical neighbors.

0 reposts47 likes

Before running the network layout simulation on this, we marked all the outer districts as fixed. This allows the final layout to stay "in shape" of the country as a whole, which is important for readers to recognize their country. We used the TopoJSON arcs to automatically find these districts.

Some of these fixed districts turned out to be too close to each other, so we defined a few exceptions for border districts we want to be free, and also a few custom positions that prevent the nodes to "leave" the country.

To compute the final layout we use a force simulation with 3 forces: one of them keeps neighboring districts together while another pushes districts away from each other if they are too close. Coloring the nodes helped to identify problems during the process.