Published
Edited
Jan 22, 2022
1 fork
22 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
globeletjs = import("globeletjs")
Insert cell
Insert cell
document.head.appendChild(
html`<link href="https://unpkg.com/globeletjs@0.1.1/dist/globelet.css" rel=stylesheet>`
)
Insert cell
Insert cell
maptilerKey = "mrAq6zQEFxOkanukNbGm" // Get your own key: maptiler.com
Insert cell
style = {
let doc = await FileAttachment("klokantech-basic-style.json").json();
Object.values(doc.sources).forEach(src => {
if (src.url) src.url = src.url.replace(/{key}/, maptilerKey);
});
doc.glyphs = doc.glyphs.replace(/{key}/, maptilerKey);
return doc;
}
Insert cell
Insert cell
globe = globeletjs.initGlobe({
container,
style,
center: [-70, 30], // Initial [longitude, latitude] of camera
altitude: 6371 * 3 // Initial camera altitude: approximately 3x Earth radius
})
Insert cell
globe.startAnimation()
Insert cell
Insert cell
html`<style>
#globeDiv {
height: 600px;
width: ${width}px;
}
.globelet .main {
background-color: grey;
}
`
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