Public
Edited
Mar 20
10 forks
16 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
const satObjScale = satSize * world.getGlobeRadius() / EARTH_RADIUS / 2
const satGeometry = new THREE.SphereGeometry(1, 16, 8);
const groupMaterials = {};
world.objectThreeObject(d => {
if (!groupMaterials.hasOwnProperty(d.group)) {
// cache materials
groupMaterials[d.group] = new THREE.MeshLambertMaterial({
color: groupColor(d.group),
transparent: true,
opacity: 0.7
});
}
const obj = new THREE.Mesh(satGeometry, groupMaterials[d.group]);
obj.scale.set(satObjScale, satObjScale, satObjScale);
return obj;
})

// Size existing satellites
world.objectsData().forEach(d => d.__threeObj && d.__threeObj.scale.set(satObjScale, satObjScale, satObjScale))
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
// Update satellite position data
const gmst = satellite.gstime(time);
satelliteDataToShow.forEach(d => {
const eciPos = satellite.propagate(d.satrec, time).position;
if (eciPos) {
const gdPos = satellite.eciToGeodetic(eciPos, gmst);
d.position = {
lat: satellite.radiansToDegrees(gdPos.latitude), // deg
lng: satellite.radiansToDegrees(gdPos.longitude), // deg
altitude: gdPos.height / EARTH_RADIUS // globe radius units
}
}
})
world.objectsData(satelliteDataToShow);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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