Build a GeoJSON → SVG path renderer using the given projection. Returns a function with .bounds() and .centroid() methods.
.bounds()
.centroid()
const proj = geoNaturalEarth1().fitSize([960, 500], featureCollection);const path = geoPath(proj);const d = path(feature); // SVG path stringconst [[x0,y0],[x1,y1]] = path.bounds(feature); // bounding boxconst [cx, cy] = path.centroid(feature); // centroid Copy
const proj = geoNaturalEarth1().fitSize([960, 500], featureCollection);const path = geoPath(proj);const d = path(feature); // SVG path stringconst [[x0,y0],[x1,y1]] = path.bounds(feature); // bounding boxconst [cx, cy] = path.centroid(feature); // centroid
Build a GeoJSON → SVG path renderer using the given projection. Returns a function with
.bounds()and.centroid()methods.