globe.gl 2.27.2 → 2.27.3

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.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version 2.27.2 globe.gl - https://github.com/vasturiano/globe.gl
1
+ // Version 2.27.3 globe.gl - https://github.com/vasturiano/globe.gl
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -37271,13 +37271,22 @@
37271
37271
  /**
37272
37272
  * The Ease class provides a collection of easing functions for use with tween.js.
37273
37273
  */
37274
- var Easing = {
37275
- Linear: {
37274
+ var Easing = Object.freeze({
37275
+ Linear: Object.freeze({
37276
37276
  None: function (amount) {
37277
37277
  return amount;
37278
37278
  },
37279
- },
37280
- Quadratic: {
37279
+ In: function (amount) {
37280
+ return this.None(amount);
37281
+ },
37282
+ Out: function (amount) {
37283
+ return this.None(amount);
37284
+ },
37285
+ InOut: function (amount) {
37286
+ return this.None(amount);
37287
+ },
37288
+ }),
37289
+ Quadratic: Object.freeze({
37281
37290
  In: function (amount) {
37282
37291
  return amount * amount;
37283
37292
  },
@@ -37290,8 +37299,8 @@
37290
37299
  }
37291
37300
  return -0.5 * (--amount * (amount - 2) - 1);
37292
37301
  },
37293
- },
37294
- Cubic: {
37302
+ }),
37303
+ Cubic: Object.freeze({
37295
37304
  In: function (amount) {
37296
37305
  return amount * amount * amount;
37297
37306
  },
@@ -37304,8 +37313,8 @@
37304
37313
  }
37305
37314
  return 0.5 * ((amount -= 2) * amount * amount + 2);
37306
37315
  },
37307
- },
37308
- Quartic: {
37316
+ }),
37317
+ Quartic: Object.freeze({
37309
37318
  In: function (amount) {
37310
37319
  return amount * amount * amount * amount;
37311
37320
  },
@@ -37318,8 +37327,8 @@
37318
37327
  }
37319
37328
  return -0.5 * ((amount -= 2) * amount * amount * amount - 2);
37320
37329
  },
37321
- },
37322
- Quintic: {
37330
+ }),
37331
+ Quintic: Object.freeze({
37323
37332
  In: function (amount) {
37324
37333
  return amount * amount * amount * amount * amount;
37325
37334
  },
@@ -37332,19 +37341,19 @@
37332
37341
  }
37333
37342
  return 0.5 * ((amount -= 2) * amount * amount * amount * amount + 2);
37334
37343
  },
37335
- },
37336
- Sinusoidal: {
37344
+ }),
37345
+ Sinusoidal: Object.freeze({
37337
37346
  In: function (amount) {
37338
- return 1 - Math.cos((amount * Math.PI) / 2);
37347
+ return 1 - Math.sin(((1.0 - amount) * Math.PI) / 2);
37339
37348
  },
37340
37349
  Out: function (amount) {
37341
37350
  return Math.sin((amount * Math.PI) / 2);
37342
37351
  },
37343
37352
  InOut: function (amount) {
37344
- return 0.5 * (1 - Math.cos(Math.PI * amount));
37353
+ return 0.5 * (1 - Math.sin(Math.PI * (0.5 - amount)));
37345
37354
  },
37346
- },
37347
- Exponential: {
37355
+ }),
37356
+ Exponential: Object.freeze({
37348
37357
  In: function (amount) {
37349
37358
  return amount === 0 ? 0 : Math.pow(1024, amount - 1);
37350
37359
  },
@@ -37363,8 +37372,8 @@
37363
37372
  }
37364
37373
  return 0.5 * (-Math.pow(2, -10 * (amount - 1)) + 2);
37365
37374
  },
37366
- },
37367
- Circular: {
37375
+ }),
37376
+ Circular: Object.freeze({
37368
37377
  In: function (amount) {
37369
37378
  return 1 - Math.sqrt(1 - amount * amount);
37370
37379
  },
@@ -37377,8 +37386,8 @@
37377
37386
  }
37378
37387
  return 0.5 * (Math.sqrt(1 - (amount -= 2) * amount) + 1);
37379
37388
  },
37380
- },
37381
- Elastic: {
37389
+ }),
37390
+ Elastic: Object.freeze({
37382
37391
  In: function (amount) {
37383
37392
  if (amount === 0) {
37384
37393
  return 0;
@@ -37410,15 +37419,15 @@
37410
37419
  }
37411
37420
  return 0.5 * Math.pow(2, -10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI) + 1;
37412
37421
  },
37413
- },
37414
- Back: {
37422
+ }),
37423
+ Back: Object.freeze({
37415
37424
  In: function (amount) {
37416
37425
  var s = 1.70158;
37417
- return amount * amount * ((s + 1) * amount - s);
37426
+ return amount === 1 ? 1 : amount * amount * ((s + 1) * amount - s);
37418
37427
  },
37419
37428
  Out: function (amount) {
37420
37429
  var s = 1.70158;
37421
- return --amount * amount * ((s + 1) * amount + s) + 1;
37430
+ return amount === 0 ? 0 : --amount * amount * ((s + 1) * amount + s) + 1;
37422
37431
  },
37423
37432
  InOut: function (amount) {
37424
37433
  var s = 1.70158 * 1.525;
@@ -37427,8 +37436,8 @@
37427
37436
  }
37428
37437
  return 0.5 * ((amount -= 2) * amount * ((s + 1) * amount + s) + 2);
37429
37438
  },
37430
- },
37431
- Bounce: {
37439
+ }),
37440
+ Bounce: Object.freeze({
37432
37441
  In: function (amount) {
37433
37442
  return 1 - Easing.Bounce.Out(1 - amount);
37434
37443
  },
@@ -37452,8 +37461,27 @@
37452
37461
  }
37453
37462
  return Easing.Bounce.Out(amount * 2 - 1) * 0.5 + 0.5;
37454
37463
  },
37464
+ }),
37465
+ generatePow: function (power) {
37466
+ if (power === void 0) { power = 4; }
37467
+ power = power < Number.EPSILON ? Number.EPSILON : power;
37468
+ power = power > 10000 ? 10000 : power;
37469
+ return {
37470
+ In: function (amount) {
37471
+ return Math.pow(amount, power);
37472
+ },
37473
+ Out: function (amount) {
37474
+ return 1 - Math.pow((1 - amount), power);
37475
+ },
37476
+ InOut: function (amount) {
37477
+ if (amount < 0.5) {
37478
+ return Math.pow((amount * 2), power) / 2;
37479
+ }
37480
+ return (1 - Math.pow((2 - amount * 2), power)) / 2 + 0.5;
37481
+ },
37482
+ };
37455
37483
  },
37456
- };
37484
+ });
37457
37485
 
37458
37486
  var now;
37459
37487
  // Include a performance.now polyfill.
@@ -37666,8 +37694,10 @@
37666
37694
  this._startTime = 0;
37667
37695
  this._easingFunction = Easing.Linear.None;
37668
37696
  this._interpolationFunction = Interpolation.Linear;
37697
+ // eslint-disable-next-line
37669
37698
  this._chainedTweens = [];
37670
37699
  this._onStartCallbackFired = false;
37700
+ this._onEveryStartCallbackFired = false;
37671
37701
  this._id = Sequence.nextId();
37672
37702
  this._isChainStopped = false;
37673
37703
  this._goToEnd = false;
@@ -37693,10 +37723,13 @@
37693
37723
  return this;
37694
37724
  };
37695
37725
  Tween.prototype.duration = function (d) {
37726
+ if (d === void 0) { d = 1000; }
37696
37727
  this._duration = d;
37697
37728
  return this;
37698
37729
  };
37699
- Tween.prototype.start = function (time) {
37730
+ Tween.prototype.start = function (time, overrideStartingValues) {
37731
+ if (time === void 0) { time = now$1(); }
37732
+ if (overrideStartingValues === void 0) { overrideStartingValues = false; }
37700
37733
  if (this._isPlaying) {
37701
37734
  return this;
37702
37735
  }
@@ -37715,13 +37748,17 @@
37715
37748
  this._isPlaying = true;
37716
37749
  this._isPaused = false;
37717
37750
  this._onStartCallbackFired = false;
37751
+ this._onEveryStartCallbackFired = false;
37718
37752
  this._isChainStopped = false;
37719
- this._startTime = time !== undefined ? (typeof time === 'string' ? now$1() + parseFloat(time) : time) : now$1();
37753
+ this._startTime = time;
37720
37754
  this._startTime += this._delayTime;
37721
- this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat);
37755
+ this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat, overrideStartingValues);
37722
37756
  return this;
37723
37757
  };
37724
- Tween.prototype._setupProperties = function (_object, _valuesStart, _valuesEnd, _valuesStartRepeat) {
37758
+ Tween.prototype.startFromCurrentValues = function (time) {
37759
+ return this.start(time, true);
37760
+ };
37761
+ Tween.prototype._setupProperties = function (_object, _valuesStart, _valuesEnd, _valuesStartRepeat, overrideStartingValues) {
37725
37762
  for (var property in _valuesEnd) {
37726
37763
  var startValue = _object[property];
37727
37764
  var startValueIsArray = Array.isArray(startValue);
@@ -37741,7 +37778,9 @@
37741
37778
  // handle an array of relative values
37742
37779
  endValues = endValues.map(this._handleRelativeValue.bind(this, startValue));
37743
37780
  // Create a local copy of the Array with the start value at the front
37744
- _valuesEnd[property] = [startValue].concat(endValues);
37781
+ if (_valuesStart[property] === undefined) {
37782
+ _valuesEnd[property] = [startValue].concat(endValues);
37783
+ }
37745
37784
  }
37746
37785
  // handle the deepness of the values
37747
37786
  if ((propType === 'object' || startValueIsArray) && startValue && !isInterpolationList) {
@@ -37755,11 +37794,11 @@
37755
37794
  _valuesStartRepeat[property] = startValueIsArray ? [] : {}; // TODO? repeat nested values? And yoyo? And array values?
37756
37795
  // eslint-disable-next-line
37757
37796
  // @ts-ignore FIXME?
37758
- this._setupProperties(startValue, _valuesStart[property], _valuesEnd[property], _valuesStartRepeat[property]);
37797
+ this._setupProperties(startValue, _valuesStart[property], _valuesEnd[property], _valuesStartRepeat[property], overrideStartingValues);
37759
37798
  }
37760
37799
  else {
37761
- // Save the starting value, but only once.
37762
- if (typeof _valuesStart[property] === 'undefined') {
37800
+ // Save the starting value, but only once unless override is requested.
37801
+ if (typeof _valuesStart[property] === 'undefined' || overrideStartingValues) {
37763
37802
  _valuesStart[property] = startValue;
37764
37803
  }
37765
37804
  if (!startValueIsArray) {
@@ -37830,14 +37869,17 @@
37830
37869
  return this;
37831
37870
  };
37832
37871
  Tween.prototype.group = function (group) {
37872
+ if (group === void 0) { group = mainGroup; }
37833
37873
  this._group = group;
37834
37874
  return this;
37835
37875
  };
37836
37876
  Tween.prototype.delay = function (amount) {
37877
+ if (amount === void 0) { amount = 0; }
37837
37878
  this._delayTime = amount;
37838
37879
  return this;
37839
37880
  };
37840
37881
  Tween.prototype.repeat = function (times) {
37882
+ if (times === void 0) { times = 0; }
37841
37883
  this._initialRepeat = times;
37842
37884
  this._repeat = times;
37843
37885
  return this;
@@ -37847,17 +37889,21 @@
37847
37889
  return this;
37848
37890
  };
37849
37891
  Tween.prototype.yoyo = function (yoyo) {
37892
+ if (yoyo === void 0) { yoyo = false; }
37850
37893
  this._yoyo = yoyo;
37851
37894
  return this;
37852
37895
  };
37853
37896
  Tween.prototype.easing = function (easingFunction) {
37897
+ if (easingFunction === void 0) { easingFunction = Easing.Linear.None; }
37854
37898
  this._easingFunction = easingFunction;
37855
37899
  return this;
37856
37900
  };
37857
37901
  Tween.prototype.interpolation = function (interpolationFunction) {
37902
+ if (interpolationFunction === void 0) { interpolationFunction = Interpolation.Linear; }
37858
37903
  this._interpolationFunction = interpolationFunction;
37859
37904
  return this;
37860
37905
  };
37906
+ // eslint-disable-next-line
37861
37907
  Tween.prototype.chain = function () {
37862
37908
  var tweens = [];
37863
37909
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -37870,6 +37916,10 @@
37870
37916
  this._onStartCallback = callback;
37871
37917
  return this;
37872
37918
  };
37919
+ Tween.prototype.onEveryStart = function (callback) {
37920
+ this._onEveryStartCallback = callback;
37921
+ return this;
37922
+ };
37873
37923
  Tween.prototype.onUpdate = function (callback) {
37874
37924
  this._onUpdateCallback = callback;
37875
37925
  return this;
@@ -37903,7 +37953,7 @@
37903
37953
  if (time > endTime)
37904
37954
  return false;
37905
37955
  if (autoStart)
37906
- this.start(time);
37956
+ this.start(time, true);
37907
37957
  }
37908
37958
  this._goToEnd = false;
37909
37959
  if (time < this._startTime) {
@@ -37915,6 +37965,12 @@
37915
37965
  }
37916
37966
  this._onStartCallbackFired = true;
37917
37967
  }
37968
+ if (this._onEveryStartCallbackFired === false) {
37969
+ if (this._onEveryStartCallback) {
37970
+ this._onEveryStartCallback(this._object);
37971
+ }
37972
+ this._onEveryStartCallbackFired = true;
37973
+ }
37918
37974
  elapsed = (time - this._startTime) / this._duration;
37919
37975
  elapsed = this._duration === 0 || elapsed > 1 ? 1 : elapsed;
37920
37976
  var value = this._easingFunction(elapsed);
@@ -37953,6 +38009,7 @@
37953
38009
  if (this._onRepeatCallback) {
37954
38010
  this._onRepeatCallback(this._object);
37955
38011
  }
38012
+ this._onEveryStartCallbackFired = false;
37956
38013
  return true;
37957
38014
  }
37958
38015
  else {
@@ -37962,7 +38019,7 @@
37962
38019
  for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {
37963
38020
  // Make the chained tweens start exactly at the time they should,
37964
38021
  // even if the `update()` method was called way past the duration of the tween
37965
- this._chainedTweens[i].start(this._startTime + this._duration);
38022
+ this._chainedTweens[i].start(this._startTime + this._duration, false);
37966
38023
  }
37967
38024
  this._isPlaying = false;
37968
38025
  return false;
@@ -38026,7 +38083,7 @@
38026
38083
  return Tween;
38027
38084
  }());
38028
38085
 
38029
- var VERSION = '18.6.4';
38086
+ var VERSION = '19.0.0';
38030
38087
 
38031
38088
  /**
38032
38089
  * Tween.js - Licensed under the MIT license
@@ -65203,7 +65260,7 @@
65203
65260
  });
65204
65261
  if (state.pointsMerge) {
65205
65262
  // merge points into a single mesh
65206
- var pointsGeometry = !state.pointsData.length ? new THREE$d.BufferGeometry() : BufferGeometryUtils$2.mergeBufferGeometries(state.pointsData.map(function (d) {
65263
+ var pointsGeometry = !state.pointsData.length ? new THREE$d.BufferGeometry() : (BufferGeometryUtils$2.mergeGeometries || BufferGeometryUtils$2.mergeBufferGeometries)(state.pointsData.map(function (d) {
65207
65264
  var obj = d.__threeObj;
65208
65265
  d.__threeObj = undefined; // unbind merged points
65209
65266
 
@@ -65775,7 +65832,7 @@
65775
65832
  });
65776
65833
  if (state.hexBinMerge) {
65777
65834
  // merge points into a single mesh
65778
- var hexPointsGeometry = !hexBins.length ? new THREE$b.BufferGeometry() : BufferGeometryUtils$1.mergeBufferGeometries(hexBins.map(function (d) {
65835
+ var hexPointsGeometry = !hexBins.length ? new THREE$b.BufferGeometry() : (BufferGeometryUtils$1.mergeGeometries || BufferGeometryUtils$1.mergeBufferGeometries)(hexBins.map(function (d) {
65779
65836
  var obj = d.__threeObj;
65780
65837
  d.__threeObj = undefined; // unbind merged points
65781
65838
 
@@ -66254,7 +66311,7 @@
66254
66311
  margin = _obj$__currentTargetD.margin,
66255
66312
  curvatureResolution = _obj$__currentTargetD.curvatureResolution;
66256
66313
  obj.geometry && obj.geometry.dispose();
66257
- obj.geometry = !hexBins.length ? new THREE$9.BufferGeometry() : BufferGeometryUtils.mergeBufferGeometries(hexBins.map(function (h) {
66314
+ obj.geometry = !hexBins.length ? new THREE$9.BufferGeometry() : (BufferGeometryUtils.mergeGeometries || BufferGeometryUtils.mergeBufferGeometries)(hexBins.map(function (h) {
66258
66315
  // compute new geojson with relative margin
66259
66316
  var relNum = function relNum(st, end, rat) {
66260
66317
  return st - (st - end) * rat;