globe.gl 2.29.3 → 2.30.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 +31 -2
- package/dist/globe.gl.d.ts +3 -0
- package/dist/globe.gl.js +1778 -794
- package/dist/globe.gl.js.map +1 -1
- package/dist/globe.gl.min.js +5 -5
- package/dist/globe.gl.mjs +18 -1
- package/example/heatmap/index.html +31 -0
- package/example/heatmap/preview.png +0 -0
- package/example/population-heatmap/index.html +28 -0
- package/example/population-heatmap/preview.png +0 -0
- package/example/volcanoes-heatmap/index.html +27 -0
- package/example/volcanoes-heatmap/preview.png +0 -0
- package/package.json +10 -10
package/dist/globe.gl.mjs
CHANGED
|
@@ -179,7 +179,7 @@ var THREE = _objectSpread2(_objectSpread2({}, window.THREE ? window.THREE // Pre
|
|
|
179
179
|
|
|
180
180
|
// Expose config from ThreeGlobe
|
|
181
181
|
var bindGlobe = linkKapsule('globe', ThreeGlobe);
|
|
182
|
-
var linkedGlobeProps = Object.assign.apply(Object, _toConsumableArray(['globeImageUrl', 'bumpImageUrl', 'showGlobe', 'showGraticules', 'showAtmosphere', 'atmosphereColor', 'atmosphereAltitude', 'onGlobeReady', 'pointsData', 'pointLat', 'pointLng', 'pointColor', 'pointAltitude', 'pointRadius', 'pointResolution', 'pointsMerge', 'pointsTransitionDuration', 'arcsData', 'arcStartLat', 'arcStartLng', 'arcEndLat', 'arcEndLng', 'arcColor', 'arcAltitude', 'arcAltitudeAutoScale', 'arcStroke', 'arcCurveResolution', 'arcCircularResolution', 'arcDashLength', 'arcDashGap', 'arcDashInitialGap', 'arcDashAnimateTime', 'arcsTransitionDuration', 'polygonsData', 'polygonGeoJsonGeometry', 'polygonCapColor', 'polygonCapMaterial', 'polygonSideColor', 'polygonSideMaterial', 'polygonStrokeColor', 'polygonAltitude', 'polygonCapCurvatureResolution', 'polygonsTransitionDuration', 'pathsData', 'pathPoints', 'pathPointLat', 'pathPointLng', 'pathPointAlt', 'pathResolution', 'pathColor', 'pathStroke', 'pathDashLength', 'pathDashGap', 'pathDashInitialGap', 'pathDashAnimateTime', 'pathTransitionDuration', 'hexBinPointsData', 'hexBinPointLat', 'hexBinPointLng', 'hexBinPointWeight', 'hexBinResolution', 'hexMargin', 'hexTopCurvatureResolution', 'hexTopColor', 'hexSideColor', 'hexAltitude', 'hexBinMerge', 'hexTransitionDuration', 'hexPolygonsData', 'hexPolygonGeoJsonGeometry', 'hexPolygonColor', 'hexPolygonAltitude', 'hexPolygonResolution', 'hexPolygonMargin', 'hexPolygonCurvatureResolution', 'hexPolygonsTransitionDuration', 'tilesData', 'tileLat', 'tileLng', 'tileAltitude', 'tileWidth', 'tileHeight', 'tileUseGlobeProjection', 'tileMaterial', 'tileCurvatureResolution', 'tilesTransitionDuration', 'ringsData', 'ringLat', 'ringLng', 'ringAltitude', 'ringColor', 'ringResolution', 'ringMaxRadius', 'ringPropagationSpeed', 'ringRepeatPeriod', 'labelsData', 'labelLat', 'labelLng', 'labelAltitude', 'labelRotation', 'labelText', 'labelSize', 'labelTypeFace', 'labelColor', 'labelResolution', 'labelIncludeDot', 'labelDotRadius', 'labelDotOrientation', 'labelsTransitionDuration', 'htmlElementsData', 'htmlLat', 'htmlLng', 'htmlAltitude', 'htmlElement', 'htmlTransitionDuration', 'objectsData', 'objectLat', 'objectLng', 'objectAltitude', 'objectRotation', 'objectFacesSurface', 'objectThreeObject', 'customLayerData', 'customThreeObject', 'customThreeObjectUpdate'].map(function (p) {
|
|
182
|
+
var linkedGlobeProps = Object.assign.apply(Object, _toConsumableArray(['globeImageUrl', 'bumpImageUrl', 'showGlobe', 'showGraticules', 'showAtmosphere', 'atmosphereColor', 'atmosphereAltitude', 'onGlobeReady', 'pointsData', 'pointLat', 'pointLng', 'pointColor', 'pointAltitude', 'pointRadius', 'pointResolution', 'pointsMerge', 'pointsTransitionDuration', 'arcsData', 'arcStartLat', 'arcStartLng', 'arcEndLat', 'arcEndLng', 'arcColor', 'arcAltitude', 'arcAltitudeAutoScale', 'arcStroke', 'arcCurveResolution', 'arcCircularResolution', 'arcDashLength', 'arcDashGap', 'arcDashInitialGap', 'arcDashAnimateTime', 'arcsTransitionDuration', 'polygonsData', 'polygonGeoJsonGeometry', 'polygonCapColor', 'polygonCapMaterial', 'polygonSideColor', 'polygonSideMaterial', 'polygonStrokeColor', 'polygonAltitude', 'polygonCapCurvatureResolution', 'polygonsTransitionDuration', 'pathsData', 'pathPoints', 'pathPointLat', 'pathPointLng', 'pathPointAlt', 'pathResolution', 'pathColor', 'pathStroke', 'pathDashLength', 'pathDashGap', 'pathDashInitialGap', 'pathDashAnimateTime', 'pathTransitionDuration', 'heatmapsData', 'heatmapPoints', 'heatmapPointLat', 'heatmapPointLng', 'heatmapPointWeight', 'heatmapBandwidth', 'heatmapColorFn', 'heatmapColorSaturation', 'heatmapBaseAltitude', 'heatmapTopAltitude', 'heatmapsTransitionDuration', 'hexBinPointsData', 'hexBinPointLat', 'hexBinPointLng', 'hexBinPointWeight', 'hexBinResolution', 'hexMargin', 'hexTopCurvatureResolution', 'hexTopColor', 'hexSideColor', 'hexAltitude', 'hexBinMerge', 'hexTransitionDuration', 'hexPolygonsData', 'hexPolygonGeoJsonGeometry', 'hexPolygonColor', 'hexPolygonAltitude', 'hexPolygonResolution', 'hexPolygonMargin', 'hexPolygonCurvatureResolution', 'hexPolygonsTransitionDuration', 'tilesData', 'tileLat', 'tileLng', 'tileAltitude', 'tileWidth', 'tileHeight', 'tileUseGlobeProjection', 'tileMaterial', 'tileCurvatureResolution', 'tilesTransitionDuration', 'ringsData', 'ringLat', 'ringLng', 'ringAltitude', 'ringColor', 'ringResolution', 'ringMaxRadius', 'ringPropagationSpeed', 'ringRepeatPeriod', 'labelsData', 'labelLat', 'labelLng', 'labelAltitude', 'labelRotation', 'labelText', 'labelSize', 'labelTypeFace', 'labelColor', 'labelResolution', 'labelIncludeDot', 'labelDotRadius', 'labelDotOrientation', 'labelsTransitionDuration', 'htmlElementsData', 'htmlLat', 'htmlLng', 'htmlAltitude', 'htmlElement', 'htmlTransitionDuration', 'objectsData', 'objectLat', 'objectLng', 'objectAltitude', 'objectRotation', 'objectFacesSurface', 'objectThreeObject', 'customLayerData', 'customThreeObject', 'customThreeObjectUpdate'].map(function (p) {
|
|
183
183
|
return _defineProperty({}, p, bindGlobe.linkProp(p));
|
|
184
184
|
})));
|
|
185
185
|
var linkedGlobeMethods = Object.assign.apply(Object, _toConsumableArray(['globeMaterial', 'getGlobeRadius', 'getCoords', 'toGeoCoords'].map(function (p) {
|
|
@@ -260,6 +260,15 @@ var globe = Kapsule({
|
|
|
260
260
|
onPathHover: {
|
|
261
261
|
triggerUpdate: false
|
|
262
262
|
},
|
|
263
|
+
onHeatmapClick: {
|
|
264
|
+
triggerUpdate: false
|
|
265
|
+
},
|
|
266
|
+
onHeatmapRightClick: {
|
|
267
|
+
triggerUpdate: false
|
|
268
|
+
},
|
|
269
|
+
onHeatmapHover: {
|
|
270
|
+
triggerUpdate: false
|
|
271
|
+
},
|
|
263
272
|
hexLabel: {
|
|
264
273
|
triggerUpdate: false
|
|
265
274
|
},
|
|
@@ -461,6 +470,7 @@ var globe = Kapsule({
|
|
|
461
470
|
this.arcsData([]);
|
|
462
471
|
this.polygonsData([]);
|
|
463
472
|
this.pathsData([]);
|
|
473
|
+
this.heatmapsData([]);
|
|
464
474
|
this.hexBinPointsData([]);
|
|
465
475
|
this.hexPolygonsData([]);
|
|
466
476
|
this.tilesData([]);
|
|
@@ -553,6 +563,9 @@ var globe = Kapsule({
|
|
|
553
563
|
path: function path(d) {
|
|
554
564
|
return d;
|
|
555
565
|
},
|
|
566
|
+
heatmap: function heatmap(d) {
|
|
567
|
+
return d;
|
|
568
|
+
},
|
|
556
569
|
hexbin: function hexbin(d) {
|
|
557
570
|
return d;
|
|
558
571
|
},
|
|
@@ -607,6 +620,7 @@ var globe = Kapsule({
|
|
|
607
620
|
arc: state.onArcHover,
|
|
608
621
|
polygon: state.onPolygonHover,
|
|
609
622
|
path: state.onPathHover,
|
|
623
|
+
heatmap: state.onHeatmapHover,
|
|
610
624
|
hexbin: state.onHexHover,
|
|
611
625
|
hexPolygon: state.onHexPolygonHover,
|
|
612
626
|
tile: state.onTileHover,
|
|
@@ -620,6 +634,7 @@ var globe = Kapsule({
|
|
|
620
634
|
arc: state.onArcClick,
|
|
621
635
|
polygon: state.onPolygonClick,
|
|
622
636
|
path: state.onPathClick,
|
|
637
|
+
heatmap: state.onHeatmapClick,
|
|
623
638
|
hexbin: state.onHexClick,
|
|
624
639
|
hexPolygon: state.onHexPolygonClick,
|
|
625
640
|
tile: state.onTileClick,
|
|
@@ -659,6 +674,7 @@ var globe = Kapsule({
|
|
|
659
674
|
arc: state.onArcClick,
|
|
660
675
|
polygon: state.onPolygonClick,
|
|
661
676
|
path: state.onPathClick,
|
|
677
|
+
heatmap: state.onHeatmapClick,
|
|
662
678
|
hexbin: state.onHexClick,
|
|
663
679
|
hexPolygon: state.onHexPolygonClick,
|
|
664
680
|
tile: state.onTileClick,
|
|
@@ -696,6 +712,7 @@ var globe = Kapsule({
|
|
|
696
712
|
arc: state.onArcRightClick,
|
|
697
713
|
polygon: state.onPolygonRightClick,
|
|
698
714
|
path: state.onPathRightClick,
|
|
715
|
+
heatmap: state.onHeatmapRightClick,
|
|
699
716
|
hexbin: state.onHexRightClick,
|
|
700
717
|
hexPolygon: state.onHexPolygonRightClick,
|
|
701
718
|
tile: state.onTileRightClick,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<head>
|
|
2
|
+
<style> body { margin: 0; } </style>
|
|
3
|
+
|
|
4
|
+
<script src="//unpkg.com/globe.gl"></script>
|
|
5
|
+
<!-- <script src="../../dist/globe.gl.js"></script>-->
|
|
6
|
+
</head>
|
|
7
|
+
|
|
8
|
+
<body>
|
|
9
|
+
<div id="globeViz"></div>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
// Gen random data
|
|
13
|
+
const N = 300;
|
|
14
|
+
const gData = [...Array(N).keys()].map(() => ({
|
|
15
|
+
lat: (Math.random() - 0.5) * 160,
|
|
16
|
+
lng: (Math.random() - 0.5) * 360,
|
|
17
|
+
weight: Math.random()
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
const world = Globe()
|
|
21
|
+
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-dark.jpg')
|
|
22
|
+
.heatmapsData([gData])
|
|
23
|
+
.heatmapPointLat('lat')
|
|
24
|
+
.heatmapPointLng('lng')
|
|
25
|
+
.heatmapPointWeight('weight')
|
|
26
|
+
.heatmapTopAltitude(0.7)
|
|
27
|
+
.heatmapsTransitionDuration(3000)
|
|
28
|
+
.enablePointerInteraction(false)
|
|
29
|
+
(document.getElementById('globeViz'));
|
|
30
|
+
</script>
|
|
31
|
+
</body>
|
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<head>
|
|
2
|
+
<style> body { margin: 0; } </style>
|
|
3
|
+
|
|
4
|
+
<script src="//unpkg.com/d3-dsv"></script>
|
|
5
|
+
|
|
6
|
+
<script src="//unpkg.com/globe.gl"></script>
|
|
7
|
+
<!-- <script src="../../dist/globe.gl.js"></script>-->
|
|
8
|
+
</head>
|
|
9
|
+
|
|
10
|
+
<body>
|
|
11
|
+
<div id="globeViz"></div>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
const world = Globe()
|
|
15
|
+
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-night.jpg')
|
|
16
|
+
.heatmapPointLat('lat')
|
|
17
|
+
.heatmapPointLng('lng')
|
|
18
|
+
.heatmapPointWeight('pop')
|
|
19
|
+
.heatmapBandwidth(0.9)
|
|
20
|
+
.heatmapColorSaturation(2.8)
|
|
21
|
+
.enablePointerInteraction(false)
|
|
22
|
+
(document.getElementById('globeViz'));
|
|
23
|
+
|
|
24
|
+
fetch('../datasets/world_population.csv').then(res => res.text())
|
|
25
|
+
.then(csv => d3.csvParse(csv, ({ lat, lng, pop }) => ({ lat: +lat, lng: +lng, pop: +pop })))
|
|
26
|
+
.then(data => world.heatmapsData([data]));
|
|
27
|
+
</script>
|
|
28
|
+
</body>
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<head>
|
|
2
|
+
<style> body { margin: 0; } </style>
|
|
3
|
+
|
|
4
|
+
<script src="//unpkg.com/globe.gl"></script>
|
|
5
|
+
<!-- <script src="../../dist/globe.gl.js"></script>-->
|
|
6
|
+
</head>
|
|
7
|
+
|
|
8
|
+
<body>
|
|
9
|
+
<div id="globeViz"></div>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
const world = Globe()
|
|
13
|
+
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-blue-marble.jpg')
|
|
14
|
+
.heatmapPointLat('lat')
|
|
15
|
+
.heatmapPointLng('lon')
|
|
16
|
+
.heatmapPointWeight(d => d.elevation * 5e-5)
|
|
17
|
+
.heatmapTopAltitude(0.2)
|
|
18
|
+
.heatmapBandwidth(1.35)
|
|
19
|
+
.heatmapColorSaturation(3.2)
|
|
20
|
+
.enablePointerInteraction(false)
|
|
21
|
+
(document.getElementById('globeViz'));
|
|
22
|
+
|
|
23
|
+
fetch('../datasets/world_volcanoes.json').then(res => res.json()).then(volcanoes => {
|
|
24
|
+
world.heatmapsData([volcanoes])
|
|
25
|
+
});
|
|
26
|
+
</script>
|
|
27
|
+
</body>
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "globe.gl",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.30.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",
|
|
@@ -52,22 +52,22 @@
|
|
|
52
52
|
"accessor-fn": "1",
|
|
53
53
|
"kapsule": "1",
|
|
54
54
|
"three": ">=0.118 <1",
|
|
55
|
-
"three-globe": "^2.
|
|
55
|
+
"three-globe": "^2.29",
|
|
56
56
|
"three-render-objects": "^1.28"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@babel/core": "^7.
|
|
60
|
-
"@babel/preset-env": "^7.22.
|
|
59
|
+
"@babel/core": "^7.23.0",
|
|
60
|
+
"@babel/preset-env": "^7.22.20",
|
|
61
61
|
"@rollup/plugin-babel": "^6.0.3",
|
|
62
62
|
"@rollup/plugin-commonjs": "^25.0.4",
|
|
63
|
-
"@rollup/plugin-node-resolve": "^15.2.
|
|
63
|
+
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
64
64
|
"@rollup/plugin-terser": "^0.4.3",
|
|
65
|
-
"postcss": "^8.4.
|
|
66
|
-
"rimraf": "^5.0.
|
|
67
|
-
"rollup": "^3.
|
|
68
|
-
"rollup-plugin-dts": "^6.0.
|
|
65
|
+
"postcss": "^8.4.30",
|
|
66
|
+
"rimraf": "^5.0.4",
|
|
67
|
+
"rollup": "^3.29.3",
|
|
68
|
+
"rollup-plugin-dts": "^6.0.2",
|
|
69
69
|
"rollup-plugin-postcss": "^4.0.2",
|
|
70
|
-
"typescript": "^5.
|
|
70
|
+
"typescript": "^5.2.2"
|
|
71
71
|
},
|
|
72
72
|
"engines": {
|
|
73
73
|
"node": ">=12"
|