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

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