When using d3-geo-scale-bar, scaleBar.radius will also come in handy if you want to plot units on Earth other than kilometers, miles, meters, or feet, all of which come with preset units. For instance, when adding a scale bar to a map of a small area, you can set scaleBar.radius to 6967419.888, the mean radius of the Earth in yards.
For example, here is a map of buildings near the National Mall in Washington, D.C., using data from the great Open Data DC.