Inspiration
An important first step in doing good is having a solid idea of what you're doing and where to target your efforts. Good data visualisation is important because it can strikingly present key data and make it intuitive. In particular, maps are nice, but can often mislead - land area is rarely what we care about. When visualising population or poverty, it's very important to see just how much is in sub-Saharan Africa and southern Asia; to take another example, small but significant countries (e.g. Israel with covid vaccines) can be completely obscured by a normal map.
What it does
There's a base world map with colors linked to country codes, and parsing code for reading datasets from Our World in Data. The code uses a clever algorithm we designed to probabilistically add or remove pixels from countries so that area is redistributed.
How we built it
We took a functional programming approach and built the project entirely in Haskell.
Challenges we ran into
One challenge was that we have to link two sorts of data: the areas of countries on a map to country names, and country names to values. This involved a lot of work with writing code to help us then manually create a world map encoding the information we want (each country with a different color), manually creating that map, writing a parser for CSVs, and dealing with incomplete data.
Another challenge was several hours spent on various obscure Haskell bugs.
Finally, cartogram generation is a very complex topic that people write PhDs about. There is no guarantee of success in setting out to find "simple" methods.
Accomplishments that we're proud of
We think this project can be really helpful in visualising key world data, and we had a lot of fun designing and writing the algorithms.
What we learned
Functional programming rocks.
What's next for Cartogram Generator
Giving the user more options, further refinements to reduce distortion and increase performance.
Built With
- gloss
- haskell
- juicypixels
- ourworldindata
Log in or sign up for Devpost to join the conversation.