D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
azarshia
Full window
Github gist
islande
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v4.min.js"></script> <style> body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } </style> </head> <body> <script> // Feel free to change or delete any of the code you see in this editor! var svg = d3.select("body").append("svg") .attr("width", 1000) .attr("height", 1000) .style ("background", "lightblue"); islande = svg.append ("path"); projection = d3.geoMercator(); //.rotate([+26, -63]).scale(2500); path = d3.geoPath(projection); d3.json ("islande.json", function (err, json) {islande.datum(json) ; //{ svg.append("path") .attr("d", path(json)); }); d3.timer(function(elapsed) { projection.rotate(elapsed/[64,180,70]); islande.attr("d", path) }); svg.append("text") .text(projection([14,6])) .attr("y", 20) .attr("x", 12) .attr("font-size", 20) .attr("font-type", "monospace"); </script> </body>
https://d3js.org/d3.v4.min.js