Built with blockbuilder.org
Last active
May 18, 2017 19:55
-
-
Save leenoah1/359654d649597d241ac5d13ba6e02291 to your computer and use it in GitHub Desktop.
watershed gist
This file contains 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
license: mit |
This file contains 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> | |
<meta charset="utf-8"> | |
<title>watershed</title> | |
<body> | |
<script src="//d3js.org/d3.v4.min.js"></script> | |
<script src="//d3js.org/topojson.v2.min.js"></script> | |
<script> | |
var width = 960, height = 500; | |
var svg = d3.select('body').append('svg') | |
.attr('width', width) | |
.attr('height', height); | |
// For d3 representation of various stateplanes, see: d3-stateplane | |
// We'll set the scale and translate later, based on the data | |
var projection = d3.geoConicConformal() | |
.parallels([38 + 18 / 60, 39 + 27 / 60]) | |
.rotate([77, -37 - 40 / 60]); | |
var path = d3.geoPath() | |
d3.json("https://raw.githubusercontent.com/leenoah1/class_project/master/watershed.json", function(json) { | |
svg.selectAll("path") | |
.data(json.features) | |
.enter() | |
.append("path") | |
.attr("d", path); | |
d3.json("watershed.json", function(json) { | |
//Put things here that depend on the JSON loading | |
svg.selectAll("path") | |
.data(json.features) | |
.enter() | |
.append("path") | |
.attr("d", path); | |
}); | |
//Only put things here that can operate independently of the JSON | |
console.log("I like cats."); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment