Last active
May 4, 2016 19:25
-
-
Save martgnz/1bcd7602a1e92c46ee04aab4ddd36037 to your computer and use it in GitHub Desktop.
Spam.js choropleth boilerplate
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" /> | |
<body> | |
<script src="d3.min.js"></script> | |
<script src="topojson.min.js"></script> | |
<script src="rbush.min.js"></script> | |
<script src="spam.min.js"></script> | |
<script type='text/javascript'> | |
d3.json("bcn.json", function(error, d) { | |
topojson.presimplify(d) | |
var map = new StaticCanvasMap({ | |
element: "body", | |
data: [{ | |
features: topojson.feature(d, d.objects["bcn"]), | |
static: { | |
paintfeature: function(parameters, d) { | |
parameters.context.stroke() | |
} | |
} | |
} | |
] | |
}) | |
map.init() | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment