# react-3d-earth

> A 3d Earth based on Three.js that mimics github's home page

Latest version **1.0.5** (published 2021-10-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-3d-earth
pnpm add react-3d-earth
yarn add react-3d-earth
bun add react-3d-earth
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-10-29 |
| First published | 2021-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 235.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | HaooLee |
| Maintainers | haoolee |
| Keywords | react, 3d earth, github 3d earth, webgl, canvas, globe, 3D, map |

## Links

- npm: https://www.npmjs.com/package/react-3d-earth
- Repository: https://github.com/HaooLee/react-3d-earth
- Homepage: https://github.com/HaooLee/react-3d-earth#readme
- Issues: https://github.com/HaooLee/react-3d-earth/issues
- npm.io page: https://npm.io/package/react-3d-earth

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^17.0.2
- [three](https://npm.io/package/three.md) ^0.133.1
- [signals](https://npm.io/package/signals.md) ^1.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2021-10-29
- 1.0.3 — 2021-10-11
- 1.0.2 — 2021-10-11
- 1.0.1 — 2021-10-11
- 1.0.0 — 2021-10-11

## README

# Getting started
  
```$xslt
npm install react-3d-earth
```
or 
```$xslt
yarn add react-3d-earth
```
  
```$xslt
import React from "react";
import React3dEarth from 'react-3d-earth'
```


```$xslt
export const App = () => <div>
    <React3dEarth
        style={{width: '100%', height: '100vh',position:'absolute',zIndex:'0'}}
</div>
```
or 
```$xslt
export const App = () => <div>
    <React3dEarth
        style={{width: '100%', height: '100vh',position:'absolute',zIndex:'0'}}
        config={{
          // radius: 30,
          // mobileRadius: 20,
          // backgroundColor: '#fafafa',
          // flagScale:1,
          // flagLat:39.56,
          // flagLon: 116.20,
          // flagColor: 'green'
          // dotColor: 'hotpink'
          // autoRotationSpeed: 3,
          // draggingRotationSpeed:5,
          // textureSrc: '/images/map.png'
        }}/>
</div>
```
## config
| porp | type | default | 备注 |
| --- | --- | --- | --- |
| radius | number | 25 | 地球半径大小 |
| mobileRadius | number | 25 | 在移动端时地球半径大小 |
| textureSrc | string | '' | 自定义地图纹理地址  |
| backgroundColor | string | #040d21 | 背景颜色 |
| flagScale | number | 1 | 旗子放大倍数 |
| flagLat | number | 39.56 | 旗子在地球上的纬度 |
| flagLon | number | 116.20 | 旗子在地球上的经度 |
| flagColor | string |  | 旗子颜色 |
| dotColor | string |  | 地球上点的颜色 |
| autoRotationSpeed | number | 0.15 | 自动转动的速度 |
| draggingRotationSpeed | number | 3 | 拖动时转动的速度 |


## demo

<https://www.haoolee.com>

![earth](earth.jpg)

---
_Source: https://npm.io/package/react-3d-earth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
