Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
geomap_example.html
<!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
You can’t perform that action at this time.