Why can't I use certain d3-geo map projections?

Yesterday, I was trying to put more map projections onto a fork of Versor Dragging, and it looked like it worked, but when I tried the projections out, it said there was an error. The code looked completely fine, but when I ran it with the new projections, it didn’t work. I later realized it was the projection name, but I spelled it completely fine. With projections like the Mercator it worked completely fine, but with more obscure ones like Mollweide, it didn’t work. Here’s the link to the notebook: Versor Dragging, but edited / GurvbPro Studios | Observable

Mollweide is not obscure :slight_smile: but it’s being developed in d3-geo-projection, a module that is not bundled with the standard bundle of D3, and needs to be loaded explicitly.

It should work if you add a cell with:

d3 = require("d3@7", "d3-geo-projection@4")

You might also want to try d3-geo-polygon.

1 Like