block by mbostock 2870030

Orthographic Projection

Full Screen

index.html

<!DOCTYPE html>
<meta charset="utf-8">
<title>Azimuthal (Orthographic) Projection</title>
<style>

path {
  fill: #ccc;
  stroke: #fff;
}

</style>
<svg width="960" height="500"></svg>
<script src="//d3js.org/d3.v3.min.js"></script>
<script>

var projection = d3.geo.orthographic()
    .clipAngle(90)
    .scale(240);

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

var svg = d3.select("svg");

d3.json("countries.json", function(error, collection) {
  if (error) throw error;

  svg.selectAll("path")
      .data(collection.features)
    .enter().append("path")
      .attr("d", path);
});

</script>