W3cubDocs

/D3.js 4

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.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)