Recreating a voronoi treemap
February 19, 2025This week I recreated a voronoi treemap from The San Francisco Chronicle on how San Francisco's budget is distributed with its new major. Nami Sumida participated in its creation.
Warning: Data may be inaccurate compared to the source.Recreation
Highlights
This is the first voronoi treemap I've done. I'm not even sure I should call it that, but it's the name I found the most. I could do it thanks to this amazing notebook by Willam Chase. Also, take a look at his website; he has an amazing portfolio: https://www.williamrchase.com/
- d3-voronoi-treemap was the one who made this possible. Unless I'm mistaken, it's the first plugin I use outside the D3-Observable ecosystem. It's as easy as following the documentation to generate the Voronoi treemap.
- The only obstacle I didn't manage to overcome: the rotation. My recreation is very faithful to the original, although you can see that the data are arranged in different ways, but there is a difference in the rotation of both circles. I thought that it would be enough to use rotate(), but then came the problem with the labels. If you rotated them, they would appear tilted, and if not, they would appear in another position. I tried several solutions, but none of them worked.