react-globe.gl 2.33.1 → 2.34.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 +9 -6
- package/dist/react-globe.gl.d.ts +3 -1
- package/dist/react-globe.gl.js +24240 -12874
- package/dist/react-globe.gl.js.map +1 -1
- package/dist/react-globe.gl.min.js +4 -4
- package/package.json +12 -11
package/README.md
CHANGED
|
@@ -58,6 +58,11 @@ A React component to represent data visualization layers on a 3-dimensional glob
|
|
|
58
58
|
* [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
59
|
* [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
60
|
|
|
61
|
+
## ❤️ Support This Project
|
|
62
|
+
|
|
63
|
+
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¤cy_code=USD&source=url). Your contributions help keep open-source sustainable!
|
|
64
|
+
[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=L398E7PKP47E8¤cy_code=USD&source=url)
|
|
65
|
+
|
|
61
66
|
## Quick start
|
|
62
67
|
|
|
63
68
|
```js
|
|
@@ -67,7 +72,7 @@ import Globe from 'react-globe.gl';
|
|
|
67
72
|
or using a *script* tag
|
|
68
73
|
|
|
69
74
|
```html
|
|
70
|
-
<script src="//
|
|
75
|
+
<script src="//cdn.jsdelivr.net/npm/react-globe.gl"></script>
|
|
71
76
|
```
|
|
72
77
|
|
|
73
78
|
then
|
|
@@ -112,7 +117,7 @@ ReactDOM.render(
|
|
|
112
117
|
| <b>backgroundColor</b> | <i>string</i> | `#000011` | Background color. |
|
|
113
118
|
| <b>backgroundImageUrl</b> | <i>string</i> | *-* | URL of the image to be used as background to the globe. If no image is provided, the background color is shown instead. |
|
|
114
119
|
| <b>waitForGlobeReady</b> | <i>bool</i> | `true` | Whether to wait until the globe wrapping or background image has been fully loaded before rendering the globe or any of the data layers. |
|
|
115
|
-
| <b>animateIn</b> | <i>bool</i> | `true` | Whether to animate the globe initialization, by scaling and rotating the globe into its
|
|
120
|
+
| <b>animateIn</b> | <i>bool</i> | `true` | Whether to animate the globe initialization, by scaling and rotating the globe into its initial position. This prop only has an effect on component mount. |
|
|
116
121
|
|
|
117
122
|
### Globe Layer
|
|
118
123
|
|
|
@@ -126,6 +131,7 @@ ReactDOM.render(
|
|
|
126
131
|
| <b>showAtmosphere</b> | <i>bool</i> | `true` | Whether to show a bright halo surrounding the globe, representing the atmosphere. |
|
|
127
132
|
| <b>atmosphereColor</b> | <i>string</i> | `lightskyblue` | The color of the atmosphere. |
|
|
128
133
|
| <b>atmosphereAltitude</b> | <i>string</i> | 0.15 | The max altitude of the atmosphere, in terms of globe radius units. |
|
|
134
|
+
| <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
135
|
| <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
136
|
| <b>onGlobeReady</b> | <i>func</i> | *-* | Callback function to invoke immediately after the globe has been initialized and visible on the scene. |
|
|
131
137
|
| <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)`. |
|
|
@@ -379,7 +385,7 @@ ReactDOM.render(
|
|
|
379
385
|
| <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
386
|
| <b>labelText</b> | <i>string</i> or <i>func</i> | `text` | Label object accessor function or attribute for the label text. |
|
|
381
387
|
| <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. |
|
|
388
|
+
| <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
389
|
| <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
390
|
| <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
391
|
| <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 +478,6 @@ ReactDOM.render(
|
|
|
472
478
|
| <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
479
|
| <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
480
|
|
|
475
|
-
## Giving Back
|
|
476
|
-
|
|
477
|
-
[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=L398E7PKP47E8¤cy_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¤cy_code=USD&source=url)!
|
|
478
481
|
|
|
479
482
|
[npm-img]: https://img.shields.io/npm/v/react-globe.gl
|
|
480
483
|
[npm-url]: https://npmjs.org/package/react-globe.gl
|
package/dist/react-globe.gl.d.ts
CHANGED
|
@@ -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;
|
|
@@ -312,4 +313,5 @@ type FCwithRef<P = {}, R = {}> = React.FunctionComponent<P & { ref?: React.Mutab
|
|
|
312
313
|
|
|
313
314
|
declare const Globe: FCwithRef<GlobeProps, GlobeMethods>;
|
|
314
315
|
|
|
315
|
-
export {
|
|
316
|
+
export { Globe as default };
|
|
317
|
+
export type { GlobeMethods, GlobeProps };
|