globe.gl
Version:
UI component for Globe Data Visualization using ThreeJS/WebGL
29 lines (24 loc) • 730 B
HTML
<head>
<style> body { margin: 0; } </style>
<script src="//unpkg.com/globe.gl"></script>
<!-- <script src="../../dist/globe.gl.js"></script>-->
</head>
<body>
<div id="globeViz"></div>
<script>
// Gen random data
const N = 300;
const gData = [...Array(N).keys()].map(() => ({
lat: (Math.random() - 0.5) * 180,
lng: (Math.random() - 0.5) * 360,
size: Math.random() / 3,
color: ['red', 'white', 'blue', 'green'][Math.round(Math.random() * 3)]
}));
Globe()
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
.pointsData(gData)
.pointAltitude('size')
.pointColor('color')
(document.getElementById('globeViz'))
</script>
</body>