Skip to content

Instantly share code, notes, and snippets.

@arisatha
Created December 2, 2015 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arisatha/e9b36fa342f7261c490e to your computer and use it in GitHub Desktop.
Save arisatha/e9b36fa342f7261c490e to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<title>D3 tutorial</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<style type="text/css">
</style>
</head>
<body>
<script>
var canvas = d3.select("body").append("svg")
.attr("width", 1000)
.attr("height", 1000);
d3.json("output.geojson", function (data) {
var group = canvas.selectAll("g")
.data(data.features)
.enter()
.append("g");
//var projection = d3.geo.mercator()
//.scale(100);
var projection = d3.geo.conicConformal()
.center([4.37, 50.84])
.scale(220000)
.translate([500, 500]);
var path = d3.geo.path().projection(projection);
var areas = group.append("path")
.attr("d", path)
.attr("class", "area")
.attr("fill", "steelblue");
});
</script>
</body>
</html>
Display the source blob
Display the rendered blob
Raw
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