Skip to content

Instantly share code, notes, and snippets.

@poezn poezn/ag.json

Last active Aug 29, 2015
Embed
What would you like to do?
Aligning topojson?
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<style>
</style>
<body>
<svg></svg>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script src="http://d3js.org/queue.v1.min.js"></script>
<script>
var cm = tributary.getCodeEditor("inlet.js")
cm.tabSize = 4;
var width = 980,
height = 800;
var path = d3.geo.path()
.projection(null);
var svg = d3.select("svg");
queue()
.defer(d3.json, "ca.json")
.defer(d3.json, "ag.json")
.await(ready);
function ready(error, ca, ag) {
svg.append("path")
.datum(topojson.feature(ca, ca.objects.ca))
.attr({
"class": "ca",
"d": path
});
svg.append("path")
.datum(topojson.feature(ag, ag.objects.agri))
.attr({
"class": "ag",
"d": path
}
});
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.