I recently had a user of one of my notebooks with a hex map ask if she could specify the radius of the hexagons in kilometers instead of pixels (using d3-hexbin). I came up with a hack which looks roughly correct for the United States (using the Walmart hexbin example): How to convert from radius in km to radius in pixels? / Evan Galloway / Observable
I know this will only be approximate but does this approach make sense? Is there a better/more robust way?
As you can see thereâs an ~7% difference between the two extremes. Is it good enough? It might be possible to find a projection with a slightly better ratio. Not sure which from the top of my head, though.
PS: note however that if any hexagon falls on Alaska, the result is going to be off by a lotâthe scale on the Alaska inset of the map is about 4 times smaller than on the contiguous part.
Thanks @Fil! Super interesting answer, especially the map. Also thanks for the reminder about Alaska. If I end up using this, Iâll qualify it as a very rough approximation that is only useful for the contiguous U.S.