Public
Edited
Apr 5, 2024
5 stars
Also listed in…
Sketches
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
globe = {
renderer.setSize(width, height);

// globe + atmosphere geometry
const geometry = new THREE.SphereGeometry(globeRadius, 35, 35);
// geometry.scale( -1, 1, 1);

// globe
globeMesh.geometry = geometry;
globeMesh.material = earthMaterial;
// gMesh.rotation.y = Math.PI;
scene.add(globeMesh);

// atmosphere
// const aMesh = new THREE.Mesh(geometry, material);
// aMesh.scale.set( 1.1, 1.1, 1.1 );
// scene.add(aMesh);

// Add bars to scene
plotBars({ scene, data: earthquakeData });

// Add lights (defined below)
const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);
directionalLight.position.set(100, 100, 100);
scene.add(ambientLight);

// orbitcontrols
// const controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.autoRotate = true;
controls.autoRotateSpeed = 1.0;
controls.minDistance = 300;
controls.maxDistance = 1500;

// render
const render = () => {
requestAnimationFrame(render);
controls.update();

// camera.lookAt(gMesh.position);
renderer.render(scene, camera);
};
render();

return renderer.domElement;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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