globe.gl 2.29.2 → 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/dist/globe.gl.mjs CHANGED
@@ -34,26 +34,26 @@ function styleInject(css, ref) {
34
34
  var css_248z = ".scene-container .clickable {\n cursor: pointer;\n}";
35
35
  styleInject(css_248z);
36
36
 
37
- function ownKeys(object, enumerableOnly) {
38
- var keys = Object.keys(object);
37
+ function ownKeys(e, r) {
38
+ var t = Object.keys(e);
39
39
  if (Object.getOwnPropertySymbols) {
40
- var symbols = Object.getOwnPropertySymbols(object);
41
- enumerableOnly && (symbols = symbols.filter(function (sym) {
42
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
43
- })), keys.push.apply(keys, symbols);
40
+ var o = Object.getOwnPropertySymbols(e);
41
+ r && (o = o.filter(function (r) {
42
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
43
+ })), t.push.apply(t, o);
44
44
  }
45
- return keys;
45
+ return t;
46
46
  }
47
- function _objectSpread2(target) {
48
- for (var i = 1; i < arguments.length; i++) {
49
- var source = null != arguments[i] ? arguments[i] : {};
50
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
51
- _defineProperty(target, key, source[key]);
52
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
53
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
47
+ function _objectSpread2(e) {
48
+ for (var r = 1; r < arguments.length; r++) {
49
+ var t = null != arguments[r] ? arguments[r] : {};
50
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
51
+ _defineProperty(e, r, t[r]);
52
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
53
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
54
54
  });
55
55
  }
56
- return target;
56
+ return e;
57
57
  }
58
58
  function _defineProperty(obj, key, value) {
59
59
  key = _toPropertyKey(key);
@@ -179,10 +179,10 @@ 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', 'globeMaterial', '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
- var linkedGlobeMethods = Object.assign.apply(Object, _toConsumableArray(['getGlobeRadius', 'getCoords', 'toGeoCoords'].map(function (p) {
185
+ var linkedGlobeMethods = Object.assign.apply(Object, _toConsumableArray(['globeMaterial', 'getGlobeRadius', 'getCoords', 'toGeoCoords'].map(function (p) {
186
186
  return _defineProperty({}, p, bindGlobe.linkMethod(p));
187
187
  })));
188
188
 
@@ -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
  },
@@ -361,7 +370,7 @@ var globe = Kapsule({
361
370
  cancelAnimationFrame(state.animationFrameRequestId);
362
371
  state.animationFrameRequestId = null;
363
372
  }
364
- (_state$globe = state.globe) === null || _state$globe === void 0 ? void 0 : _state$globe.pauseAnimation();
373
+ (_state$globe = state.globe) === null || _state$globe === void 0 || _state$globe.pauseAnimation();
365
374
  return this;
366
375
  },
367
376
  resumeAnimation: function resumeAnimation(state) {
@@ -369,7 +378,7 @@ var globe = Kapsule({
369
378
  if (state.animationFrameRequestId === null) {
370
379
  this._animationCycle();
371
380
  }
372
- (_state$globe2 = state.globe) === null || _state$globe2 === void 0 ? void 0 : _state$globe2.resumeAnimation();
381
+ (_state$globe2 = state.globe) === null || _state$globe2 === void 0 || _state$globe2.resumeAnimation();
373
382
  return this;
374
383
  },
375
384
  _animationCycle: function _animationCycle(state) {
@@ -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>
@@ -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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "globe.gl",
3
- "version": "2.29.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.28",
55
+ "three-globe": "^2.29",
56
56
  "three-render-objects": "^1.28"
57
57
  },
58
58
  "devDependencies": {
59
- "@babel/core": "^7.22.10",
60
- "@babel/preset-env": "^7.22.10",
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.0",
63
+ "@rollup/plugin-node-resolve": "^15.2.1",
64
64
  "@rollup/plugin-terser": "^0.4.3",
65
- "postcss": "^8.4.28",
66
- "rimraf": "^5.0.1",
67
- "rollup": "^3.28.0",
68
- "rollup-plugin-dts": "^6.0.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.1.6"
70
+ "typescript": "^5.2.2"
71
71
  },
72
72
  "engines": {
73
73
  "node": ">=12"