Public
Edited
Jun 25, 2022
1 fork
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// We don't display this map
map = {
const context = DOM.context2d(width, height);
const projection = d3.geoPeirceQuincuncial().fitSize([width, height], {type: "Sphere"}).precision(0.1);
const path = d3.geoPath(projection, context);
path.pointRadius(0.8);
context.beginPath(), path(graticule), context.strokeStyle = "#ddd", context.stroke();
context.beginPath(), path(land), context.fillStyle = color_land, context.fill();
context.beginPath(), path(countries), context.strokeStyle = color_boundaries, context.stroke();
context.beginPath(), path(add_lakes), context.fillStyle = color_lakes, context.fill();
context.beginPath(), path(routes), context.strokeStyle = color_routes, context.point= "1", context.stroke();
context.canvas.style.display="none";
return context.canvas;
}
Insert cell
d3 = require("d3@5", "d3-geo@1", "d3-geo-projection@2")
Insert cell
graticule = d3.geoGraticule10()
Insert cell
world = FileAttachment("world-50m.json").json()
Insert cell
land = topojson.feature(world, world.objects.land)
Insert cell
countries = topojson.feature(world, world.objects.countries)
Insert cell
lakes = FileAttachment("world-110m_withlakes.topo.json").json()
Insert cell
add_lakes = topojson.feature(lakes, lakes.objects.lakes)
Insert cell
routes = FileAttachment("great_circle.topo.json").json()
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