In every D3 map example I can find, the scale
parameter of the Mercator projection is set to equal width / 2 / Math.PI
. Is this unique to the Mercator projection? What is scale
doing that it needs to rely on pi? I'd love to have a more intuitive understanding of what's going on here, but the docs are pretty sparse.
"If scale is specified, sets the projection’s scale factor to the specified value and returns the projection. If scale is not specified, returns the current scale factor which defaults to 150. The scale factor corresponds linearly to the distance between projected points. However, scale factors are not consistent across projections."