Not all maps are of Earth! To measure distances on other planets, a map’s scale bar must be configured so that it knows the radius of the planet upon which it will rest. When using d3-geo-scale-bar, you can use use scaleBar.radius.
This example displays a map showing the locations of spacecraft landings on the near side of the Moon. To place a scale bar on the Moon, simply pass 1737.4, the radius of the Moon in kilometers, to scaleBar.radius. If you wish to indicate miles, set scaleBar.radius to 1079.4, the radius of the Moon in miles.