Timezone shapefile from Eric Muller.
xxxxxxxxxx
<meta charset="utf-8">
<style>
.graticule {
fill: none;
stroke: #777;
stroke-opacity: .5;
stroke-width: .5px;
pointer-events: none;
}
.timezones {
fill: #222;
}
.timezones :hover {
fill: orange;
}
.boundary {
fill: none;
stroke: #fff;
stroke-width: .5px;
pointer-events: none;
}
</style>
<body>
<script src="//d3js.org/d3.v3.min.js"></script>
<script src="//d3js.org/topojson.v1.min.js"></script>
<script>
var width = 960,
height = 960;
var projection = d3.geo.mercator()
.scale(width / 2 / Math.PI)
.translate([width / 2, height / 2])
.precision(.1);
var path = d3.geo.path()
.projection(projection);
var graticule = d3.geo.graticule();
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
svg.append("path")
.datum(graticule)
.attr("class", "graticule")
.attr("d", path);
d3.json("timezones.json", function(error, timezones) {
if (error) throw error;
path.projection(null);
svg.insert("g", ".graticule")
.attr("class", "timezones")
.selectAll("path")
.data(topojson.feature(timezones, timezones.objects.timezones).features)
.enter().append("path")
.attr("d", path)
.append("title")
.text(function(d) { return d.id; });
svg.insert("path", ".graticule")
.datum(topojson.mesh(timezones, timezones.objects.timezones, function(a, b) { return a !== b; }))
.attr("class", "boundary")
.attr("d", path);
});
d3.select(self.frameElement).style("height", height + "px");
</script>
https://d3js.org/d3.v3.min.js
https://d3js.org/topojson.v1.min.js