globe.gl 2.32.4 → 2.32.6

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
@@ -4,18 +4,24 @@ 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 * as TWEEN from '@tweenjs/tween.js';
7
+ import { Tween, Easing, Group } from '@tweenjs/tween.js';
8
8
 
9
9
  function styleInject(css, ref) {
10
- ref = {};
11
- ref.insertAt;
10
+ if (ref === void 0) ref = {};
11
+ var insertAt = ref.insertAt;
12
12
  if (typeof document === 'undefined') {
13
13
  return;
14
14
  }
15
15
  var head = document.head || document.getElementsByTagName('head')[0];
16
16
  var style = document.createElement('style');
17
17
  style.type = 'text/css';
18
- {
18
+ if (insertAt === 'top') {
19
+ if (head.firstChild) {
20
+ head.insertBefore(style, head.firstChild);
21
+ } else {
22
+ head.appendChild(style);
23
+ }
24
+ } else {
19
25
  head.appendChild(style);
20
26
  }
21
27
  if (style.styleSheet) {
@@ -28,6 +34,28 @@ function styleInject(css, ref) {
28
34
  var css_248z = ".scene-container .clickable {\n cursor: pointer;\n}";
29
35
  styleInject(css_248z);
30
36
 
37
+ function _arrayLikeToArray(r, a) {
38
+ (null == a || a > r.length) && (a = r.length);
39
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
40
+ return n;
41
+ }
42
+ function _arrayWithoutHoles(r) {
43
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
44
+ }
45
+ function _defineProperty(e, r, t) {
46
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
47
+ value: t,
48
+ enumerable: !0,
49
+ configurable: !0,
50
+ writable: !0
51
+ }) : e[r] = t, e;
52
+ }
53
+ function _iterableToArray(r) {
54
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
55
+ }
56
+ function _nonIterableSpread() {
57
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
58
+ }
31
59
  function ownKeys(e, r) {
32
60
  var t = Object.keys(e);
33
61
  if (Object.getOwnPropertySymbols) {
@@ -49,85 +77,49 @@ function _objectSpread2(e) {
49
77
  }
50
78
  return e;
51
79
  }
80
+ function _objectWithoutProperties(e, t) {
81
+ if (null == e) return {};
82
+ var o,
83
+ r,
84
+ i = _objectWithoutPropertiesLoose(e, t);
85
+ if (Object.getOwnPropertySymbols) {
86
+ var s = Object.getOwnPropertySymbols(e);
87
+ for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
88
+ }
89
+ return i;
90
+ }
91
+ function _objectWithoutPropertiesLoose(r, e) {
92
+ if (null == r) return {};
93
+ var t = {};
94
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
95
+ if (e.includes(n)) continue;
96
+ t[n] = r[n];
97
+ }
98
+ return t;
99
+ }
100
+ function _toConsumableArray(r) {
101
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
102
+ }
52
103
  function _toPrimitive(t, r) {
53
104
  if ("object" != typeof t || !t) return t;
54
105
  var e = t[Symbol.toPrimitive];
55
106
  if (void 0 !== e) {
56
- var i = e.call(t, r );
107
+ var i = e.call(t, r || "default");
57
108
  if ("object" != typeof i) return i;
58
109
  throw new TypeError("@@toPrimitive must return a primitive value.");
59
110
  }
60
- return (String )(t);
111
+ return ("string" === r ? String : Number)(t);
61
112
  }
62
113
  function _toPropertyKey(t) {
63
114
  var i = _toPrimitive(t, "string");
64
115
  return "symbol" == typeof i ? i : i + "";
65
116
  }
66
- function _defineProperty(obj, key, value) {
67
- key = _toPropertyKey(key);
68
- if (key in obj) {
69
- Object.defineProperty(obj, key, {
70
- value: value,
71
- enumerable: true,
72
- configurable: true,
73
- writable: true
74
- });
75
- } else {
76
- obj[key] = value;
77
- }
78
- return obj;
79
- }
80
- function _objectWithoutPropertiesLoose(source, excluded) {
81
- if (source == null) return {};
82
- var target = {};
83
- var sourceKeys = Object.keys(source);
84
- var key, i;
85
- for (i = 0; i < sourceKeys.length; i++) {
86
- key = sourceKeys[i];
87
- if (excluded.indexOf(key) >= 0) continue;
88
- target[key] = source[key];
89
- }
90
- return target;
91
- }
92
- function _objectWithoutProperties(source, excluded) {
93
- if (source == null) return {};
94
- var target = _objectWithoutPropertiesLoose(source, excluded);
95
- var key, i;
96
- if (Object.getOwnPropertySymbols) {
97
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
98
- for (i = 0; i < sourceSymbolKeys.length; i++) {
99
- key = sourceSymbolKeys[i];
100
- if (excluded.indexOf(key) >= 0) continue;
101
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
102
- target[key] = source[key];
103
- }
117
+ function _unsupportedIterableToArray(r, a) {
118
+ if (r) {
119
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
120
+ var t = {}.toString.call(r).slice(8, -1);
121
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
104
122
  }
105
- return target;
106
- }
107
- function _toConsumableArray(arr) {
108
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
109
- }
110
- function _arrayWithoutHoles(arr) {
111
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
112
- }
113
- function _iterableToArray(iter) {
114
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
115
- }
116
- function _unsupportedIterableToArray(o, minLen) {
117
- if (!o) return;
118
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
119
- var n = Object.prototype.toString.call(o).slice(8, -1);
120
- if (n === "Object" && o.constructor) n = o.constructor.name;
121
- if (n === "Map" || n === "Set") return Array.from(o);
122
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
123
- }
124
- function _arrayLikeToArray(arr, len) {
125
- len = arr.length;
126
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
127
- return arr2;
128
- }
129
- function _nonIterableSpread() {
130
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
131
123
  }
132
124
 
133
125
  function linkKapsule (kapsulePropName, kapsuleType) {
@@ -379,6 +371,7 @@ var globe = Kapsule({
379
371
  _animationCycle: function _animationCycle(state) {
380
372
  // Frame cycle
381
373
  state.renderObjs.tick();
374
+ state.tweenGroup.update();
382
375
  state.animationFrameRequestId = requestAnimationFrame(this._animationCycle);
383
376
  },
384
377
  pointOfView: function pointOfView(state) {
@@ -403,7 +396,7 @@ var globe = Kapsule({
403
396
  // Avoid rotating more than 180deg longitude
404
397
  while (curGeoCoords.lng - finalGeoCoords.lng > 180) curGeoCoords.lng -= 360;
405
398
  while (curGeoCoords.lng - finalGeoCoords.lng < -180) curGeoCoords.lng += 360;
406
- new TWEEN.Tween(curGeoCoords).to(finalGeoCoords, transitionDuration).easing(TWEEN.Easing.Cubic.InOut).onUpdate(setCameraPos).start();
399
+ state.tweenGroup.add(new Tween(curGeoCoords).to(finalGeoCoords, transitionDuration).easing(Easing.Cubic.InOut).onUpdate(setCameraPos).start());
407
400
  }
408
401
  return this;
409
402
  }
@@ -491,7 +484,8 @@ var globe = Kapsule({
491
484
  waitForLoadComplete: waitForGlobeReady,
492
485
  extraRenderers: [new THREE.CSS2DRenderer()] // Used in HTML elements layer
493
486
  }).skyRadius(globe.getGlobeRadius() * 500).showNavInfo(false).objects([globe]) // Populate scene
494
- .lights([new THREE.AmbientLight(0xcccccc, Math.PI), new THREE.DirectionalLight(0xffffff, 0.6 * Math.PI)])
487
+ .lights([new THREE.AmbientLight(0xcccccc, Math.PI), new THREE.DirectionalLight(0xffffff, 0.6 * Math.PI)]),
488
+ tweenGroup: new Group()
495
489
  };
496
490
  },
497
491
  init: function init(domNode, state) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "globe.gl",
3
- "version": "2.32.4",
3
+ "version": "2.32.6",
4
4
  "description": "UI component for Globe Data Visualization using ThreeJS/WebGL",
5
5
  "type": "module",
6
6
  "unpkg": "dist/globe.gl.min.js",
@@ -48,7 +48,7 @@
48
48
  "example/**/*"
49
49
  ],
50
50
  "dependencies": {
51
- "@tweenjs/tween.js": "18 - 23",
51
+ "@tweenjs/tween.js": "18 - 25",
52
52
  "accessor-fn": "1",
53
53
  "kapsule": "1",
54
54
  "three": ">=0.118 <1",
@@ -56,18 +56,18 @@
56
56
  "three-render-objects": "^1.29"
57
57
  },
58
58
  "devDependencies": {
59
- "@babel/core": "^7.24.4",
60
- "@babel/preset-env": "^7.24.4",
59
+ "@babel/core": "^7.25.2",
60
+ "@babel/preset-env": "^7.25.4",
61
61
  "@rollup/plugin-babel": "^6.0.4",
62
- "@rollup/plugin-commonjs": "^25.0.7",
63
- "@rollup/plugin-node-resolve": "^15.2.3",
62
+ "@rollup/plugin-commonjs": "^28.0.0",
63
+ "@rollup/plugin-node-resolve": "^15.3.0",
64
64
  "@rollup/plugin-terser": "^0.4.4",
65
- "postcss": "^8.4.38",
66
- "rimraf": "^5.0.5",
67
- "rollup": "^4.16.1",
68
- "rollup-plugin-dts": "^6.1.0",
65
+ "postcss": "^8.4.47",
66
+ "rimraf": "^6.0.1",
67
+ "rollup": "^4.22.4",
68
+ "rollup-plugin-dts": "^6.1.1",
69
69
  "rollup-plugin-postcss": "^4.0.2",
70
- "typescript": "^5.4.5"
70
+ "typescript": "^5.6.2"
71
71
  },
72
72
  "engines": {
73
73
  "node": ">=12"