Public
Edited
Aug 6, 2023
Insert cell
Insert cell
topojson = require("topojson-client", "topojson-simplify", "topojson-server")
Insert cell
geojson1 = {
const westPolygonCoords = [ [-179, 0], [-180, 0], [-180, 10], [-179, 10], [-179, 0] ].toReversed();
const eastPolygonCoords = [ [180, 0], [179, 0], [179, 10], [180, 10], [180, 0] ].toReversed();
return {
type: "Feature",
geometry: {
type: "MultiPolygon",
coordinates: [
[westPolygonCoords], [eastPolygonCoords]
]
},
properties: {}
};
}
Insert cell
geojson2 = {
const westPolygonCoords = [ [-179, 0], [-180, 0], [-180, 10], [-179, 10], [-179, 0] ].toReversed();
const eastPolygonCoords = [ [180, 3], [179, 3], [179, 5], [180, 5], [180, 3] ].toReversed();
return {
type: "Feature",
geometry: {
type: "MultiPolygon",
coordinates: [
[westPolygonCoords], [eastPolygonCoords]
]
},
properties: {}
};
}
Insert cell
d3.geoStitch(geojson2)
Insert cell
d3 = {
const d3 = require("d3");
const d3geo = require("d3-geo");
const d3geoProj = require("d3-geo-projection");
return Object.assign(await d3, await d3geo, await d3geoProj);
}
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