xxxxxxxxxx
<html>
<head>
<title>Map</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/d3@2.10.3/d3.v2.js"></script>
<style type="text/css">
svg {
background: #eee;
}
#chart {
width: 400px;
height: 600px;
}
#ireland {
fill: #008000;
opacity: .8;
stroke: #000000;
stroke-width: .7;
}
</style>
</head>
<body>
<!--<h1 id='calendar_view'>Calendar View</h1>-->
<div class='gallery' id='chart'> </div>
<script type="text/javascript">
var w = 600;
var h = 600;
var proj = d3.geo.mercator();
var path = d3.geo.path().projection(proj);
var t = proj.translate(); // the projection's default translation
var s = proj.scale() // the projection's default scale
var map = d3.select("#chart").append("svg:svg")
.attr("width", w)
.attr("height", h)
// .call(d3.behavior.zoom().on("zoom", redraw))
.call(initialize);
var ireland = map.append("svg:g")
.attr("id", "ireland");
d3.json("ireland.json", function (json) {
ireland.selectAll("path")
.data(json.features)
.enter().append("path")
.attr("d", path);
});
function initialize() {
proj.scale(1200);
//proj.translate([-1240, 720]);
}
</script>
</body>
</html>
Modified http://mbostock.github.com/d3/d3.js to a secure url
https://mbostock.github.com/d3/d3.js