Skip to content

Instantly share code, notes, and snippets.

Last active April 14, 2016 09:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rveciana/f00299fdacf079ecf3a60aca63eef66d to your computer and use it in GitHub Desktop.
license: gpl-3.0
<!DOCTYPE html>
<meta charset="utf-8">
fill: #aca;
stroke: #000;
stroke-width: 0.5px
.graticule {
fill: none;
stroke: #777;
stroke-width: .5px;
stroke-opacity: .5;
<script src=""></script>
<script src=""></script>
<script src=""></script>
var width = 600,
height = 500;
var projection = d3.geo.mercatorEcuador();
var graticule = d3.geo.graticule().step([2, 2]);
var path = d3.geo.path()
var svg ="body").append("svg")
.attr("width", width)
.attr("height", height);
.attr("class", "graticule")
.attr("d", path);
d3.json("", function(error, ecuador) {
var land = topojson.feature(ecuador, ecuador.objects.ecuador);
.attr("d", path)
.on("mouseover", function(d,i) {
.style("fill", "red");
.on("mouseout", function(d,i) {
.style("fill", "#aca");
.attr("d", projection.getCompositionBorders());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment