react-globe.gl 2.25.0 → 2.27.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 CHANGED
@@ -238,8 +238,8 @@ ReactDOM.render(
238
238
  | <b>heatmapBandwidth</b> | <i>number</i>, <i>string</i> or <i>func</i> | 4 | Heatmap object accessor function, attribute or a numeric constant for the heatmap bandwidth, in angular degrees. The bandwidth is an internal parameter of the [Gaussian kernel function](https://en.wikipedia.org/wiki/Gaussian_function) and defines how localized is the influence of a point on distant locations. A narrow bandwidth leads to a more spiky representation, while a broad one has smoother curves. |
239
239
  | <b>heatmapColorFn</b> | <i>string</i> or <i>func</i> | [Turbo colormap](https://blog.research.google/2019/08/turbo-improved-rainbow-colormap-for.html) interpolator with fading opacity | Heatmap object accessor function or attribute for the color interpolator function to represent density in the heatmap. This function should receive a number between `0` and `1` (or potentially higher if saturation > 1), and return a color string. |
240
240
  | <b>heatmapColorSaturation</b> | <i>number</i>, <i>string</i> or <i>func</i> | 1.5 | Heatmap object accessor function, attribute or a numeric constant for the color scale saturation. The saturation is a multiplier of the normalized density value (`[0,1]`) before passing it to the color interpolation function. It can be used to dampen outlier peaks in density and bring the data floor into view. |
241
- | <b>heatmapBaseAltitude</b> | <i>number</i>, <i>string</i> or <i>func</i> | 0.01 | Heatmap polygon object accessor function, attribute or a numeric constant for the heatmap base floor altitude in terms of globe radius units (`0` = 0 altitude, `1` = globe radius). |
242
- | <b>heatmapTopAltitude</b> | <i>number</i>, <i>string</i> or <i>func</i> | - | Heatmap polygon object accessor function, attribute or a numeric constant for the heatmap top peak altitude in terms of globe radius units (`0` = 0 altitude, `1` = globe radius). An equal value to the base altitude will yield a surface flat heatmap. If a top altitude is set, the variations in density will be used to define the altitude curves between base and top. |
241
+ | <b>heatmapBaseAltitude</b> | <i>number</i>, <i>string</i> or <i>func</i> | 0.01 | Heatmap object accessor function, attribute or a numeric constant for the heatmap base floor altitude in terms of globe radius units (`0` = 0 altitude, `1` = globe radius). |
242
+ | <b>heatmapTopAltitude</b> | <i>number</i>, <i>string</i> or <i>func</i> | - | Heatmap object accessor function, attribute or a numeric constant for the heatmap top peak altitude in terms of globe radius units (`0` = 0 altitude, `1` = globe radius). An equal value to the base altitude will yield a surface flat heatmap. If a top altitude is set, the variations in density will be used to define the altitude curves between base and top. |
243
243
  | <b>heatmapsTransitionDuration</b> | <i>number</i> | 0 | Duration (ms) of the transition to animate heatmap changes. A value of `0` will set the heatmap colors/altitudes immediately in their final position. New heatmaps are animated by rising them from the ground up and gently fading in through the color scale. |
244
244
  | <b>onHeatmapClick</b> | <i>func</i> | - | Callback function for heatmap (left-button) clicks. The heatmap object, the event object and the clicked coordinates are included as arguments: `onHeatmapClick(heatmap, event, { lat, lng, altitude })`. |
245
245
  | <b>onHeatmapRightClick</b> | <i>func</i> | - | Callback function for heatmap right-clicks. The heatmap object, the event object and the clicked coordinates are included as arguments: `onHeatmapRightClick(heatmap, event, { lat, lng, altitude })`. |
@@ -285,7 +285,9 @@ ReactDOM.render(
285
285
  | <b>hexPolygonAltitude</b> | <i>number</i>, <i>string</i> or <i>func</i> | 0.001 | Hexed polygon object accessor function, attribute or a numeric constant for the polygon's hexagons altitude in terms of globe radius units (`0` = 0 altitude, `1` = globe radius). |
286
286
  | <b>hexPolygonResolution</b> | <i>number</i>, <i>string</i> or <i>func</i> | 3 | Hexed polygon object accessor function, attribute or a numeric constant for the geographic binning resolution as defined by [H3](https://uber.github.io/h3/#/documentation/core-library/resolution-table). Determines the area of the hexagons that tesselate the globe's surface. Accepts values between `0` and `15`. Level 0 partitions the earth in 122 (mostly) hexagonal cells. Each subsequent level sub-divides the previous in roughly 7 hexagons. |
287
287
  | <b>hexPolygonMargin</b> | <i>number</i>, <i>string</i> or <i>func</i> | 0.2 | Hexed polygon object accessor function, attribute or a numeric constant for the radial margin of each hexagon. Margins above `0` will create gaps between adjacent hexagons within a polygon. The margin is specified in terms of fraction of the hexagon's surface diameter. Values below `0` or above `1` are disadvised. |
288
+ | <b>hexPolygonUseDots</b> | <i>bool</i>, <i>string</i> or <i>func</i> | `false` | Hexed polygon object accessor function, attribute or a boolean constant for whether to represent each polygon point as a circular dot instead of an hexagon. |
288
289
  | <b>hexPolygonCurvatureResolution</b> | <i>number</i>, <i>string</i> or <i>func</i> | 5 | Hexed polygon object accessor function, attribute or a numeric constant for the resolution (in angular degrees) of each hexed polygon surface curvature. The finer the resolution, the more the polygon hexes are fragmented into smaller faces to approximate the spheric surface, at the cost of performance. |
290
+ | <b>hexPolygonDotResolution</b> | <i>number</i>, <i>string</i> or <i>func</i> | 12 | Hexed polygon object accessor function, attribute or a numeric constant for the resolution of each circular dot, expressed in how many slice segments to divide the circumference. Higher values yield smoother circles, at the cost of performance. This is only applicable in dot representation mode. |
289
291
  | <b>hexPolygonsTransitionDuration</b> | <i>number</i> | 0 | Duration (ms) of the transition to animate hexed polygons altitude and margin changes. A value of `0` will move the hexagons immediately to their final state. New hexed polygons are animated by sizing each hexagon from `0` radius. |
290
292
  | <b>onHexPolygonClick</b> | <i>func</i> | *-* | Callback function for hexed polygon (left-button) clicks. The polygon object, the event object and the clicked coordinates are included as arguments: `onHexPolygonClick(polygon, event, { lat, lng, altitude })`. |
291
293
  | <b>onHexPolygonRightClick</b> | <i>func</i> | *-* | Callback function for hexed polygon right-clicks. The polygon object, the event object and the clicked coordinates are included as arguments: `onHexPolygonRightClick(polygon, event, { lat, lng, altitude })`. |
@@ -424,7 +426,8 @@ ReactDOM.render(
424
426
  | <b>pointOfView</b> | { <i>lat</i>, <i>lng</i>, <i>altitude</i> } [,<i>ms</i>=`0`] | By default the camera will aim at the cross between the equator and the prime meridian (`0,0` coordinates), at an altitude of `2.5` globe radii. | Camera position, in terms of geographical `lat`, `lng`, `altitude` coordinates. Each of the coordinates is optional, allowing for motion in just some direction. The 2nd optional argument defines the duration of the transition (in ms) to animate the camera motion. A value of 0 (default) moves the camera immediately to the final position. |
425
427
  | <b>pauseAnimation</b>| *-* |Pauses the rendering cycle of the component, effectively freezing the current view and cancelling all user interaction. This method can be used to save performance in circumstances when a static image is sufficient. |
426
428
  | <b>resumeAnimation</b>| *-* |Resumes the rendering cycle of the component, and re-enables the user interaction. This method can be used together with `pauseAnimation` for performance optimization purposes. |
427
- | <b>onZoom</b> | <i>func</i> | *-* | Callback function for point-of-view changes by zooming or rotating the globe using the orbit controls. The current point of view (with the syntax `{ lat, lng, altitude }`) is included as sole argument. |
429
+ | <b>onZoom</b> | <i>func</i> | Callback function for point-of-view changes by zooming or rotating the globe using the orbit controls. The current point of view (with the syntax `{ lat, lng, altitude }`) is included as sole argument. |
430
+ | <b>lights</b> | <i>array</i> | Getter/setter for the list of lights to use in the scene. Each item should be an instance of [Light](https://threejs.org/docs/#api/en/lights/Light). |
428
431
  | <b>scene</b>| *-* |Access the internal ThreeJS [Scene](https://threejs.org/docs/#api/scenes/Scene). Can be used to extend the current scene with additional objects not related to globe.gl. |
429
432
  | <b>camera</b>| *-* |Access the internal ThreeJS [Camera](https://threejs.org/docs/#api/cameras/PerspectiveCamera). |
430
433
  | <b>renderer</b>| *-* |Access the internal ThreeJS [WebGL renderer](https://threejs.org/docs/#api/renderers/WebGLRenderer). |
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { Material, Object3D, Scene, Camera, WebGLRenderer } from 'three';
2
+ import { Material, Object3D, Light, Scene, Camera, WebGLRenderer } from 'three';
3
3
  import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
4
4
  import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
5
5
  import { ConfigOptions, GlobeInstance } from 'globe.gl';
@@ -173,7 +173,9 @@ interface GlobeProps extends ConfigOptions {
173
173
  hexPolygonAltitude?: ObjAccessor<number>;
174
174
  hexPolygonResolution?: ObjAccessor<number>;
175
175
  hexPolygonMargin?: ObjAccessor<number>;
176
+ hexPolygonUseDots?: ObjAccessor<boolean>;
176
177
  hexPolygonCurvatureResolution?: ObjAccessor<number>;
178
+ hexPolygonDotResolution?: ObjAccessor<number>;
177
179
  hexPolygonsTransitionDuration?: number;
178
180
  hexPolygonLabel?: ObjAccessor<string>;
179
181
  onHexPolygonClick?: (polygon: object, event: MouseEvent, coords: { lat: number, lng: number, altitude: number }) => void;
@@ -270,6 +272,8 @@ interface GlobeMethods {
270
272
  pointOfView(pov: { lat?: number, lng?: number, altitude?: number }, transitionMs?: number): GlobeInstance;
271
273
  pauseAnimation(): GlobeInstance;
272
274
  resumeAnimation(): GlobeInstance;
275
+ lights(): Light[];
276
+ lights(lights: Light[]): ChainableInstance;
273
277
  scene(): Scene;
274
278
  camera(): Camera;
275
279
  renderer(): WebGLRenderer;
@@ -1,4 +1,4 @@
1
- // Version 2.25.0 react-globe.gl - https://github.com/vasturiano/react-globe.gl
1
+ // Version 2.27.0 react-globe.gl - https://github.com/vasturiano/react-globe.gl
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :
4
4
  typeof define === 'function' && define.amd ? define(['react'], factory) :
@@ -67506,7 +67506,7 @@
67506
67506
  var bwRad = bandwidth * Math.PI / 180;
67507
67507
  return sum$1(data.map(function (d) {
67508
67508
  var weight = weightAccessor(d);
67509
- if (weight <= 0) return;
67509
+ if (!weight) return 0;
67510
67510
  var dist = geoDistance(pnt, [lngAccessor(d), latAccessor(d)]);
67511
67511
  return gaussianKernel(dist, bwRad) * weight;
67512
67512
  }));
@@ -67720,7 +67720,7 @@
67720
67720
  kdeVals = _obj$__currentTargetD.kdeVals,
67721
67721
  topAlt = _obj$__currentTargetD.topAlt,
67722
67722
  saturation = _obj$__currentTargetD.saturation;
67723
- var maxVal = max$1(kdeVals) || 1e-15;
67723
+ var maxVal = max$1(kdeVals.map(Math.abs)) || 1e-15;
67724
67724
 
67725
67725
  // Set vertex colors
67726
67726
  obj.geometry.setAttribute('color', array2BufferAttr(
@@ -67735,7 +67735,7 @@
67735
67735
  var _vertexGeoCoords$idx = _slicedToArray$1(vertexGeoCoords[idx], 2),
67736
67736
  lng = _vertexGeoCoords$idx[0],
67737
67737
  lat = _vertexGeoCoords$idx[1];
67738
- var alt = altScale(val);
67738
+ var alt = altScale(Math.abs(val));
67739
67739
  var p = polar2Cartesian(lat, lng, alt);
67740
67740
  return [p.x, p.y, p.z];
67741
67741
  }), 3));
@@ -67992,9 +67992,11 @@
67992
67992
  var THREE$9 = window.THREE ? window.THREE // Prefer consumption from global THREE, if exists
67993
67993
  : {
67994
67994
  BufferGeometry: BufferGeometry,
67995
+ CircleGeometry: CircleGeometry,
67995
67996
  DoubleSide: DoubleSide,
67996
67997
  Mesh: Mesh,
67997
- MeshLambertMaterial: MeshLambertMaterial
67998
+ MeshLambertMaterial: MeshLambertMaterial,
67999
+ Vector3: Vector3
67998
68000
  };
67999
68001
  var bfg = Object.assign({}, _bfg);
68000
68002
  var BufferGeometryUtils = bfg.BufferGeometryUtils || bfg;
@@ -68026,10 +68028,18 @@
68026
68028
  "default": 0.2
68027
68029
  },
68028
68030
  // in fraction of hex diameter
68031
+ hexPolygonUseDots: {
68032
+ "default": false
68033
+ },
68034
+ // if points should be circular instead of hexagonal
68029
68035
  hexPolygonCurvatureResolution: {
68030
68036
  "default": 5
68031
68037
  },
68032
- // in angular degrees
68038
+ // in angular degrees, only relevant for hex tops
68039
+ hexPolygonDotResolution: {
68040
+ "default": 12
68041
+ },
68042
+ // how many slice segments in the dot circle's circumference
68033
68043
  hexPolygonsTransitionDuration: {
68034
68044
  "default": 0,
68035
68045
  triggerUpdate: false
@@ -68049,7 +68059,9 @@
68049
68059
  var altitudeAccessor = index$1(state.hexPolygonAltitude);
68050
68060
  var resolutionAccessor = index$1(state.hexPolygonResolution);
68051
68061
  var marginAccessor = index$1(state.hexPolygonMargin);
68062
+ var useDotsAccessor = index$1(state.hexPolygonUseDots);
68052
68063
  var curvatureResolutionAccessor = index$1(state.hexPolygonCurvatureResolution);
68064
+ var dotResolutionAccessor = index$1(state.hexPolygonDotResolution);
68053
68065
  threeDigest(state.hexPolygonsData, state.scene, {
68054
68066
  createObj: function createObj(d) {
68055
68067
  var obj = new THREE$9.Mesh(undefined, new THREE$9.MeshLambertMaterial({
@@ -68064,7 +68076,9 @@
68064
68076
  var h3Res = resolutionAccessor(d);
68065
68077
  var alt = altitudeAccessor(d);
68066
68078
  var margin = Math.max(0, Math.min(1, +marginAccessor(d)));
68079
+ var useDots = useDotsAccessor(d);
68067
68080
  var curvatureResolution = curvatureResolutionAccessor(d);
68081
+ var dotResolution = dotResolutionAccessor(d);
68068
68082
 
68069
68083
  // update material
68070
68084
  var color = colorAccessor(d);
@@ -68131,25 +68145,37 @@
68131
68145
  curvatureResolution = _obj$__currentTargetD.curvatureResolution;
68132
68146
  obj.geometry && obj.geometry.dispose();
68133
68147
  obj.geometry = !hexBins.length ? new THREE$9.BufferGeometry() : (BufferGeometryUtils.mergeGeometries || BufferGeometryUtils.mergeBufferGeometries)(hexBins.map(function (h) {
68134
- // compute new geojson with relative margin
68135
- var relNum = function relNum(st, end, rat) {
68136
- return st - (st - end) * rat;
68137
- };
68138
68148
  var _h$hexCenter = _slicedToArray$1(h.hexCenter, 2),
68139
68149
  clat = _h$hexCenter[0],
68140
68150
  clng = _h$hexCenter[1];
68141
- var geoJson = margin === 0 ? h.hexGeoJson : h.hexGeoJson.map(function (_ref) {
68142
- var _ref2 = _slicedToArray$1(_ref, 2),
68143
- elng = _ref2[0],
68144
- elat = _ref2[1];
68145
- return [[elng, clng], [elat, clat]].map(function (_ref3) {
68146
- var _ref4 = _slicedToArray$1(_ref3, 2),
68147
- st = _ref4[0],
68148
- end = _ref4[1];
68149
- return relNum(st, end, margin);
68151
+ if (useDots) {
68152
+ var centerPos = polar2Cartesian(clat, clng, alt);
68153
+ var edgePos = polar2Cartesian(h.hexGeoJson[0][1], h.hexGeoJson[0][0], alt);
68154
+ var r = 0.85 * (1 - margin) * new THREE$9.Vector3(centerPos.x, centerPos.y, centerPos.z).distanceTo(new THREE$9.Vector3(edgePos.x, edgePos.y, edgePos.z));
68155
+ var geometry = new CircleGeometry(r, dotResolution);
68156
+ geometry.rotateX(deg2Rad$1(-clat));
68157
+ geometry.rotateY(deg2Rad$1(clng));
68158
+ geometry.translate(centerPos.x, centerPos.y, centerPos.z);
68159
+ return geometry;
68160
+ } else {
68161
+ var relNum = function relNum(st, end, rat) {
68162
+ return st - (st - end) * rat;
68163
+ };
68164
+
68165
+ // compute new geojson with relative margin
68166
+ var _geoJson = margin === 0 ? h.hexGeoJson : h.hexGeoJson.map(function (_ref) {
68167
+ var _ref2 = _slicedToArray$1(_ref, 2),
68168
+ elng = _ref2[0],
68169
+ elat = _ref2[1];
68170
+ return [[elng, clng], [elat, clat]].map(function (_ref3) {
68171
+ var _ref4 = _slicedToArray$1(_ref3, 2),
68172
+ st = _ref4[0],
68173
+ end = _ref4[1];
68174
+ return relNum(st, end, margin);
68175
+ });
68150
68176
  });
68151
- });
68152
- return new ConicPolygonBufferGeometry([geoJson], GLOBE_RADIUS, GLOBE_RADIUS * (1 + alt), false, true, false, curvatureResolution);
68177
+ return new ConicPolygonBufferGeometry([_geoJson], GLOBE_RADIUS, GLOBE_RADIUS * (1 + alt), false, true, false, curvatureResolution);
68178
+ }
68153
68179
  }));
68154
68180
  };
68155
68181
  if (!state.hexPolygonsTransitionDuration || state.hexPolygonsTransitionDuration < 0) {
@@ -69418,7 +69444,7 @@
69418
69444
  return _defineProperty$2({}, p, bindHeatmapsLayer.linkProp(p));
69419
69445
  })));
69420
69446
  var bindHexedPolygonsLayer = linkKapsule$1('hexedPolygonsLayer', HexedPolygonsLayerKapsule);
69421
- var linkedHexedPolygonsLayerProps = Object.assign.apply(Object, _toConsumableArray$2(['hexPolygonsData', 'hexPolygonGeoJsonGeometry', 'hexPolygonColor', 'hexPolygonAltitude', 'hexPolygonResolution', 'hexPolygonMargin', 'hexPolygonCurvatureResolution', 'hexPolygonsTransitionDuration'].map(function (p) {
69447
+ var linkedHexedPolygonsLayerProps = Object.assign.apply(Object, _toConsumableArray$2(['hexPolygonsData', 'hexPolygonGeoJsonGeometry', 'hexPolygonColor', 'hexPolygonAltitude', 'hexPolygonResolution', 'hexPolygonMargin', 'hexPolygonUseDots', 'hexPolygonCurvatureResolution', 'hexPolygonDotResolution', 'hexPolygonsTransitionDuration'].map(function (p) {
69422
69448
  return _defineProperty$2({}, p, bindHexedPolygonsLayer.linkProp(p));
69423
69449
  })));
69424
69450
  var bindPolygonsLayer = linkKapsule$1('polygonsLayer', PolygonsLayerKapsule);
@@ -72800,7 +72826,11 @@
72800
72826
  }
72801
72827
 
72802
72828
  function _isNativeFunction(fn) {
72803
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
72829
+ try {
72830
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
72831
+ } catch (e) {
72832
+ return typeof fn === "function";
72833
+ }
72804
72834
  }
72805
72835
 
72806
72836
  function _isNativeReflectConstruct() {
@@ -73536,31 +73566,31 @@
73536
73566
  var css_248z$1 = ".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n user-select: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}";
73537
73567
  styleInject$1(css_248z$1);
73538
73568
 
73539
- function _iterableToArrayLimit(arr, i) {
73540
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
73541
- if (null != _i) {
73542
- var _s,
73543
- _e,
73544
- _x,
73545
- _r,
73546
- _arr = [],
73547
- _n = !0,
73548
- _d = !1;
73569
+ function _iterableToArrayLimit(r, l) {
73570
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
73571
+ if (null != t) {
73572
+ var e,
73573
+ n,
73574
+ i,
73575
+ u,
73576
+ a = [],
73577
+ f = !0,
73578
+ o = !1;
73549
73579
  try {
73550
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
73551
- if (Object(_i) !== _i) return;
73552
- _n = !1;
73553
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
73554
- } catch (err) {
73555
- _d = !0, _e = err;
73580
+ if (i = (t = t.call(r)).next, 0 === l) {
73581
+ if (Object(t) !== t) return;
73582
+ f = !1;
73583
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
73584
+ } catch (r) {
73585
+ o = !0, n = r;
73556
73586
  } finally {
73557
73587
  try {
73558
- if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
73588
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
73559
73589
  } finally {
73560
- if (_d) throw _e;
73590
+ if (o) throw n;
73561
73591
  }
73562
73592
  }
73563
- return _arr;
73593
+ return a;
73564
73594
  }
73565
73595
  }
73566
73596
  function _defineProperty$1(obj, key, value) {
@@ -73676,6 +73706,9 @@
73676
73706
  objects: {
73677
73707
  "default": []
73678
73708
  },
73709
+ lights: {
73710
+ "default": []
73711
+ },
73679
73712
  enablePointerInteraction: {
73680
73713
  "default": true,
73681
73714
  onChange: function onChange(_, state) {
@@ -74136,6 +74169,15 @@
74136
74169
  }
74137
74170
  }
74138
74171
  changedProps.hasOwnProperty('showNavInfo') && (state.navInfo.style.display = state.showNavInfo ? null : 'none');
74172
+ if (changedProps.hasOwnProperty('lights')) {
74173
+ (changedProps.lights || []).forEach(function (light) {
74174
+ return state.scene.remove(light);
74175
+ }); // Clear the place
74176
+ state.lights.forEach(function (light) {
74177
+ return state.scene.add(light);
74178
+ }); // Add to scene
74179
+ }
74180
+
74139
74181
  if (changedProps.hasOwnProperty('objects')) {
74140
74182
  (changedProps.objects || []).forEach(function (obj) {
74141
74183
  return state.scene.remove(obj);
@@ -74326,7 +74368,7 @@
74326
74368
 
74327
74369
  // Expose config from ThreeGlobe
74328
74370
  var bindGlobe = linkKapsule('globe', threeGlobe);
74329
- 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) {
74371
+ 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', 'hexPolygonUseDots', 'hexPolygonCurvatureResolution', 'hexPolygonDotResolution', '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) {
74330
74372
  return _defineProperty({}, p, bindGlobe.linkProp(p));
74331
74373
  })));
74332
74374
  var linkedGlobeMethods = Object.assign.apply(Object, _toConsumableArray(['globeMaterial', 'getGlobeRadius', 'getCoords', 'toGeoCoords'].map(function (p) {
@@ -74338,7 +74380,7 @@
74338
74380
  var linkedRenderObjsProps = Object.assign.apply(Object, _toConsumableArray(['width', 'height', 'backgroundColor', 'backgroundImageUrl', 'enablePointerInteraction'].map(function (p) {
74339
74381
  return _defineProperty({}, p, bindRenderObjs.linkProp(p));
74340
74382
  })));
74341
- var linkedRenderObjsMethods = Object.assign.apply(Object, _toConsumableArray(['postProcessingComposer'].map(function (p) {
74383
+ var linkedRenderObjsMethods = Object.assign.apply(Object, _toConsumableArray(['lights', 'postProcessingComposer'].map(function (p) {
74342
74384
  return _defineProperty({}, p, bindRenderObjs.linkMethod(p));
74343
74385
  })));
74344
74386
 
@@ -74642,7 +74684,8 @@
74642
74684
  rendererConfig: rendererConfig,
74643
74685
  waitForLoadComplete: waitForGlobeReady,
74644
74686
  extraRenderers: [new THREE.CSS2DRenderer()] // Used in HTML elements layer
74645
- }).skyRadius(globe.getGlobeRadius() * 500).showNavInfo(false)
74687
+ }).skyRadius(globe.getGlobeRadius() * 500).showNavInfo(false).objects([globe]) // Populate scene
74688
+ .lights([new THREE.AmbientLight(0xcccccc, Math.PI), new THREE.DirectionalLight(0xffffff, 0.6 * Math.PI)])
74646
74689
  };
74647
74690
  },
74648
74691
  init: function init(domNode, state) {
@@ -74733,9 +74776,7 @@
74733
74776
  }
74734
74777
  };
74735
74778
  state.renderObjs.renderer().useLegacyLights = false; // force behavior of three < 155
74736
- state.renderObjs.objects([
74737
- // Populate scene
74738
- new THREE.AmbientLight(0xcccccc, Math.PI), new THREE.DirectionalLight(0xffffff, 0.6 * Math.PI), state.globe]).hoverOrderComparator(function (a, b) {
74779
+ state.renderObjs.hoverOrderComparator(function (a, b) {
74739
74780
  var aObj = getGlobeObj(a);
74740
74781
  var bObj = getGlobeObj(b);
74741
74782
 
@@ -76035,7 +76076,9 @@
76035
76076
  hexPolygonAltitude: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.func]),
76036
76077
  hexPolygonResolution: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.func]),
76037
76078
  hexPolygonMargin: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.func]),
76079
+ hexPolygonUseDots: PropTypes.oneOfType([PropTypes.bool, PropTypes.string, PropTypes.func]),
76038
76080
  hexPolygonCurvatureResolution: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.func]),
76081
+ hexPolygonDotResolution: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.func]),
76039
76082
  hexPolygonsTransitionDuration: PropTypes.number,
76040
76083
  hexPolygonLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
76041
76084
  onHexPolygonClick: PropTypes.func,
@@ -76119,7 +76162,7 @@
76119
76162
  var Globe = index$3(globe, {
76120
76163
  methodNames: [
76121
76164
  // bind methods
76122
- 'pauseAnimation', 'resumeAnimation', 'pointOfView', 'scene', 'camera', 'renderer', 'postProcessingComposer', 'controls', 'getGlobeRadius', 'getCoords', 'getScreenCoords', 'toGeoCoords', 'toGlobeCoords'],
76165
+ 'pauseAnimation', 'resumeAnimation', 'pointOfView', 'lights', 'scene', 'camera', 'renderer', 'postProcessingComposer', 'controls', 'getGlobeRadius', 'getCoords', 'getScreenCoords', 'toGeoCoords', 'toGlobeCoords'],
76123
76166
  initPropNames: ['animateIn', 'waitForGlobeReady', 'rendererConfig']
76124
76167
  });
76125
76168
  Globe.displayName = 'Globe';