Skip to content

Instantly share code, notes, and snippets.

@brianengel
Created October 4, 2012 15:45
Show Gist options
  • Save brianengel/3834500 to your computer and use it in GitHub Desktop.
Save brianengel/3834500 to your computer and use it in GitHub Desktop.
just another inlet to tributary
{"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":789,"height":477,"hide":false},"endpoint":"tributary","public":true,"editor_json0":{"vim":false,"emacs":false,"width":600,"height":300,"hide":true}}
var countries = tributary.worldcountries;
var svg = d3.select("svg");
var projection = d3.geo.azimuthal()
.scale(539)
.origin([-70,20])
.translate([579,513]);
var geopath = d3.geo.path().projection(projection);
var circle = d3.geo.circle().origin(projection.origin());
svg.selectAll("path")
.data(countries.features)
.enter()
.append("path")
.attr( {
d : function(d) { console.log(d);return geopath(circle.clip(d)); }
});
svg.append("circle")
.attr({
fill: "#f00",
r: 4,
transform: function() {
var coords = projection([ -77.750, 41.339]);
return "translate(" + coords + ")";
}
});
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment