Public
Edited
Nov 19, 2022
Insert cell
Insert cell
Insert cell
{
const div = document.createElement("div");
yield div;

const cableMapGlobe = Globe()
.height(width)
.width(width)
.pathsData(cableGeoPaths)
.pathPoints("coords")
.pathPointLat((p) => p[1])
.pathPointLng((p) => p[0])
.pathColor((path) => path.properties.color);

cableMapGlobe(div);

return div;
}
Insert cell
Insert cell
cableGeoPaths = {
// for each "feature" (path) make an array of coordinates; keep properties so we can use the color
cableGeo.features.forEach(({ geometry, properties }) => {
geometry.coordinates.forEach((coords) =>
cable_paths.push({ coords, properties })
);
});
return cable_paths;
}
Insert cell
mutable cable_paths = []
Insert cell
cableGeo = FileAttachment("cable-geo.json").json()
Insert cell
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