I'm wondering how to calculate and determine a right value of projection.scale([value]) for a world map in full screen with D3.js.
The documentation says the default value is 150. But what does this "150" stand for?
I'm trying to draw a world map exact same width of the screen. I set svg area to window.innerWidth but not sure what value I should give to the scale for the world map.
In some case people get the bounds of the feature they want to fit but I cannot get bounds of whole bounds of the world map.
What the right way to calculate the scale value in this case?
width = window.innerWidth;
height = window.innerHeight;
svg = d3.select("#svgArea").append("svg")
.attr("id", "svg")
.attr("width", width)
.attr("height", height);
projection = d3.geo.equirectangular()
.scale(????)
.translate([width / 2, height / 2])
.precision(.1);
path = d3.geo.path().projection(projection);
d3.json("world-50m.json", function(error, world) {
var land = topojson.feature(world, world.objects.land);
svg.insert("path", ".graticule")
.datum(land)
.attr("class", "land")
.attr("fill", "#aaaaaa")
.attr("stroke", "#000000")
.attr("stroke-width", "0.5px")
.attr("d", path);
})
Thanks in advance.