gralobe 1.0.5 → 1.0.8
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/LICENSE +21 -0
- package/README.md +28 -7
- package/dist/gralobe.js +1192 -840
- package/dist/gralobe.js.map +1 -1
- package/dist/gralobe.umd.cjs +17 -17
- package/dist/gralobe.umd.cjs.map +1 -1
- package/dist/index.d.ts +87 -18
- package/package.json +4 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Batikan Bora Ormanci
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
# Gralobe
|
|
2
2
|
|
|
3
|
-
> **NPM
|
|
3
|
+
> **Open-source NPM package for beautiful 3D globe visualizations**
|
|
4
|
+
>
|
|
5
|
+
> Created as part of a submission to [TechArena Finland Hackathon](https://platform.techarena-finland.hackathon.com). This is a community contribution we're committed to maintaining and improving!
|
|
4
6
|
|
|
5
|
-
Interactive 3D globe visualization with world statistics, smooth flat map ↔ globe transitions, and country labels.
|
|
7
|
+
Interactive 3D globe visualization with world statistics, smooth flat map ↔ globe transitions, and country labels. **Nothing like this existed before** - and it's 100% useful for data visualization, dashboards, and educational projects!
|
|
6
8
|
|
|
7
9
|
[](https://www.npmjs.com/package/gralobe)
|
|
8
10
|
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
[](https://www.npmjs.com/package/gralobe)
|
|
9
12
|
|
|
10
13
|
## Features
|
|
11
14
|
|
|
@@ -18,9 +21,13 @@ Interactive 3D globe visualization with world statistics, smooth flat map ↔ gl
|
|
|
18
21
|
- Height extrusion based on data values
|
|
19
22
|
- Fully typed TypeScript API
|
|
20
23
|
|
|
21
|
-
## Demo
|
|
24
|
+
## Live Demo
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
**[🌐 Try it live at gralobe.vercel.app](https://gralobe.vercel.app)** - A fully configurable version where you can explore different datasets, textures, and visual effects!
|
|
27
|
+
|
|
28
|
+
[](https://youtu.be/0sl-scBeB88)
|
|
29
|
+
|
|
30
|
+
**[▶️ Watch the demo on YouTube](https://youtu.be/0sl-scBeB88)**
|
|
24
31
|
|
|
25
32
|
## Installation
|
|
26
33
|
|
|
@@ -219,15 +226,29 @@ const customStat: StatisticData = {
|
|
|
219
226
|
format: (v) => `${v.toFixed(1)}%`,
|
|
220
227
|
},
|
|
221
228
|
values: {
|
|
222
|
-
'
|
|
223
|
-
'
|
|
224
|
-
//
|
|
229
|
+
'US': 75.5, // ISO alpha-2
|
|
230
|
+
'Germany': 42.3, // Country name
|
|
231
|
+
'CHN': 60.0, // ISO alpha-3
|
|
232
|
+
'826': 55.0, // ISO numeric
|
|
225
233
|
},
|
|
226
234
|
};
|
|
227
235
|
|
|
228
236
|
globe.setStatistic(customStat);
|
|
229
237
|
```
|
|
230
238
|
|
|
239
|
+
### Supported Country Code Formats
|
|
240
|
+
|
|
241
|
+
Gralobe accepts multiple country identifier formats:
|
|
242
|
+
|
|
243
|
+
| Format | Example | Description |
|
|
244
|
+
|--------|---------|-------------|
|
|
245
|
+
| ISO 3166-1 alpha-2 | `US`, `DE`, `TR` | 2-letter country codes |
|
|
246
|
+
| ISO 3166-1 alpha-3 | `USA`, `DEU`, `TUR` | 3-letter country codes |
|
|
247
|
+
| ISO 3166-1 numeric | `840`, `276`, `792` | 3-digit numeric codes |
|
|
248
|
+
| Country name | `Germany`, `Turkey` | Common English names |
|
|
249
|
+
|
|
250
|
+
All formats are automatically normalized internally.
|
|
251
|
+
|
|
231
252
|
## TypeScript Types
|
|
232
253
|
|
|
233
254
|
```typescript
|