react-globe.gl 2.33.2 → 2.35.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
@@ -47,6 +47,7 @@ A React component to represent data visualization layers on a 3-dimensional glob
47
47
  * [Tiled Map Engine](https://vasturiano.github.io/react-globe.gl/example/tile-engine/) ([source](https://github.com/vasturiano/react-globe.gl/blob/master/example/tile-engine/index.html))
48
48
  * [Custom Globe Styling](https://vasturiano.github.io/react-globe.gl/example/custom-globe-styling/) ([source](https://github.com/vasturiano/react-globe.gl/blob/master/example/custom-globe-styling/index.html))
49
49
  * [Custom Layer](https://vasturiano.github.io/react-globe.gl/example/custom-layer/) ([source](https://github.com/vasturiano/react-globe.gl/blob/master/example/custom-layer/index.html))
50
+ * [Glitch Post-Processing Effect](https://vasturiano.github.io/react-globe.gl/example/post-processing-fx/index.html) ([source](https://github.com/vasturiano/react-globe.gl/blob/master/example/post-processing-fx/index.html))
50
51
  * [World Population](https://vasturiano.github.io/react-globe.gl/example/world-population/) ([source](https://github.com/vasturiano/react-globe.gl/blob/master/example/world-population/index.html))
51
52
  * [Population Heatmap](https://vasturiano.github.io/react-globe.gl/example/population-heatmap/) ([source](https://github.com/vasturiano/react-globe.gl/blob/master/example/population-heatmap/index.html))
52
53
  * [Recent Earthquakes](https://vasturiano.github.io/react-globe.gl/example/earthquakes/) ([source](https://github.com/vasturiano/react-globe.gl/blob/master/example/earthquakes/index.html))
@@ -58,6 +59,11 @@ A React component to represent data visualization layers on a 3-dimensional glob
58
59
  * [Submarine Cables](https://vasturiano.github.io/react-globe.gl/example/submarine-cables/index.html) ([source](https://github.com/vasturiano/react-globe.gl/blob/master/example/submarine-cables/index.html))
59
60
  * [Moon Landing Sites](https://vasturiano.github.io/react-globe.gl/example/moon-landing-sites/index.html) ([source](https://github.com/vasturiano/react-globe.gl/blob/master/example/moon-landing-sites/index.html))
60
61
 
62
+ ## ❤️ Support This Project
63
+
64
+ If you find this module useful and would like to support its development, you can [buy me a ☕](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=L398E7PKP47E8&currency_code=USD&source=url). Your contributions help keep open-source sustainable!
65
+ [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=L398E7PKP47E8&currency_code=USD&source=url)
66
+
61
67
  ## Quick start
62
68
 
63
69
  ```js
@@ -67,7 +73,7 @@ import Globe from 'react-globe.gl';
67
73
  or using a *script* tag
68
74
 
69
75
  ```html
70
- <script src="//unpkg.com/react-globe.gl"></script>
76
+ <script src="//cdn.jsdelivr.net/npm/react-globe.gl"></script>
71
77
  ```
72
78
 
73
79
  then
@@ -126,6 +132,7 @@ ReactDOM.render(
126
132
  | <b>showAtmosphere</b> | <i>bool</i> | `true` | Whether to show a bright halo surrounding the globe, representing the atmosphere. |
127
133
  | <b>atmosphereColor</b> | <i>string</i> | `lightskyblue` | The color of the atmosphere. |
128
134
  | <b>atmosphereAltitude</b> | <i>string</i> | 0.15 | The max altitude of the atmosphere, in terms of globe radius units. |
135
+ | <b>globeCurvatureResolution</b> | <i>number</i> | 4 | Resolution in angular degrees of the sphere curvature. The finer the resolution, the more the globe is fragmented into smaller faces to approximate the spheric surface, at the cost of performance. |
129
136
  | <b>globeMaterial</b> | <i>Material</i> | [MeshPhongMaterial](https://threejs.org/docs/#api/en/materials/MeshPhongMaterial) | ThreeJS material used to wrap the globe. Can be used for more advanced styling of the globe, like in [this example](https://github.com/vasturiano/react-globe.gl/blob/master/example/custom-globe-styling/index.html). |
130
137
  | <b>onGlobeReady</b> | <i>func</i> | *-* | Callback function to invoke immediately after the globe has been initialized and visible on the scene. |
131
138
  | <b>onGlobeClick</b> | <i>func</i> | *-* | Callback function for (left-button) clicks on the globe. The clicked globe coordinates and the event object are included as arguments: `onGlobeClick({ lat, lng }, event)`. |
@@ -165,8 +172,10 @@ ReactDOM.render(
165
172
  | <b>arcLabel</b> | <i>string</i> or <i>func</i> | `name` | Arc object accessor function or attribute for label (shown as tooltip). Supports plain text or HTML content. |
166
173
  | <b>arcStartLat</b> | <i>number</i>, <i>string</i> or <i>func</i> | `startLat` | Arc object accessor function, attribute or a numeric constant for the line's start latitude coordinate. |
167
174
  | <b>arcStartLng</b> | <i>number</i>, <i>string</i> or <i>func</i> | `startLng` | Arc object accessor function, attribute or a numeric constant for the line's start longitude coordinate. |
175
+ | <b>arcStartAltitude</b> | <i>number</i>, <i>string</i> or <i>func</i> | 0 | Arc object accessor function, attribute or a numeric constant for the line's start altitude. |
168
176
  | <b>arcEndLat</b> | <i>number</i>, <i>string</i> or <i>func</i> | `endLat` | Arc object accessor function, attribute or a numeric constant for the line's end latitude coordinate. |
169
177
  | <b>arcEndLng</b> | <i>number</i>, <i>string</i> or <i>func</i> | `endLng` | Arc object accessor function, attribute or a numeric constant for the line's end longitude coordinate. |
178
+ | <b>arcEndAltitude</b> | <i>number</i>, <i>string</i> or <i>func</i> | 0 | Arc object accessor function, attribute or a numeric constant for the line's end altitude. |
170
179
  | <b>arcColor</b> | <i>string</i>, <i>[string, ...]</i> or <i>func</i> | `() => '#ffffaa'` | Arc object accessor function or attribute for the line's color. Also supports color gradients by passing an array of colors, or a color interpolator function. |
171
180
  | <b>arcAltitude</b> | <i>number</i>, <i>string</i> or <i>func</i>| `null` |Arc object accessor function, attribute or a numeric constant for the arc's maximum altitude (ocurring at the half-way distance between the two points) in terms of globe radius units (`0` = 0 altitude (ground line), `1` = globe radius). If a value of `null` or `undefined` is used, the altitude is automatically set proportionally to the distance between the two points, according to the scale set in `arcAltitudeAutoScale`. |
172
181
  | <b>arcAltitudeAutoScale</b> | <i>number</i>, <i>string</i> or <i>func</i> | 0.5 | Arc object accessor function, attribute or a numeric constant for the scale of the arc's automatic altitude, in terms of units of the great-arc distance between the two points. A value of `1` indicates the arc should be as high as its length on the ground. Only applicable if `arcAltitude` is not set. |
@@ -379,7 +388,7 @@ ReactDOM.render(
379
388
  | <b>labelLng</b> | <i>number</i>, <i>string</i> or <i>func</i> | `lng` | Label object accessor function, attribute or a numeric constant for the longitude coordinate. |
380
389
  | <b>labelText</b> | <i>string</i> or <i>func</i> | `text` | Label object accessor function or attribute for the label text. |
381
390
  | <b>labelColor</b> | <i>string</i> or <i>func</i> | `() => 'lightgrey'` | Label object accessor function or attribute for the label color. |
382
- | <b>labelAltitude</b> | <i>number</i>, <i>string</i> or <i>func</i> | 0 | Label object accessor function, attribute or a numeric constant for the label altitude in terms of globe radius units. |
391
+ | <b>labelAltitude</b> | <i>number</i>, <i>string</i> or <i>func</i> | 0.002 | Label object accessor function, attribute or a numeric constant for the label altitude in terms of globe radius units. |
383
392
  | <b>labelSize</b> | <i>number</i>, <i>string</i> or <i>func</i> | 0.5 | Label object accessor function, attribute or a numeric constant for the label text height, in angular degrees. |
384
393
  | <b>labelTypeFace</b> | <i>typeface object </i> | [helvetiker regular](https://github.com/mrdoob/three.js/blob/dev/examples/fonts/helvetiker_regular.typeface.json) | Text font typeface JSON object. Supports any typeface font generated by [Facetype.js](http://gero3.github.io/facetype.js/). |
385
394
  | <b>labelRotation</b> | <i>number</i>, <i>string</i> or <i>func</i> | 0 | Label object accessor function, attribute or a numeric constant for the label rotation in degrees. The rotation is performed clockwise along the axis of its latitude parallel plane. |
@@ -472,9 +481,6 @@ ReactDOM.render(
472
481
  | <b>toGeoCoords</b> | { <i>x</i>, <i>y</i>, <i>z</i> } | Utility method to translate cartesian coordinates to the geographic domain. Given a set of 3D cartesian coordinates `{x, y, z}`, returns the equivalent `{lat, lng, altitude}` spherical coordinates. Altitude is defined in terms of globe radius units. |
473
482
  | <b>toGlobeCoords</b> | <i>x</i>, <i>y</i> | Utility method to translate viewport coordinates to the globe surface coordinates directly under the specified viewport pixel. Returns the globe coordinates in the format `{ lat, lng }`, or `null` if the globe does not currently intersect with that viewport location. |
474
483
 
475
- ## Giving Back
476
-
477
- [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=L398E7PKP47E8&currency_code=USD&source=url) If this project has helped you and you'd like to contribute back, you can always [buy me a ☕](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=L398E7PKP47E8&currency_code=USD&source=url)!
478
484
 
479
485
  [npm-img]: https://img.shields.io/npm/v/react-globe.gl
480
486
  [npm-url]: https://npmjs.org/package/react-globe.gl
@@ -59,6 +59,7 @@ interface GlobeProps extends ConfigOptions {
59
59
  showAtmosphere?: boolean;
60
60
  atmosphereColor?: string;
61
61
  atmosphereAltitude?: number;
62
+ globeCurvatureResolution?: number;
62
63
  globeMaterial?: Material;
63
64
  onGlobeReady?: () => void;
64
65
  onGlobeClick?: (coords: { lat: number, lng: number }, event: MouseEvent) => void;
@@ -83,8 +84,10 @@ interface GlobeProps extends ConfigOptions {
83
84
  arcsData?: object[];
84
85
  arcStartLat?: ObjAccessor<number>;
85
86
  arcStartLng?: ObjAccessor<number>;
87
+ arcStartAltitude?: ObjAccessor<number>;
86
88
  arcEndLat?: ObjAccessor<number>;
87
89
  arcEndLng?: ObjAccessor<number>;
90
+ arcEndAltitude?: ObjAccessor<number>;
88
91
  arcColor?: ObjAccessor<string | string[] | ((t: number) => string)>;
89
92
  arcAltitude?: ObjAccessor<number | null>;
90
93
  arcAltitudeAutoScale?: ObjAccessor<number>;
@@ -312,4 +315,5 @@ type FCwithRef<P = {}, R = {}> = React.FunctionComponent<P & { ref?: React.Mutab
312
315
 
313
316
  declare const Globe: FCwithRef<GlobeProps, GlobeMethods>;
314
317
 
315
- export { type GlobeMethods, type GlobeProps, Globe as default };
318
+ export { Globe as default };
319
+ export type { GlobeMethods, GlobeProps };