globe.gl 2.33.2 → 2.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -6
- package/dist/globe.gl.d.ts +6 -7
- package/dist/globe.gl.js +47369 -60713
- package/dist/globe.gl.js.map +1 -1
- package/dist/globe.gl.min.js +5 -5
- package/dist/globe.gl.mjs +2 -2
- package/example/airline-routes/highlight-links.html +1 -2
- package/example/airline-routes/us-international-outbound.html +1 -2
- package/example/basic/index.html +2 -3
- package/example/choropleth-countries/index.html +2 -3
- package/example/clouds/index.html +1 -2
- package/example/countries-population/index.html +1 -2
- package/example/custom-globe-styling/index.html +2 -3
- package/example/custom-layer/index.html +1 -2
- package/example/earth-shield/index.html +2 -3
- package/example/earthquakes/index.html +2 -3
- package/example/emit-arcs-on-click/index.html +2 -3
- package/example/heatmap/index.html +2 -3
- package/example/hexed-polygons/index.html +2 -3
- package/example/hollow-globe/index.html +1 -2
- package/example/html-markers/index.html +2 -3
- package/example/moon-landing-sites/index.html +2 -4
- package/example/population-heatmap/index.html +2 -3
- package/example/random-arcs/index.html +2 -3
- package/example/random-paths/index.html +2 -3
- package/example/random-rings/index.html +2 -3
- package/example/satellites/index.html +1 -2
- package/example/solar-terminator/index.html +1 -2
- package/example/submarine-cables/index.html +2 -3
- package/example/tiles/index.html +2 -3
- package/example/volcanoes/index.html +2 -3
- package/example/volcanoes-heatmap/index.html +2 -3
- package/example/world-cities/index.html +2 -3
- package/example/world-population/index.html +1 -2
- package/package.json +4 -4
package/dist/globe.gl.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AmbientLight, DirectionalLight, Vector2, REVISION } from 'three';
|
|
2
2
|
import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer.js';
|
|
3
3
|
import ThreeGlobe from 'three-globe';
|
|
4
4
|
import ThreeRenderObjects from 'three-render-objects';
|
|
5
5
|
import accessorFn from 'accessor-fn';
|
|
6
6
|
import Kapsule from 'kapsule';
|
|
7
|
-
import {
|
|
7
|
+
import { Tween, Easing, Group } from '@tweenjs/tween.js';
|
|
8
8
|
|
|
9
9
|
function styleInject(css, ref) {
|
|
10
10
|
if (ref === void 0) ref = {};
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
const MAP_CENTER = { lat: 37.6, lng: -16.6, altitude: 0.4 };
|
|
18
18
|
const OPACITY = 0.3;
|
|
19
19
|
|
|
20
|
-
const myGlobe = Globe()
|
|
21
|
-
(document.getElementById('globeViz'))
|
|
20
|
+
const myGlobe = new Globe(document.getElementById('globeViz'))
|
|
22
21
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
23
22
|
|
|
24
23
|
.arcLabel(d => `${d.airline}: ${d.srcIata} → ${d.dstIata}`)
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
const COUNTRY = 'United States';
|
|
17
17
|
const OPACITY = 0.22;
|
|
18
18
|
|
|
19
|
-
const myGlobe = Globe()
|
|
20
|
-
(document.getElementById('globeViz'))
|
|
19
|
+
const myGlobe = new Globe(document.getElementById('globeViz'))
|
|
21
20
|
|
|
22
21
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
23
22
|
.pointOfView({ lat: 39.6, lng: -98.5, altitude: 2 }) // aim at continental US centroid
|
package/example/basic/index.html
CHANGED
|
@@ -18,12 +18,11 @@
|
|
|
18
18
|
color: ['red', 'white', 'blue', 'green'][Math.round(Math.random() * 3)]
|
|
19
19
|
}));
|
|
20
20
|
|
|
21
|
-
Globe()
|
|
21
|
+
new Globe(document.getElementById('globeViz'))
|
|
22
22
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
23
23
|
.pointsData(gData)
|
|
24
24
|
.pointAltitude('size')
|
|
25
|
-
.pointColor('color')
|
|
26
|
-
(document.getElementById('globeViz'))
|
|
25
|
+
.pointColor('color');
|
|
27
26
|
|
|
28
27
|
</script>
|
|
29
28
|
</body>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
const maxVal = Math.max(...countries.features.map(getVal));
|
|
22
22
|
colorScale.domain([0, maxVal]);
|
|
23
23
|
|
|
24
|
-
const world = Globe()
|
|
24
|
+
const world = new Globe(document.getElementById('globeViz'))
|
|
25
25
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
26
26
|
.backgroundImageUrl('//unpkg.com/three-globe/example/img/night-sky.png')
|
|
27
27
|
.lineHoverPrecision(0)
|
|
@@ -39,8 +39,7 @@
|
|
|
39
39
|
.polygonAltitude(d => d === hoverD ? 0.12 : 0.06)
|
|
40
40
|
.polygonCapColor(d => d === hoverD ? 'steelblue' : colorScale(getVal(d)))
|
|
41
41
|
)
|
|
42
|
-
.polygonsTransitionDuration(300)
|
|
43
|
-
(document.getElementById('globeViz'))
|
|
42
|
+
.polygonsTransitionDuration(300);
|
|
44
43
|
});
|
|
45
44
|
</script>
|
|
46
45
|
</body>
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
<script type="module">
|
|
12
12
|
import * as THREE from '//unpkg.com/three/build/three.module.js';
|
|
13
13
|
|
|
14
|
-
const world = Globe({ animateIn: false })
|
|
15
|
-
(document.getElementById('globeViz'))
|
|
14
|
+
const world = new Globe(document.getElementById('globeViz'), { animateIn: false })
|
|
16
15
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-blue-marble.jpg')
|
|
17
16
|
.bumpImageUrl('//unpkg.com/three-globe/example/img/earth-topology.png');
|
|
18
17
|
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
<div id="globeViz"></div>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
const world = Globe()
|
|
13
|
-
(document.getElementById('globeViz'))
|
|
12
|
+
const world = new Globe(document.getElementById('globeViz'))
|
|
14
13
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-dark.jpg')
|
|
15
14
|
.pointOfView({ altitude: 4 }, 5000)
|
|
16
15
|
.polygonCapColor(feat => 'rgba(200, 0, 0, 0.6)')
|
|
@@ -11,11 +11,10 @@
|
|
|
11
11
|
<script type="module">
|
|
12
12
|
import * as THREE from '//unpkg.com/three/build/three.module.js';
|
|
13
13
|
|
|
14
|
-
const world = Globe()
|
|
14
|
+
const world = new Globe(document.getElementById('globeViz'))
|
|
15
15
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-blue-marble.jpg')
|
|
16
16
|
.bumpImageUrl('//unpkg.com/three-globe/example/img/earth-topology.png')
|
|
17
|
-
.backgroundImageUrl('//unpkg.com/three-globe/example/img/night-sky.png')
|
|
18
|
-
(document.getElementById('globeViz'));
|
|
17
|
+
.backgroundImageUrl('//unpkg.com/three-globe/example/img/night-sky.png');
|
|
19
18
|
|
|
20
19
|
// custom globe material
|
|
21
20
|
const globeMaterial = world.globeMaterial();
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
color: ['red', 'white', 'blue', 'green'][Math.round(Math.random() * 3)]
|
|
22
22
|
}));
|
|
23
23
|
|
|
24
|
-
const world = Globe()
|
|
25
|
-
(document.getElementById('globeViz'))
|
|
24
|
+
const world = new Globe(document.getElementById('globeViz'))
|
|
26
25
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-blue-marble.jpg')
|
|
27
26
|
.bumpImageUrl('//unpkg.com/three-globe/example/img/earth-topology.png')
|
|
28
27
|
.pointOfView({ altitude: 3.5 })
|
|
@@ -11,14 +11,13 @@
|
|
|
11
11
|
<script>
|
|
12
12
|
const shieldRing = { lat: 90, lng: 0 };
|
|
13
13
|
|
|
14
|
-
const globe = Globe()
|
|
14
|
+
const globe = new Globe(document.getElementById('globeViz'))
|
|
15
15
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
16
16
|
.ringsData([shieldRing])
|
|
17
17
|
.ringAltitude(0.25)
|
|
18
18
|
.ringColor(() => 'lightblue')
|
|
19
19
|
.ringMaxRadius(180)
|
|
20
20
|
.ringPropagationSpeed(20)
|
|
21
|
-
.ringRepeatPeriod(200)
|
|
22
|
-
(document.getElementById('globeViz'));
|
|
21
|
+
.ringRepeatPeriod(200);
|
|
23
22
|
</script>
|
|
24
23
|
</body>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
.range(['lightblue', 'darkred'])
|
|
17
17
|
.clamp(true);
|
|
18
18
|
|
|
19
|
-
const myGlobe = Globe()
|
|
19
|
+
const myGlobe = new Globe(document.getElementById('globeViz'))
|
|
20
20
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
21
21
|
.hexBinPointLat(d => d.geometry.coordinates[1])
|
|
22
22
|
.hexBinPointLng(d => d.geometry.coordinates[0])
|
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
<b>${d.points.length}</b> earthquakes in the past month:<ul><li>
|
|
29
29
|
${d.points.slice().sort((a, b) => b.properties.mag - a.properties.mag).map(d => d.properties.title).join('</li><li>')}
|
|
30
30
|
</li></ul>
|
|
31
|
-
`)
|
|
32
|
-
(document.getElementById('globeViz'));
|
|
31
|
+
`);
|
|
33
32
|
|
|
34
33
|
fetch('//earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_month.geojson').then(res => res.json()).then(equakes => {
|
|
35
34
|
myGlobe.hexBinPointsData(equakes.features);
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
const RINGS_MAX_R = 5; // deg
|
|
16
16
|
const RING_PROPAGATION_SPEED = 5; // deg/sec
|
|
17
17
|
|
|
18
|
-
const globe = Globe()
|
|
18
|
+
const globe = new Globe(document.getElementById('globeViz'))
|
|
19
19
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
20
20
|
.arcColor(() => 'darkOrange')
|
|
21
21
|
.onGlobeClick(emitArc)
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
.ringColor(() => t => `rgba(255,100,50,${1-t})`)
|
|
28
28
|
.ringMaxRadius(RINGS_MAX_R)
|
|
29
29
|
.ringPropagationSpeed(RING_PROPAGATION_SPEED)
|
|
30
|
-
.ringRepeatPeriod(FLIGHT_TIME * ARC_REL_LEN / NUM_RINGS)
|
|
31
|
-
(document.getElementById('globeViz'));
|
|
30
|
+
.ringRepeatPeriod(FLIGHT_TIME * ARC_REL_LEN / NUM_RINGS);
|
|
32
31
|
|
|
33
32
|
let prevCoords = { lat: 0, lng: 0 };
|
|
34
33
|
function emitArc({ lat: endLat, lng: endLng }) {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
weight: Math.random()
|
|
18
18
|
}));
|
|
19
19
|
|
|
20
|
-
const world = Globe()
|
|
20
|
+
const world = new Globe(document.getElementById('globeViz'))
|
|
21
21
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-dark.jpg')
|
|
22
22
|
.heatmapsData([gData])
|
|
23
23
|
.heatmapPointLat('lat')
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
.heatmapPointWeight('weight')
|
|
26
26
|
.heatmapTopAltitude(0.7)
|
|
27
27
|
.heatmapsTransitionDuration(3000)
|
|
28
|
-
.enablePointerInteraction(false)
|
|
29
|
-
(document.getElementById('globeViz'));
|
|
28
|
+
.enablePointerInteraction(false);
|
|
30
29
|
</script>
|
|
31
30
|
</body>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<script>
|
|
12
12
|
fetch('../datasets/ne_110m_admin_0_countries.geojson').then(res => res.json()).then(countries =>
|
|
13
13
|
{
|
|
14
|
-
const world = Globe()
|
|
14
|
+
const world = new Globe(document.getElementById('globeViz'))
|
|
15
15
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-dark.jpg')
|
|
16
16
|
.hexPolygonsData(countries.features)
|
|
17
17
|
.hexPolygonResolution(3)
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
.hexPolygonLabel(({ properties: d }) => `
|
|
22
22
|
<b>${d.ADMIN} (${d.ISO_A2})</b> <br />
|
|
23
23
|
Population: <i>${d.POP_EST}</i>
|
|
24
|
-
`)
|
|
25
|
-
(document.getElementById('globeViz'))
|
|
24
|
+
`);
|
|
26
25
|
});
|
|
27
26
|
</script>
|
|
28
27
|
</body>
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
<script type="module">
|
|
14
14
|
import * as THREE from '//unpkg.com/three/build/three.module.js';
|
|
15
15
|
|
|
16
|
-
const world = Globe()
|
|
17
|
-
(document.getElementById('globeViz'))
|
|
16
|
+
const world = new Globe(document.getElementById('globeViz'))
|
|
18
17
|
.backgroundColor('rgba(0,0,0,0)')
|
|
19
18
|
.showGlobe(false)
|
|
20
19
|
.showAtmosphere(false);
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
color: ['red', 'white', 'blue', 'green'][Math.round(Math.random() * 3)]
|
|
24
24
|
}));
|
|
25
25
|
|
|
26
|
-
Globe()
|
|
26
|
+
new Globe(document.getElementById('globeViz'))
|
|
27
27
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-dark.jpg')
|
|
28
28
|
.htmlElementsData(gData)
|
|
29
29
|
.htmlElement(d => {
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
el.style.cursor = 'pointer';
|
|
37
37
|
el.onclick = () => console.info(d);
|
|
38
38
|
return el;
|
|
39
|
-
})
|
|
40
|
-
(document.getElementById('globeViz'));
|
|
39
|
+
});
|
|
41
40
|
</script>
|
|
42
41
|
</body>
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
const labelsTopOrientation = new Set(['Apollo 12', 'Luna 2', 'Luna 20', 'Luna 21', 'Luna 24', 'LCROSS Probe']); // avoid label collisions
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
const moon = Globe()
|
|
19
|
+
const moon = new Globe(document.getElementById('globeViz'))
|
|
21
20
|
.globeImageUrl('./lunar_surface.jpg')
|
|
22
21
|
.bumpImageUrl('./lunar_bumpmap.jpg')
|
|
23
22
|
.backgroundImageUrl('//unpkg.com/three-globe/example/img/night-sky.png')
|
|
@@ -33,8 +32,7 @@
|
|
|
33
32
|
<div>${d.agency} - ${d.program} Program</div>
|
|
34
33
|
<div>Landing on <i>${new Date(d.date).toLocaleDateString()}</i></div>
|
|
35
34
|
`)
|
|
36
|
-
.onLabelClick(d => window.open(d.url, '_blank'))
|
|
37
|
-
(elem);
|
|
35
|
+
.onLabelClick(d => window.open(d.url, '_blank'));
|
|
38
36
|
|
|
39
37
|
fetch('./moon_landings.json').then(r => r.json()).then(landingSites => {
|
|
40
38
|
moon.labelsData(landingSites);
|
|
@@ -11,15 +11,14 @@
|
|
|
11
11
|
<div id="globeViz"></div>
|
|
12
12
|
|
|
13
13
|
<script>
|
|
14
|
-
const world = Globe()
|
|
14
|
+
const world = new Globe(document.getElementById('globeViz'))
|
|
15
15
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
16
16
|
.heatmapPointLat('lat')
|
|
17
17
|
.heatmapPointLng('lng')
|
|
18
18
|
.heatmapPointWeight('pop')
|
|
19
19
|
.heatmapBandwidth(0.9)
|
|
20
20
|
.heatmapColorSaturation(2.8)
|
|
21
|
-
.enablePointerInteraction(false)
|
|
22
|
-
(document.getElementById('globeViz'));
|
|
21
|
+
.enablePointerInteraction(false);
|
|
23
22
|
|
|
24
23
|
fetch('../datasets/world_population.csv').then(res => res.text())
|
|
25
24
|
.then(csv => d3.csvParse(csv, ({ lat, lng, pop }) => ({ lat: +lat, lng: +lng, pop: +pop })))
|
|
@@ -19,14 +19,13 @@
|
|
|
19
19
|
color: [['red', 'white', 'blue', 'green'][Math.round(Math.random() * 3)], ['red', 'white', 'blue', 'green'][Math.round(Math.random() * 3)]]
|
|
20
20
|
}));
|
|
21
21
|
|
|
22
|
-
Globe()
|
|
22
|
+
new Globe(document.getElementById('globeViz'))
|
|
23
23
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
24
24
|
.arcsData(arcsData)
|
|
25
25
|
.arcColor('color')
|
|
26
26
|
.arcDashLength(() => Math.random())
|
|
27
27
|
.arcDashGap(() => Math.random())
|
|
28
|
-
.arcDashAnimateTime(() => Math.random() * 4000 + 500)
|
|
29
|
-
(document.getElementById('globeViz'))
|
|
28
|
+
.arcDashAnimateTime(() => Math.random() * 4000 + 500);
|
|
30
29
|
|
|
31
30
|
</script>
|
|
32
31
|
</body>
|
|
@@ -29,15 +29,14 @@
|
|
|
29
29
|
})];
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
const globe = Globe()
|
|
32
|
+
const globe = new Globe(document.getElementById('globeViz'))
|
|
33
33
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-dark.jpg')
|
|
34
34
|
.bumpImageUrl('//unpkg.com/three-globe/example/img/earth-topology.png')
|
|
35
35
|
.pathsData(gData)
|
|
36
36
|
.pathColor(() => ['rgba(0,0,255,0.6)', 'rgba(255,0,0,0.6)'])
|
|
37
37
|
.pathDashLength(0.01)
|
|
38
38
|
.pathDashGap(0.004)
|
|
39
|
-
.pathDashAnimateTime(100000)
|
|
40
|
-
(document.getElementById('globeViz'));
|
|
39
|
+
.pathDashAnimateTime(100000);
|
|
41
40
|
|
|
42
41
|
setTimeout(() => {
|
|
43
42
|
globe
|
|
@@ -21,14 +21,13 @@
|
|
|
21
21
|
|
|
22
22
|
const colorInterpolator = t => `rgba(255,100,50,${Math.sqrt(1-t)})`;
|
|
23
23
|
|
|
24
|
-
const globe = Globe()
|
|
24
|
+
const globe = new Globe(document.getElementById('globeViz'))
|
|
25
25
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
26
26
|
.ringsData(gData)
|
|
27
27
|
.ringColor(() => colorInterpolator)
|
|
28
28
|
.ringMaxRadius('maxR')
|
|
29
29
|
.ringPropagationSpeed('propagationSpeed')
|
|
30
|
-
.ringRepeatPeriod('repeatPeriod')
|
|
31
|
-
(document.getElementById('globeViz'));
|
|
30
|
+
.ringRepeatPeriod('repeatPeriod');
|
|
32
31
|
|
|
33
32
|
</script>
|
|
34
33
|
</body>
|
|
@@ -34,8 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
const timeLogger = document.getElementById('time-log');
|
|
36
36
|
|
|
37
|
-
const world = Globe()
|
|
38
|
-
(document.getElementById('chart'))
|
|
37
|
+
const world = new Globe(document.getElementById('chart'))
|
|
39
38
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-blue-marble.jpg')
|
|
40
39
|
.objectLat('lat')
|
|
41
40
|
.objectLng('lng')
|
|
@@ -39,8 +39,7 @@
|
|
|
39
39
|
const solarTile = { pos: sunPosAt(dt) };
|
|
40
40
|
const timeEl = document.getElementById('time');
|
|
41
41
|
|
|
42
|
-
const world = Globe()
|
|
43
|
-
(document.getElementById('globeViz'))
|
|
42
|
+
const world = new Globe(document.getElementById('globeViz'))
|
|
44
43
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-dark.jpg')
|
|
45
44
|
.tilesData([solarTile])
|
|
46
45
|
.tileLng(d => d.pos[0])
|
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
<div id="globeViz"></div>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
const globe = Globe()
|
|
12
|
+
const globe = new Globe(document.getElementById('globeViz'))
|
|
13
13
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-dark.jpg')
|
|
14
14
|
.bumpImageUrl('//unpkg.com/three-globe/example/img/earth-topology.png')
|
|
15
|
-
.backgroundImageUrl('//unpkg.com/three-globe/example/img/night-sky.png')
|
|
16
|
-
(document.getElementById('globeViz'));
|
|
15
|
+
.backgroundImageUrl('//unpkg.com/three-globe/example/img/night-sky.png');
|
|
17
16
|
|
|
18
17
|
// from https://www.submarinecablemap.com
|
|
19
18
|
fetch('//http-proxy.vastur.com?url=https://www.submarinecablemap.com/api/v3/cable/cable-geo.json')
|
package/example/tiles/index.html
CHANGED
|
@@ -31,12 +31,11 @@
|
|
|
31
31
|
)
|
|
32
32
|
);
|
|
33
33
|
|
|
34
|
-
Globe()
|
|
34
|
+
new Globe(document.getElementById('globeViz'))
|
|
35
35
|
.tilesData(tilesData)
|
|
36
36
|
.tileWidth(tileWidth - TILE_MARGIN)
|
|
37
37
|
.tileHeight(tileHeight - TILE_MARGIN)
|
|
38
|
-
.tileMaterial('material')
|
|
39
|
-
(document.getElementById('globeViz'))
|
|
38
|
+
.tileMaterial('material');
|
|
40
39
|
|
|
41
40
|
</script>
|
|
42
41
|
</body>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</div>
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
|
-
const myGlobe = Globe()
|
|
27
|
+
const myGlobe = new Globe(document.getElementById('globeViz'))
|
|
28
28
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
29
29
|
.backgroundImageUrl('//unpkg.com/three-globe/example/img/night-sky.png')
|
|
30
30
|
.pointLat('lat')
|
|
@@ -42,8 +42,7 @@
|
|
|
42
42
|
.labelText('name')
|
|
43
43
|
.labelSize(0.15)
|
|
44
44
|
.labelResolution(1)
|
|
45
|
-
.labelLabel(getTooltip)
|
|
46
|
-
(document.getElementById('globeViz'));
|
|
45
|
+
.labelLabel(getTooltip);
|
|
47
46
|
|
|
48
47
|
fetch('../datasets/world_volcanoes.json').then(res => res.json()).then(volcanoes => {
|
|
49
48
|
myGlobe.pointsData(volcanoes)
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<div id="globeViz"></div>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
const world = Globe()
|
|
12
|
+
const world = new Globe(document.getElementById('globeViz'))
|
|
13
13
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-blue-marble.jpg')
|
|
14
14
|
.heatmapPointLat('lat')
|
|
15
15
|
.heatmapPointLng('lon')
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
.heatmapTopAltitude(0.2)
|
|
18
18
|
.heatmapBandwidth(1.35)
|
|
19
19
|
.heatmapColorSaturation(3.2)
|
|
20
|
-
.enablePointerInteraction(false)
|
|
21
|
-
(document.getElementById('globeViz'));
|
|
20
|
+
.enablePointerInteraction(false);
|
|
22
21
|
|
|
23
22
|
fetch('../datasets/world_volcanoes.json').then(res => res.json()).then(volcanoes => {
|
|
24
23
|
world.heatmapsData([volcanoes])
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
12
|
fetch('../datasets/ne_110m_populated_places_simple.geojson').then(res => res.json()).then(places => {
|
|
13
|
-
Globe()
|
|
13
|
+
new Globe(document.getElementById('globeViz'))
|
|
14
14
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
15
15
|
.backgroundImageUrl('//unpkg.com/three-globe/example/img/night-sky.png')
|
|
16
16
|
.labelsData(places.features)
|
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
.labelSize(d => Math.sqrt(d.properties.pop_max) * 4e-4)
|
|
21
21
|
.labelDotRadius(d => Math.sqrt(d.properties.pop_max) * 4e-4)
|
|
22
22
|
.labelColor(() => 'rgba(255, 165, 0, 0.75)')
|
|
23
|
-
.labelResolution(2)
|
|
24
|
-
(document.getElementById('globeViz'))
|
|
23
|
+
.labelResolution(2);
|
|
25
24
|
});
|
|
26
25
|
</script>
|
|
27
26
|
</body>
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
const weightColor = d3.scaleSequentialSqrt(d3.interpolateYlOrRd)
|
|
16
16
|
.domain([0, 1e7]);
|
|
17
17
|
|
|
18
|
-
const world = Globe()
|
|
19
|
-
(document.getElementById('globeViz'))
|
|
18
|
+
const world = new Globe(document.getElementById('globeViz'))
|
|
20
19
|
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
21
20
|
.bumpImageUrl('//unpkg.com/three-globe/example/img/earth-topology.png')
|
|
22
21
|
.backgroundImageUrl('//unpkg.com/three-globe/example/img/night-sky.png')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "globe.gl",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.34.0",
|
|
4
4
|
"description": "UI component for Globe Data Visualization using ThreeJS/WebGL",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"unpkg": "dist/globe.gl.min.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@tweenjs/tween.js": "18 - 25",
|
|
52
52
|
"accessor-fn": "1",
|
|
53
|
-
"kapsule": "1",
|
|
53
|
+
"kapsule": "^1.16",
|
|
54
54
|
"three": ">=0.154 <1",
|
|
55
55
|
"three-globe": "^2.35",
|
|
56
56
|
"three-render-objects": "^1.31"
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"@rollup/plugin-terser": "^0.4.4",
|
|
65
65
|
"postcss": "^8.4.49",
|
|
66
66
|
"rimraf": "^6.0.1",
|
|
67
|
-
"rollup": "^4.
|
|
67
|
+
"rollup": "^4.28.0",
|
|
68
68
|
"rollup-plugin-dts": "^6.1.1",
|
|
69
69
|
"rollup-plugin-postcss": "^4.0.2",
|
|
70
|
-
"typescript": "^5.
|
|
70
|
+
"typescript": "^5.7.2"
|
|
71
71
|
},
|
|
72
72
|
"engines": {
|
|
73
73
|
"node": ">=12"
|