Skip to content

Instantly share code, notes, and snippets.

@mbostock
Forked from mbostock/.block
Last active January 8, 2020 03:25

Revisions

  1. mbostock revised this gist Oct 21, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .block
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,3 @@
    license: gpl-3.0
    height: 480
    redirect: https://beta.observablehq.com/@mbostock/d3-equirectangular
  2. mbostock revised this gist Jun 20, 2016. 2 changed files with 10 additions and 12 deletions.
    1 change: 1 addition & 0 deletions .block
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    license: gpl-3.0
    height: 480
    21 changes: 9 additions & 12 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -5,8 +5,8 @@
    .graticule {
    fill: none;
    stroke: #777;
    stroke-width: .5px;
    stroke-opacity: .5;
    stroke-width: 0.5px;
    stroke-opacity: 0.5;
    }

    .land {
    @@ -16,27 +16,26 @@
    .boundary {
    fill: none;
    stroke: #fff;
    stroke-width: .5px;
    stroke-width: 0.5px;
    }

    </style>
    <body>
    <script src="//d3js.org/d3.v3.min.js"></script>
    <script src="//d3js.org/d3.v4.0.0-alpha.50.min.js"></script>
    <script src="//d3js.org/topojson.v1.min.js"></script>
    <script>

    var width = 960,
    height = 480;

    var projection = d3.geo.equirectangular()
    .scale(153)
    .translate([width / 2, height / 2])
    .precision(.1);
    var projection = d3.geoEquirectangular()
    .scale(height / Math.PI)
    .translate([width / 2, height / 2]);

    var path = d3.geo.path()
    var path = d3.geoPath()
    .projection(projection);

    var graticule = d3.geo.graticule();
    var graticule = d3.geoGraticule();

    var svg = d3.select("body").append("svg")
    .attr("width", width)
    @@ -61,6 +60,4 @@
    .attr("d", path);
    });

    d3.select(self.frameElement).style("height", height + "px");

    </script>
  3. mbostock revised this gist Feb 9, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .block
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    license: gpl-3.0
  4. mbostock revised this gist Oct 31, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -21,8 +21,8 @@

    </style>
    <body>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/topojson/1.6.19/topojson.min.js"></script>
    <script src="//d3js.org/d3.v3.min.js"></script>
    <script src="//d3js.org/topojson.v1.min.js"></script>
    <script>

    var width = 960,
  5. mbostock revised this gist Jun 11, 2015. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -21,8 +21,8 @@

    </style>
    <body>
    <script src="http://d3js.org/d3.v3.min.js"></script>
    <script src="http://d3js.org/topojson.v1.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/topojson/1.6.19/topojson.min.js"></script>
    <script>

    var width = 960,
    @@ -48,6 +48,8 @@
    .attr("d", path);

    d3.json("/mbostock/raw/4090846/world-50m.json", function(error, world) {
    if (error) throw error;

    svg.insert("path", ".graticule")
    .datum(topojson.feature(world, world.objects.land))
    .attr("class", "land")
  6. mbostock revised this gist May 13, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@
    </style>
    <body>
    <script src="http://d3js.org/d3.v3.min.js"></script>
    <script src="http://d3js.org/topojson.v0.min.js"></script>
    <script src="http://d3js.org/topojson.v1.min.js"></script>
    <script>

    var width = 960,
    @@ -49,7 +49,7 @@

    d3.json("/mbostock/raw/4090846/world-50m.json", function(error, world) {
    svg.insert("path", ".graticule")
    .datum(topojson.object(world, world.objects.land))
    .datum(topojson.feature(world, world.objects.land))
    .attr("class", "land")
    .attr("d", path);

  7. mbostock revised this gist Mar 23, 2013. 1 changed file with 0 additions and 0 deletions.
    Binary file modified thumbnail.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
  8. mbostock revised this gist Mar 23, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.html
    Original file line number Diff line number Diff line change
    @@ -59,6 +59,6 @@
    .attr("d", path);
    });

    d3.select(self.frameElement).style("height", height + "pxe;")
    d3.select(self.frameElement).style("height", height + "px");

    </script>
  9. mbostock revised this gist Mar 23, 2013. 1 changed file with 14 additions and 35 deletions.
    49 changes: 14 additions & 35 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -2,34 +2,21 @@
    <meta charset="utf-8">
    <style>

    .background {
    fill: #a4bac7;
    }

    .foreground {
    fill: none;
    stroke: #333;
    stroke-width: 1.5px;
    }

    .graticule {
    fill: none;
    stroke: #fff;
    stroke: #777;
    stroke-width: .5px;
    }

    .graticule :nth-child(2n) {
    stroke-dasharray: 2,2;
    stroke-opacity: .5;
    }

    .land {
    fill: #d7c7ad;
    stroke: #766951;
    fill: #222;
    }

    .boundary {
    fill: none;
    stroke: #a5967e;
    stroke: #fff;
    stroke-width: .5px;
    }

    </style>
    @@ -39,10 +26,12 @@
    <script>

    var width = 960,
    height = 500;
    height = 480;

    var projection = d3.geo.equirectangular()
    .scale(150);
    .scale(153)
    .translate([width / 2, height / 2])
    .precision(.1);

    var path = d3.geo.path()
    .projection(projection);
    @@ -54,32 +43,22 @@
    .attr("height", height);

    svg.append("path")
    .datum(graticule.outline)
    .attr("class", "background")
    .attr("d", path);

    svg.append("g")
    .datum(graticule)
    .attr("class", "graticule")
    .selectAll("path")
    .data(graticule.lines)
    .enter().append("path")
    .attr("d", path);

    svg.append("path")
    .datum(graticule.outline)
    .attr("class", "foreground")
    .attr("d", path);

    d3.json("/d/4090846/world-110m.json", function(error, world) {
    d3.json("/mbostock/raw/4090846/world-50m.json", function(error, world) {
    svg.insert("path", ".graticule")
    .datum(topojson.object(world, world.objects.land))
    .attr("class", "land")
    .attr("d", path);

    svg.insert("path", ".graticule")
    .datum(topojson.mesh(world, world.objects.countries, function(a, b) { return a.id !== b.id; }))
    .datum(topojson.mesh(world, world.objects.countries, function(a, b) { return a !== b; }))
    .attr("class", "boundary")
    .attr("d", path);
    });

    d3.select(self.frameElement).style("height", height + "pxe;")

    </script>
  10. mbostock revised this gist Dec 24, 2012. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@
    stroke-width: .5px;
    }

    .graticule:nth-child(2n) {
    .graticule :nth-child(2n) {
    stroke-dasharray: 2,2;
    }

    @@ -58,10 +58,11 @@
    .attr("class", "background")
    .attr("d", path);

    svg.selectAll(".graticule")
    svg.append("g")
    .attr("class", "graticule")
    .selectAll("path")
    .data(graticule.lines)
    .enter().append("path")
    .attr("class", "graticule")
    .attr("d", path);

    svg.append("path")
  11. mbostock revised this gist Dec 24, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    The [equirectangular projection](http://en.wikipedia.org/wiki/Equirectangular_projection) is available as [d3.geo.equirectangular](https://github.com/mbostock/d3/wiki/Geo-Projections#wiki-equirectangular).
    The [equirectangular projection](http://en.wikipedia.org/wiki/Equirectangular_projection) is available as [d3.geo.equirectangular](https://github.com/mbostock/d3/wiki/Geo-Projections#wiki-equirectangular). See also the [rotating version](/3734273).
  12. mbostock revised this gist Dec 23, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    The [equirectangular projection](http://en.wikipedia.org/wiki/Equirectangular_projection) is available as `d3.geo.equirectangular` in [D3](http://d3js.org) 2.11.
    The [equirectangular projection](http://en.wikipedia.org/wiki/Equirectangular_projection) is available as [d3.geo.equirectangular](https://github.com/mbostock/d3/wiki/Geo-Projections#wiki-equirectangular).
  13. mbostock revised this gist Dec 7, 2012. 1 changed file with 9 additions and 11 deletions.
    20 changes: 9 additions & 11 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -35,14 +35,14 @@
    </style>
    <body>
    <script src="http://d3js.org/d3.v3.min.js"></script>
    <script src="http://d3js.org/topojson.v0.min.js"></script>
    <script>

    var width = 960,
    height = 500;

    var projection = d3.geo.equirectangular()
    .scale(height / 2)
    .translate([width / 2 - .5, height / 2 - .5]);
    .scale(150);

    var path = d3.geo.path()
    .projection(projection);
    @@ -69,18 +69,16 @@
    .attr("class", "foreground")
    .attr("d", path);

    d3.json("/d/3682676/readme-boundaries.json", function(error, collection) {
    d3.json("/d/4090846/world-110m.json", function(error, world) {
    svg.insert("path", ".graticule")
    .datum(collection)
    .attr("class", "boundary")
    .datum(topojson.object(world, world.objects.land))
    .attr("class", "land")
    .attr("d", path);
    });

    d3.json("/d/3682676/readme-land.json", function(error, collection) {
    svg.insert("path", ".graticule,.boundary")
    .datum(collection)
    .attr("class", "land")
    svg.insert("path", ".graticule")
    .datum(topojson.mesh(world, world.objects.countries, function(a, b) { return a.id !== b.id; }))
    .attr("class", "boundary")
    .attr("d", path);
    });

    </script>
    </script>
  14. mbostock revised this gist Oct 26, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -69,14 +69,14 @@
    .attr("class", "foreground")
    .attr("d", path);

    d3.json("/d/3682676/readme-boundaries.json", function(collection) {
    d3.json("/d/3682676/readme-boundaries.json", function(error, collection) {
    svg.insert("path", ".graticule")
    .datum(collection)
    .attr("class", "boundary")
    .attr("d", path);
    });

    d3.json("/d/3682676/readme-land.json", function(collection) {
    d3.json("/d/3682676/readme-land.json", function(error, collection) {
    svg.insert("path", ".graticule,.boundary")
    .datum(collection)
    .attr("class", "land")
  15. mbostock revised this gist Oct 26, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.html
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@

    </style>
    <body>
    <script src="https://raw.github.com/mbostock/d3/projection/d3.v2.min.js"></script>
    <script src="http://d3js.org/d3.v3.min.js"></script>
    <script>

    var width = 960,
  16. mbostock revised this gist Oct 12, 2012. 1 changed file with 0 additions and 0 deletions.
    Binary file added thumbnail.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
  17. mbostock revised this gist Sep 28, 2012. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    The [equirectangular projection](http://en.wikipedia.org/wiki/Equirectangular_projection) is available as `d3.geo.equirectangular` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
    The [equirectangular projection](http://en.wikipedia.org/wiki/Equirectangular_projection) is available as `d3.geo.equirectangular` in [D3](http://d3js.org) 2.11.
    2 changes: 1 addition & 1 deletion index.html
    Original file line number Diff line number Diff line change
    @@ -35,13 +35,13 @@
    </style>
    <body>
    <script src="https://raw.github.com/mbostock/d3/projection/d3.v2.min.js"></script>
    <script src="https://raw.github.com/d3/d3-plugins/projection/geo/projection/projection.js"></script>
    <script>

    var width = 960,
    height = 500;

    var projection = d3.geo.equirectangular()
    .scale(height / 2)
    .translate([width / 2 - .5, height / 2 - .5]);

    var path = d3.geo.path()
  18. mbostock revised this gist Sep 28, 2012. 1 changed file with 10 additions and 12 deletions.
    22 changes: 10 additions & 12 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -34,16 +34,18 @@

    </style>
    <body>
    <script src="http://d3js.org/d3.v2.min.js?2.10.1"></script>
    <script src="https://raw.github.com/d3/d3-plugins/master/geo/projection/projection.js"></script>
    <script src="https://raw.github.com/mbostock/d3/projection/d3.v2.min.js"></script>
    <script src="https://raw.github.com/d3/d3-plugins/projection/geo/projection/projection.js"></script>
    <script>

    var width = 960,
    height = 500;

    var projection = d3.geo.equirectangular()
    .translate([width / 2 - .5, height / 2 - .5]);

    var path = d3.geo.path()
    .projection(d3.geo.equirectangular()
    .translate([width / 2 - .5, height / 2 - .5]));
    .projection(projection);

    var graticule = d3.geo.graticule();

    @@ -68,20 +70,16 @@
    .attr("d", path);

    d3.json("/d/3682676/readme-boundaries.json", function(collection) {
    svg.insert("g", ".graticule")
    svg.insert("path", ".graticule")
    .datum(collection)
    .attr("class", "boundary")
    .selectAll("path")
    .data(collection.geometries)
    .enter().append("path")
    .attr("d", path);
    });

    d3.json("/d/3682676/readme-land.json", function(collection) {
    svg.insert("g", ".graticule,.boundary")
    svg.insert("path", ".graticule,.boundary")
    .datum(collection)
    .attr("class", "land")
    .selectAll("path")
    .data(collection.geometries)
    .enter().append("path")
    .attr("d", path);
    });

  19. mbostock revised this gist Sep 20, 2012. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    The [azimuthal equidistant projection](http://en.wikipedia.org/wiki/Azimuthal_equidistant_projection) is available as `d3.geo.azimuthalEquidistant` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
    The [equirectangular projection](http://en.wikipedia.org/wiki/Equirectangular_projection) is available as `d3.geo.equirectangular` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
    2 changes: 1 addition & 1 deletion index.html
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@
    height = 500;

    var path = d3.geo.path()
    .projection(d3.geo.azimuthalEquidistant()
    .projection(d3.geo.equirectangular()
    .translate([width / 2 - .5, height / 2 - .5]));

    var graticule = d3.geo.graticule();
  20. mbostock revised this gist Sep 20, 2012. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    The [Lambert azimuthal equal-area projection](http://en.wikipedia.org/wiki/Lambert_azimuthal_equal-area_projection) is available as `d3.geo.azimuthalEqualArea` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
    The [azimuthal equidistant projection](http://en.wikipedia.org/wiki/Azimuthal_equidistant_projection) is available as `d3.geo.azimuthalEquidistant` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
    2 changes: 1 addition & 1 deletion index.html
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@
    height = 500;

    var path = d3.geo.path()
    .projection(d3.geo.azimuthalEqualArea()
    .projection(d3.geo.azimuthalEquidistant()
    .translate([width / 2 - .5, height / 2 - .5]));

    var graticule = d3.geo.graticule();
  21. mbostock revised this gist Sep 20, 2012. 2 changed files with 3 additions and 3 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    The [Mollweide projection](http://en.wikipedia.org/wiki/Mollweide_projection) is available as `d3.geo.mollweide` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
    The [Lambert azimuthal equal-area projection](http://en.wikipedia.org/wiki/Lambert_azimuthal_equal-area_projection) is available as `d3.geo.azimuthalEqualArea` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
    4 changes: 2 additions & 2 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -34,15 +34,15 @@

    </style>
    <body>
    <script src="http://d3js.org/d3.v2.min.js"></script>
    <script src="http://d3js.org/d3.v2.min.js?2.10.1"></script>
    <script src="https://raw.github.com/d3/d3-plugins/master/geo/projection/projection.js"></script>
    <script>

    var width = 960,
    height = 500;

    var path = d3.geo.path()
    .projection(d3.geo.mollweide()
    .projection(d3.geo.azimuthalEqualArea()
    .translate([width / 2 - .5, height / 2 - .5]));

    var graticule = d3.geo.graticule();
  22. mbostock revised this gist Sep 16, 2012. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -71,7 +71,7 @@
    svg.insert("g", ".graticule")
    .attr("class", "boundary")
    .selectAll("path")
    .data(collection.features)
    .data(collection.geometries)
    .enter().append("path")
    .attr("d", path);
    });
    @@ -80,9 +80,9 @@
    svg.insert("g", ".graticule,.boundary")
    .attr("class", "land")
    .selectAll("path")
    .data(collection.features)
    .data(collection.geometries)
    .enter().append("path")
    .attr("d", path);
    });

    </script>
    </script>
  23. @jasondavies jasondavies revised this gist Sep 13, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    The [Mollweide projection](http://en.wikipedia.org/wiki/Mollweide_projection) is available as `d3.geo.mollweide` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/mollweide/geo/projection).
    The [Mollweide projection](http://en.wikipedia.org/wiki/Mollweide_projection) is available as `d3.geo.mollweide` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
  24. @jasondavies jasondavies revised this gist Sep 13, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.html
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@
    </style>
    <body>
    <script src="http://d3js.org/d3.v2.min.js"></script>
    <script src="https://raw.github.com/d3/d3-plugins/mollweide/geo/projection/projection.js"></script>
    <script src="https://raw.github.com/d3/d3-plugins/master/geo/projection/projection.js"></script>
    <script>

    var width = 960,
  25. @jasondavies jasondavies revised this gist Sep 13, 2012. 2 changed files with 3 additions and 3 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    The [Aitoff projection](http://en.wikipedia.org/wiki/Aitoff_projection) is available as `d3.geo.aitoff` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
    The [Mollweide projection](http://en.wikipedia.org/wiki/Mollweide_projection) is available as `d3.geo.mollweide` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/mollweide/geo/projection).
    4 changes: 2 additions & 2 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -35,14 +35,14 @@
    </style>
    <body>
    <script src="http://d3js.org/d3.v2.min.js"></script>
    <script src="https://raw.github.com/d3/d3-plugins/master/geo/projection/projection.js"></script>
    <script src="https://raw.github.com/d3/d3-plugins/mollweide/geo/projection/projection.js"></script>
    <script>

    var width = 960,
    height = 500;

    var path = d3.geo.path()
    .projection(d3.geo.aitoff()
    .projection(d3.geo.mollweide()
    .translate([width / 2 - .5, height / 2 - .5]));

    var graticule = d3.geo.graticule();
  26. mbostock revised this gist Sep 13, 2012. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    The [Cylindrical equal-area projection](http://en.wikipedia.org/wiki/Cylindrical_equal-area_projection) is available as `d3.geo.cylindricalEqualArea` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
    The [Aitoff projection](http://en.wikipedia.org/wiki/Aitoff_projection) is available as `d3.geo.aitoff` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
    2 changes: 1 addition & 1 deletion index.html
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@
    height = 500;

    var path = d3.geo.path()
    .projection(d3.geo.cylindricalEqualArea()
    .projection(d3.geo.aitoff()
    .translate([width / 2 - .5, height / 2 - .5]));

    var graticule = d3.geo.graticule();
  27. mbostock revised this gist Sep 13, 2012. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    The [Aitoff Projection](http://en.wikipedia.org/wiki/Aitoff_projection) is available as `d3.geo.aitoff` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
    The [Cylindrical equal-area projection](http://en.wikipedia.org/wiki/Cylindrical_equal-area_projection) is available as `d3.geo.cylindricalEqualArea` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
    2 changes: 1 addition & 1 deletion index.html
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@
    height = 500;

    var path = d3.geo.path()
    .projection(d3.geo.aitoff()
    .projection(d3.geo.cylindricalEqualArea()
    .translate([width / 2 - .5, height / 2 - .5]));

    var graticule = d3.geo.graticule();
  28. mbostock revised this gist Sep 13, 2012. 1 changed file with 18 additions and 17 deletions.
    35 changes: 18 additions & 17 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -2,23 +2,23 @@
    <meta charset="utf-8">
    <style>

    .background .line {
    .background {
    fill: #a4bac7;
    }

    .foreground .line {
    .foreground {
    fill: none;
    stroke: #333;
    stroke-width: 1.5px;
    }

    .line {
    .graticule {
    fill: none;
    stroke: #fff;
    stroke-width: .5px;
    }

    .line:nth-child(2n) {
    .graticule:nth-child(2n) {
    stroke-dasharray: 2,2;
    }

    @@ -41,30 +41,31 @@
    var width = 960,
    height = 500;

    var projection = d3.geo.aitoff()
    .translate([width / 2 - .5, height / 2 - .5]);

    var path = d3.geo.path()
    .projection(projection);
    .projection(d3.geo.aitoff()
    .translate([width / 2 - .5, height / 2 - .5]));

    var graticule = d3.geo.graticule()
    .projection(projection);
    var graticule = d3.geo.graticule();

    var svg = d3.select("body").append("svg")
    .attr("width", width)
    .attr("height", height);

    svg.append("g")
    svg.append("path")
    .datum(graticule.outline)
    .attr("class", "background")
    .call(graticule.outline);
    .attr("d", path);

    svg.append("g")
    svg.selectAll(".graticule")
    .data(graticule.lines)
    .enter().append("path")
    .attr("class", "graticule")
    .call(graticule);
    .attr("d", path);

    svg.append("g")
    svg.append("path")
    .datum(graticule.outline)
    .attr("class", "foreground")
    .call(graticule.outline);
    .attr("d", path);

    d3.json("/d/3682676/readme-boundaries.json", function(collection) {
    svg.insert("g", ".graticule")
    @@ -84,4 +85,4 @@
    .attr("d", path);
    });

    </script>
    </script>
  29. mbostock revised this gist Sep 12, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    The [Aitoff Projection](http://en.wikipedia.org/wiki/Aitoff_projection) showing [land](http://www.naturalearthdata.com/downloads/110m-physical-vectors/) and [boundary lines](http://www.naturalearthdata.com/downloads/110m-cultural-vectors/) from [Natural Earth](http://www.naturalearthdata.com/). This projection is available in the [geo.projection plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection). See also the [Winkel Tripel Projection](http://bl.ocks.org/3682676).
    The [Aitoff Projection](http://en.wikipedia.org/wiki/Aitoff_projection) is available as `d3.geo.aitoff` in the [geo.projection D3 plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection).
  30. mbostock revised this gist Sep 12, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    The [Aitoff Projection](http://en.wikipedia.org/wiki/Aitoff_projection) showing [land](http://www.naturalearthdata.com/downloads/110m-physical-vectors/) and [boundary lines](http://www.naturalearthdata.com/downloads/110m-cultural-vectors/) from [Natural Earth](http://www.naturalearthdata.com/). The geo.winkel3 and geo.aitoff projections are available in the [winkel3 plugin](https://github.com/d3/d3-plugins/tree/master/winkel3). See also the [Winkel Tripel Projection](http://bl.ocks.org/3682676).
    The [Aitoff Projection](http://en.wikipedia.org/wiki/Aitoff_projection) showing [land](http://www.naturalearthdata.com/downloads/110m-physical-vectors/) and [boundary lines](http://www.naturalearthdata.com/downloads/110m-cultural-vectors/) from [Natural Earth](http://www.naturalearthdata.com/). This projection is available in the [geo.projection plugin](https://github.com/d3/d3-plugins/tree/master/geo/projection). See also the [Winkel Tripel Projection](http://bl.ocks.org/3682676).