GithubHelp home page GithubHelp logo

gerhobbelt / d3-geo-projection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from d3/d3-geo-projection

0.0 2.0 0.0 26.58 MB

Extended geographic projections for D3.js.

License: Other

Makefile 0.22% JavaScript 99.78%

d3-geo-projection's Introduction

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;

d3-geo-projection's People

Contributors

jasondavies avatar mattcg avatar mbostock avatar tmcw avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.