d3-geo-projection
Extended geographic projections for d3-geo. See Command-Line Cartography for an introduction.
Installing
If you use NPM, npm install d3-geo-projection
. Otherwise, download the latest release. You can also load directly from d3js.org as a standalone library. AMD, CommonJS, and vanilla environments are supported. In vanilla, a d3
global is exported:
<script src="https://d3js.org/d3-array.v1.min.js"></script> <script src="https://d3js.org/d3-geo.v1.min.js"></script> <script src="https://d3js.org/d3-geo-projection.v2.min.js"></script> <script> var aitoff = d3.geoAitoff(); </script>
Try d3-geo-projection in your browser.
API Reference
Projections
Note: projections tagged [d3-geo] are exported by d3-geo, not d3-geo-projection. These commonly-used projections are also included in the d3 default bundle.
d3.geoAiry() Source
d3.geoAiryRaw(beta)
Airy’s minimum-error azimuthal projection.
airy.radius([radius])
Defaults to 90°.
d3.geoAitoff() Source
d3.geoAitoffRaw
The Aitoff projection.
d3.geoAlbers() Source [d3-geo]
Albers’ equal-area conic projection.
d3.geoArmadillo() Source
d3.geoArmadilloRaw(phi0)
The armadillo projection. The default center assumes the default parallel of 20° and should be changed if a different parallel is used. Note: requires clipping to the sphere.
armadillo.parallel([parallel])
Defaults to 20°.
d3.geoAugust() Source
d3.geoAugustRaw
August’s epicycloidal conformal projection.
d3.geoAzimuthalEqualArea() Source [d3-geo]
d3.geoAzimuthalEqualAreaRaw
The Lambert azimuthal equal-area projection.
d3.geoAzimuthalEquidistant() Source [d3-geo]
d3.geoAzimuthalEquidistantRaw
The azimuthal equidistant projection.
d3.geoBaker() Source
d3.geoBakerRaw
The Baker Dinomic projection.
d3.geoBerghaus() Source
d3.geoBerghausRaw(lobes)
Berghaus’ star projection. The default center assumes the default lobe number of 5 and should be changed if a different number of lobes is used. Note: requires clipping to the sphere.
berghaus.lobes([lobes]) Source
If lobes is specified, sets the number of lobes in the resulting star, and returns this projection. If lobes is not specified, returns the current lobe number, which defaults to 5.
d3.geoBertin1953() Source
d3.geoBertin1953Raw
Jacques Bertin’s 1953 projection.
d3.geoBoggs() Source
d3.geoBoggsRaw
The Boggs eumorphic projection. More commonly used in interrupted form.
d3.geoBonne() Source
d3.geoBonneRaw(phi0)
The Bonne pseudoconical equal-area projection. The Werner projection is a limiting form of the Bonne projection with a standard parallel at ±90°. The default center assumes the default parallel of 45° and should be changed if a different parallel is used.
bonne.parallel([parallel])
Defaults to 45°.
d3.geoBottomley() Source
d3.geoBottomleyRaw(sinPsi)
The Bottomley projection “draws lines of latitude as concentric circular arcs, with arc lengths equal to their lengths on the globe, and placed symmetrically and equally spaced across the vertical central meridian.”
bottomley.fraction([fraction])
Defaults to 0.5, corresponding to a sin(ψ) where ψ = π/6.
d3.geoBromley() Source
d3.geoBromleyRaw
The Bromley projection is a rescaled Mollweide projection.
d3.geoChamberlin(point0, point1, point2) Source
d3.geoChamberlinRaw(p0, p1, p2)
The Chamberlin trimetric projection. This method does not support projection.rotate: the three reference points implicitly determine a fixed rotation.
d3.geoChamberlinAfrica() Source
The Chamberlin projection for Africa using points [0°, 22°], [45°, 22°], [22.5°, -22°].
d3.geoCollignon() Source
d3.geoCollignonRaw
The Collignon equal-area pseudocylindrical projection. This projection is used in the polar areas of the HEALPix projection.
d3.geoConicConformal() Source [d3-geo]
d3.geoConicConformalRaw
The Lambert conformal conic projection.
d3.geoConicEqualArea() Source [d3-geo]
d3.geoConicEqualAreaRaw
Albers’ conic equal-area projection.
d3.geoConicEquidistant() Source [d3-geo]
d3.geoConicEquidistantRaw
The conic equidistant projection.
d3.geoCraig() Source
d3.geoCraigRaw(phi)
The Craig retroazimuthal projection. Note: this projection tends to fold over itself if the standard parallel is non-zero; we have not yet implemented the necessary advanced clipping to avoid overlap.
craig.parallel([parallel])
Defaults to 0°.
d3.geoCraster() Source
d3.geoCrasterRaw
The Craster parabolic projection; also known as Putniņš P4.
d3.geoCylindricalEqualArea() Source
d3.geoCylindricalEqualAreaRaw(phi0)
The cylindrical equal-area projection. Depending on the chosen parallel, this projection is also known as the Lambert cylindrical equal-area (0°), Gall–Peters (45°), Hobo–Dyer (37.5°), and Tobler world-in-a-square (~55.654°).
cylindricalEqualArea.parallel([parallel])
Defaults to approximately 38.58°, fitting the world in a 960×500 rectangle.
d3.geoCylindricalStereographic() Source
d3.geoCylindricalStereographicRaw(phi0)
The cylindrical stereographic projection. Depending on the chosen parallel, this projection is also known as Braun’s stereographic (0°) and Gall’s stereographic (45°).
cylindricalStereographic.parallel([parallel])
Defaults to 0°.
d3.geoEckert1() Source
d3.geoEckert1Raw
The Eckert I projection.
d3.geoEckert2() Source
d3.geoEckert2Raw
The Eckert II projection.
d3.geoEckert3() Source
d3.geoEckert3Raw
The Eckert III projection.
d3.geoEckert4() Source
d3.geoEckert4Raw
The Eckert IV projection.
d3.geoEckert5() Source
d3.geoEckert5Raw
The Eckert V projection.
d3.geoEckert6() Source
d3.geoEckert6Raw
The Eckert VI projection.
d3.geoEisenlohr() Source
d3.geoEisenlohrRaw(lambda, phi)
The Eisenlohr conformal projection.
d3.geoEquirectangular() Source [d3-geo]
d3.geoEquirectangularRaw
The equirectangular (plate carrée) projection. The Cassini projection is the transverse aspect of the equirectangular projection.
d3.geoFahey() Source
d3.geoFaheyRaw
The Fahey pseudocylindrical projection.
d3.geoFoucaut() Source
d3.geoFoucautRaw
Foucaut’s stereographic equivalent projection.
d3.geoGilbert([type]) Source
Gilbert’s two-world perspective projection. Wraps an instance of the specified projection type; if not specified, defaults to d3.geoOrthographic.
d3.geoGingery() Source
d3.geoGingeryRaw(rho, lobes)
The U.S.-centric Gingery world projection, as inspired by Cram’s Air Age. Note: requires clipping to the sphere.
gingery.radius([radius]) Source
Defaults to 30°.
gingery.lobes([lobes]) Source
Defaults to 6.
d3.geoGinzburg4() Source
d3.geoGinzburg4Raw
The Ginzburg IV projection.
d3.geoGinzburg5() Source
d3.geoGinzburg5Raw
The Ginzburg V projection.
d3.geoGinzburg6() Source
d3.geoGinzburg6Raw
The Ginzburg VI projection.
d3.geoGinzburg8() Source
d3.geoGinzburg8Raw
The Ginzburg VIII projection.
d3.geoGinzburg9() Source
d3.geoGinzburg9Raw
The Ginzburg IX projection.
d3.geoGnomonic() Source [d3-geo]
d3.geoGnomonicRaw
The gnomonic projection.
d3.geoGringorten() Source
d3.geoGringortenRaw
The Gringorten square equal-area projection, rearranged to give each hemisphere an entire square.
d3.geoGuyou() Source
d3.geoGuyouRaw
The Guyou hemisphere-in-a-square projection. Peirce is credited with its quincuncial form.
d3.geoHammer() Source
d3.geoHammerRaw(A, B)
The Hammer projection. Depending the chosen coefficient and aspect, also known as Eckert–Greifendorff, quartic authalic, and Briesemeister.
hammer.coefficient([coefficient]) Source
Defaults to 2.
d3.geoHammerRetroazimuthal() Source
d3.geoHammerRetroazimuthalRaw(phi0)
The Hammer retroazimuthal projection. Note: requires clipping to the sphere.
hammerRetroazimuthal.parallel([parallel])
Defaults to 45°.
d3.geoHealpix() Source
d3.geoHealpixRaw(lobes)
The HEALPix projection: a Hierarchical Equal Area isoLatitude Pixelisation of a 2-sphere. In this implementation, the parameter K is fixed at 3. Note: requires clipping to the sphere.
healpix.lobes([lobes])
If lobes is specified, sets the number of lobes (the parameter H in the literature) and returns this projection. If lobes is not specified, returns the current lobe number, which defaults to 4.
d3.geoHill() Source
d3.geoHillRaw(K)
Hill eucyclic projection is pseudoconic and equal-area.
hill.ratio([ratio])
Defaults to 1. With a ratio of 0, this projection becomes the Maurer No. 73. As it approaches ∞, the projection converges to the Eckert IV.
d3.geoHomolosine() Source
d3.geoHomolosineRaw
The pseudocylindrical, equal-area Goode homolosine projection is normally presented in interrupted form.
d3.geoKavrayskiy7() Source
d3.geoKavrayskiy7Raw
The Kavrayskiy VII pseudocylindrical projection.
d3.geoLagrange() Source
d3.geoLagrangeRaw(n)
The Lagrange conformal projection.
lagrange.spacing([spacing])
Defaults to 0.5.
d3.geoLarrivee() Source
d3.geoLarriveeRaw
The Larrivée projection.
d3.geoLaskowski() Source
d3.geoLaskowskiRaw
The Laskowski tri-optimal projection simultaneously minimizes distance, angular, and areal distortion.
d3.geoLittrow() Source
d3.geoLittrowRaw
The Littrow projection is the only conformal retroazimuthal map projection. Typically clipped to the geographic extent [[-90°, -60°], [90°, 60°]].
d3.geoLoximuthal() Source
d3.geoLoximuthalRaw(phi0)
The loximuthal projection is “characterized by the fact that loxodromes (rhumb lines) from one chosen central point (the intersection of the central meridian and central latitude) are shown as straight lines, correct in azimuth from the center, and are ‘true to scale’… It is neither an equal-area projection nor conformal.”
loximuthal.parallel([parallel])
Defaults to 40°.
d3.geoMercator() Source [d3-geo]
d3.geoMercatorRaw
The spherical Mercator projection.
d3.geoMiller() Source
d3.geoMillerRaw
The Miller cylindrical projection is a modified Mercator projection.
d3.geoModifiedStereographic(coefficients, rotate) Source
d3.geoModifiedStereographicRaw(coefficients)
The family of modified stereographic projections. The default clip angle for these projections is 90°. These projections do not support projection.rotate: a fixed rotation is applied that is specific to the given coefficients.
d3.geoModifiedStereographicAlaska() Source
A modified stereographic projection for Alaska.
d3.geoModifiedStereographicGs48() Source
A modified stereographic projection for the conterminous United States.
d3.geoModifiedStereographicGs50() Source
A modified stereographic projection for the United States including Alaska and Hawaii. Typically clipped to the geographic extent [[-180°, 15°], [-50°, 75°]].
d3.geoModifiedStereographicMiller() Source
A modified stereographic projection for Europe and Africa. Typically clipped to the geographic extent [[-40°, -40°], [80°, 80°]].
d3.geoModifiedStereographicLee() Source
A modified stereographic projection for the Pacific ocean.
d3.geoMollweide() Source
d3.geoMollweideRaw
The equal-area, pseudocylindrical Mollweide projection. The oblique aspect is known as the Atlantis projection. Goode’s interrupted Mollweide is also widely known.
d3.geoMtFlatPolarParabolic() Source
d3.geoMtFlatPolarParabolicRaw
The McBryde–Thomas flat-polar parabolic pseudocylindrical equal-area projection.
d3.geoMtFlatPolarQuartic() Source
d3.geoMtFlatPolarQuarticRaw
The McBryde–Thomas flat-polar quartic pseudocylindrical equal-area projection.
d3.geoMtFlatPolarSinusoidal() Source
d3.geoMtFlatPolarSinusoidalRaw
The McBryde–Thomas flat-polar sinusoidal equal-area projection.