Skip to content

Instantly share code, notes, and snippets.

@sivagao
Forked from minikomi/index.html
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sivagao/96cf392abbca40e0566c to your computer and use it in GitHub Desktop.
Save sivagao/96cf392abbca40e0566c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v2.min.js?2.10.0"></script>
<script>
var width = 960,
height = 700;
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
var xym = d3.geo.albers();
var path = d3.geo.path().projection(xym);
d3.json("japan.json", function(data) {
svg.selectAll("path").data(data.features)
.enter().append("path")
.attr("d", path)
.style("fill", function() { return "#44aaee" })
.on("mouseover", function(e){d3.select(this).style("fill", "#5522aa")})
.on("mouseout", function(e){d3.select(this).style("fill", "#44aaee")})
});
</script>
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment