Created
February 12, 2020 01:00
-
-
Save skorasaurus/3c73410199f0abb040665cabc64b1fb3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | |
<style> | |
.latitude { | |
stroke-width:1.5px; | |
stroke:#777; | |
fill:none; | |
} | |
</style> | |
</head> | |
<body> | |
<script src="https://d3js.org/d3.v3.min.js"></script> | |
<script src="https://d3js.org/d3.geo.projection.v0.min.js"></script> | |
<script src="https://d3js.org/topojson.v1.min.js"></script> | |
<script type="text/javascript"> | |
var width = 960, | |
height = 500; | |
var projection = d3.geo.hammer() | |
.precision(0.3) | |
.scale(170); | |
var path = d3.geo.path() | |
.projection(projection); | |
var svg = d3.select("body").append("svg") | |
.attr("width", width) | |
.attr("height", height) | |
.append("g"); | |
d3.json("data.topojson", function(error, lines) { | |
svg.selectAll(".latitude") | |
.data(topojson.feature(lines, lines.objects.data).features) | |
.enter().append("path") | |
.attr("class", "latitude") | |
.attr("d", path); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment