globe.gl 2.32.0 → 2.32.2

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
@@ -55,6 +55,20 @@ function _objectSpread2(e) {
55
55
  }
56
56
  return e;
57
57
  }
58
+ function _toPrimitive(t, r) {
59
+ if ("object" != typeof t || !t) return t;
60
+ var e = t[Symbol.toPrimitive];
61
+ if (void 0 !== e) {
62
+ var i = e.call(t, r || "default");
63
+ if ("object" != typeof i) return i;
64
+ throw new TypeError("@@toPrimitive must return a primitive value.");
65
+ }
66
+ return ("string" === r ? String : Number)(t);
67
+ }
68
+ function _toPropertyKey(t) {
69
+ var i = _toPrimitive(t, "string");
70
+ return "symbol" == typeof i ? i : String(i);
71
+ }
58
72
  function _defineProperty(obj, key, value) {
59
73
  key = _toPropertyKey(key);
60
74
  if (key in obj) {
@@ -121,20 +135,6 @@ function _arrayLikeToArray(arr, len) {
121
135
  function _nonIterableSpread() {
122
136
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
123
137
  }
124
- function _toPrimitive(input, hint) {
125
- if (typeof input !== "object" || input === null) return input;
126
- var prim = input[Symbol.toPrimitive];
127
- if (prim !== undefined) {
128
- var res = prim.call(input, hint || "default");
129
- if (typeof res !== "object") return res;
130
- throw new TypeError("@@toPrimitive must return a primitive value.");
131
- }
132
- return (hint === "string" ? String : Number)(input);
133
- }
134
- function _toPropertyKey(arg) {
135
- var key = _toPrimitive(arg, "string");
136
- return typeof key === "symbol" ? key : String(key);
137
- }
138
138
 
139
139
  function linkKapsule (kapsulePropName, kapsuleType) {
140
140
  var dummyK = new kapsuleType(); // To extract defaults
@@ -1,8 +1,6 @@
1
1
  <head>
2
2
  <style> body { margin: 0; } </style>
3
3
 
4
- <script src="//unpkg.com/three"></script>
5
-
6
4
  <script src="//unpkg.com/globe.gl"></script>
7
5
  <!--<script src="../../dist/globe.gl.js"></script>-->
8
6
  </head>
@@ -10,7 +8,9 @@
10
8
  <body>
11
9
  <div id="globeViz"></div>
12
10
 
13
- <script>
11
+ <script type="module">
12
+ import * as THREE from '//unpkg.com/three/build/three.module.js';
13
+
14
14
  const world = Globe({ animateIn: false })
15
15
  (document.getElementById('globeViz'))
16
16
  .globeImageUrl('//unpkg.com/three-globe/example/img/earth-blue-marble.jpg')
@@ -1,8 +1,6 @@
1
1
  <head>
2
2
  <style> body { margin: 0; } </style>
3
3
 
4
- <script src="//unpkg.com/three"></script>
5
-
6
4
  <script src="//unpkg.com/globe.gl"></script>
7
5
  <!-- <script src="../../dist/globe.gl.js"></script>-->
8
6
  </head>
@@ -10,7 +8,8 @@
10
8
  <body>
11
9
  <div id="globeViz"></div>
12
10
 
13
- <script>
11
+ <script type="module">
12
+ import * as THREE from '//unpkg.com/three/build/three.module.js';
14
13
 
15
14
  const world = Globe()
16
15
  .globeImageUrl('//unpkg.com/three-globe/example/img/earth-blue-marble.jpg')
@@ -27,9 +26,7 @@
27
26
  globeMaterial.shininess = 15;
28
27
  });
29
28
 
30
- setTimeout(() => { // wait for scene to be populated (asynchronously)
31
- const directionalLight = world.scene().children.find(obj3d => obj3d.type === 'DirectionalLight');
32
- directionalLight && directionalLight.position.set(1, 1, 1); // change light position to see the specularMap's effect
33
- });
29
+ const directionalLight = world.lights().find(light => light.type === 'DirectionalLight');
30
+ directionalLight && directionalLight.position.set(1, 1, 1); // change light position to see the specularMap's effect
34
31
  </script>
35
32
  </body>
@@ -1,8 +1,6 @@
1
1
  <head>
2
2
  <style> body { margin: 0; } </style>
3
3
 
4
- <script src="//unpkg.com/three"></script>
5
-
6
4
  <script src="//unpkg.com/globe.gl"></script>
7
5
  <!--<script src="../../dist/globe.gl.js"></script>-->
8
6
  </head>
@@ -10,7 +8,9 @@
10
8
  <body>
11
9
  <div id="globeViz"></div>
12
10
 
13
- <script>
11
+ <script type="module">
12
+ import * as THREE from '//unpkg.com/three/build/three.module.js';
13
+
14
14
  // Gen random data
15
15
  const N = 300;
16
16
  const gData = [...Array(N).keys()].map(() => ({
@@ -1,7 +1,6 @@
1
1
  <head>
2
2
  <style> body { margin: 0; } </style>
3
3
 
4
- <script src="//unpkg.com/three"></script>
5
4
  <script src="//unpkg.com/topojson-client"></script>
6
5
 
7
6
  <script src="//unpkg.com/globe.gl"></script>
@@ -11,7 +10,9 @@
11
10
  <body>
12
11
  <div id="globeViz"></div>
13
12
 
14
- <script>
13
+ <script type="module">
14
+ import * as THREE from '//unpkg.com/three/build/three.module.js';
15
+
15
16
  const world = Globe()
16
17
  (document.getElementById('globeViz'))
17
18
  .backgroundColor('rgba(0,0,0,0)')
@@ -15,7 +15,6 @@
15
15
  }
16
16
  </style>
17
17
 
18
- <script src="//unpkg.com/three"></script>
19
18
  <script src="//unpkg.com/satellite.js/dist/satellite.min.js"></script>
20
19
 
21
20
  <script src="//unpkg.com/globe.gl"></script>
@@ -26,7 +25,9 @@
26
25
  <div id="chart"></div>
27
26
  <div id="time-log"></div>
28
27
 
29
- <script>
28
+ <script type="module">
29
+ import * as THREE from '//unpkg.com/three/build/three.module.js';
30
+
30
31
  const EARTH_RADIUS_KM = 6371; // km
31
32
  const SAT_SIZE = 100; // km
32
33
  const TIME_STEP = 3 * 1000; // per frame
@@ -13,9 +13,7 @@
13
13
  }
14
14
  </style>
15
15
 
16
- <script src="//unpkg.com/three"></script>
17
-
18
- <script src="//unpkg.com/globe.gl"></script>
16
+ <script src="//unpkg.com/globe.gl"></script>
19
17
  <!-- <script src="../../dist/globe.gl.js"></script>-->
20
18
 
21
19
  <script src="//unpkg.com/solar-calculator"></script>
@@ -25,7 +23,9 @@
25
23
  <div id="globeViz"></div>
26
24
  <div id="time"></div>
27
25
 
28
- <script>
26
+ <script type="module">
27
+ import * as THREE from '//unpkg.com/three/build/three.module.js';
28
+
29
29
  const VELOCITY = 9; // minutes per frame
30
30
 
31
31
  const sunPosAt = dt => {
@@ -1,8 +1,6 @@
1
1
  <head>
2
2
  <style> body { margin: 0; } </style>
3
3
 
4
- <script src="//unpkg.com/three"></script>
5
-
6
4
  <script src="//unpkg.com/globe.gl"></script>
7
5
  <!-- <script src="../../dist/globe.gl.js"></script>-->
8
6
  </head>
@@ -10,7 +8,9 @@
10
8
  <body>
11
9
  <div id="globeViz"></div>
12
10
 
13
- <script>
11
+ <script type="module">
12
+ import * as THREE from '//unpkg.com/three/build/three.module.js';
13
+
14
14
  const TILE_MARGIN = 0.35; // degrees
15
15
 
16
16
  // Gen random data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "globe.gl",
3
- "version": "2.32.0",
3
+ "version": "2.32.2",
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 - 21",
51
+ "@tweenjs/tween.js": "18 - 23",
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.23.2",
60
- "@babel/preset-env": "^7.23.2",
59
+ "@babel/core": "^7.23.9",
60
+ "@babel/preset-env": "^7.23.9",
61
61
  "@rollup/plugin-babel": "^6.0.4",
62
62
  "@rollup/plugin-commonjs": "^25.0.7",
63
63
  "@rollup/plugin-node-resolve": "^15.2.3",
64
64
  "@rollup/plugin-terser": "^0.4.4",
65
- "postcss": "^8.4.31",
65
+ "postcss": "^8.4.35",
66
66
  "rimraf": "^5.0.5",
67
- "rollup": "^4.1.4",
67
+ "rollup": "^4.9.6",
68
68
  "rollup-plugin-dts": "^6.1.0",
69
69
  "rollup-plugin-postcss": "^4.0.2",
70
- "typescript": "^5.2.2"
70
+ "typescript": "^5.3.3"
71
71
  },
72
72
  "engines": {
73
73
  "node": ">=12"