Last active
February 6, 2019 21:41
-
-
Save pachadotdev/ba8597718701e55fc62dc45671e6c841 to your computer and use it in GitHub Desktop.
geomap_example.html
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> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://d3plus.org/js/d3plus-geomap.v0.6.full.min.js"></script> | |
<style> | |
body { | |
margin: 0; | |
overflow: hidden; | |
} | |
</style> | |
</head> | |
<body></body> | |
<script> | |
var data = [{"commune_id":"15202","commune_name":"General Lagos","valor":400}, | |
{"commune_id":"15101","commune_name":"Arica","valor":300}, | |
{"commune_id":"15102","commune_name":"Camarones","valor":200}, | |
{"commune_id":"15201","commune_name":"Putre","valor":100}]; | |
var chart = new d3plus.Geomap() | |
.data(data) | |
.groupBy("commune_id") | |
.topojsonId(function(d) { return d.properties.commune_id; }) | |
.colorScale("valor") | |
.topojson("https://raw.githubusercontent.com/pachamaltese/chilemaps/master/data_topojson/simplified_communes/new/r15.topojson") | |
.render(); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment