-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
executable file
·30 lines (23 loc) · 913 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<head>
<style> body { margin: 0; } </style>
<script src="//unpkg.com/aframe"></script>
<script src="//unpkg.com/@ar-js-org/ar.js"></script>
<script src="//unpkg.com/globe-ar"></script>
<!--<script src="../../dist/globe-ar.js"></script>-->
</head>
<body>
<div id="globeViz"></div>
<script type="module">
import { csvParse } from 'https://esm.sh/d3-dsv';
const world = new GlobeAR(document.getElementById('globeViz'))
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
.heatmapPointLat('lat')
.heatmapPointLng('lng')
.heatmapPointWeight('pop')
.heatmapBandwidth(0.9)
.heatmapColorSaturation(2.8);
fetch('../datasets/world_population.csv').then(res => res.text())
.then(csv => csvParse(csv, ({ lat, lng, pop }) => ({ lat: +lat, lng: +lng, pop: +pop })))
.then(data => world.heatmapsData([data]));
</script>
</body>