Published
Edited
Sep 10, 2019
Also listed in…
uncertainty: templates
Insert cell
md`# area: map/geographic coordinate system`
Insert cell
chart = {
const svg = d3.select(DOM.svg(width, height))
.style("width", "40%")
.style("height", "auto")
.style("font", "10px sans-serif");

svg.selectAll("path")
.data(subunits.features)
.enter()
.append("path")
.attr("d", mapPath)
;

return svg.node();
}
Insert cell
projection = d3.geoMercator()
.center([-3, 40])
.scale([1300])
.translate([width/2,height/2])
;
Insert cell
mapPath = d3.geoPath()
.projection(projection)
;
Insert cell
width = 300
Insert cell
height = 300
Insert cell
subunits = topojson.feature(data, data.objects.subunits)
Insert cell
topojson = require("topojson-client@3")
Insert cell
data = d3.json("https://gist.githubusercontent.com"
+ "/aaronxhill/cc1ee2394eb7eb9e42b57a3e0f14e458"
+ "/raw/889e38c6dbcc6b4fcca0bdbce583a12131c6b0ca"
+ "/esp.json")
//https://gist.github.com/aaronxhill/cc1ee2394eb7eb9e42b57a3e0f14e458/raw/889e38c6dbcc6b4fcca0bdbce583a12131c6b0ca/esp.json
Insert cell
d3 = require("d3@5", "topojson")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more