Extended geographic projections for D3.js.
Clone or download
Pull request Compare This branch is 348 commits behind d3:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
src
test
.gitignore
.npmignore
LICENSE
Makefile
README.md
bower.json
d3.geo.projection.js
d3.geo.projection.min.js
index.js
package.json

README.md

Extended Geographic Projections

airy
aitoff
albers *
albersUsa *
armadillo
august
azimuthalEqualArea *
azimuthalEquidistant *
baker
berghaus
boggs
bonne
bromley
chamberlin
collignon
conicEqualArea *
conicConformal *
conicEquidistant *
craig
craster
cylindricalEqualArea
cylindricalStereographic
eckert1
eckert2
eckert3
eckert4
eckert5
eckert6
eisenlohr
equirectangular *
fahey
gilbert
gingery
ginzburg4
ginzburg5
ginzburg6
ginzburg8
ginzburg9
gnomonic *
gringorten
guyou
hammer
hammerRetroazimuthal
healpix
hill
homolosine
kavrayskiy7
lagrange
larrivee
laskowski
littrow
loximuthal
mercator *
miller
modifiedStereographic
mollweide
mtFlatPolarParabolic
mtFlatPolarQuartic
mtFlatPolarSinusoidal
naturalEarth
nellHammer
orthographic *
patterson
peirceQuincuncial
polyconic
polyhedron.butterfly
polyhedron.waterman
rectangularPolyconic
robinson
satellite
sinuMollweide
sinusoidal
stereographic *
times
twoPointAzimuthal
twoPointEquidistant
transverseMercator *
vanDerGrinten
vanDerGrinten2
vanDerGrinten3
vanDerGrinten4
wagner4
wagner6
wagner7
wiechel
winkel3

Projections:

This plugin also provides d3.geo.interrupt, which can be used to create arbitrary interrupted projections from a given raw projection. For example, see Philbrick’s interrupted Sinu-Mollweide.

This plugin requires D3 3.0 or greater. To use the official hosted version, include the projection plugin after including D3:

<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://d3js.org/d3.geo.projection.v0.min.js" charset="utf-8"></script>

Alternatively, you can clone this repo, download the zipball, or right-click d3.geo.projection.v0.min.js and save.

To use this plugin within a Node.js context, you can npm install d3 d3-geo-projection and then say:

var d3 = require("d3");

require("d3-geo-projection")(d3);

Subsequently, d3.geo will contain all the extended projections.

Defining a New Projection

First define your raw projection function:

function cosinusoidal(λ, φ) {
  return* Math.sin(φ), φ];
}

cosinusoidal.invert = function(x, y) {
  return [x / Math.sin(y), y];
};

Then create a constructor using d3.geo.projection:

d3.geo.cosinusoidal = function() {
  return d3.geo.projection(cosinusoidal);
};

You can optionally expose the raw projection to facilitate composite projections:

(d3.geo.cosinusoidal = function() {
  return d3.geo.projection(cosinusoidal);
}).raw = cosinusoidal;