Public
Edited
May 7, 2023
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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more