foldkit-viz - v0.15.0
    Preparing search index...

    Function geoPath

    • Build a GeoJSON → SVG path renderer using the given projection. Returns a function with .bounds() and .centroid() methods.

      const proj = geoNaturalEarth1().fitSize([960, 500], featureCollection);
      const path = geoPath(proj);
      const d = path(feature); // SVG path string
      const [[x0,y0],[x1,y1]] = path.bounds(feature); // bounding box
      const [cx, cy] = path.centroid(feature); // centroid

      Parameters

      Returns GeoPathFn