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

As input for the cartogram we use a pre-projected TopoJSON basemap of election districts with baked-in centroids (inner points). We used Mapshaper to generate the file.

1 repost52 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.