cool-globe 0.1.2 → 0.1.4
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 +16 -6
- package/dist/cool-globe.cjs +16 -4
- package/dist/cool-globe.js +768 -1800
- package/dist/lib/CoolGlobe.d.ts +1 -1
- package/dist/lib/dashboardGlobe.utils.d.ts +14 -0
- package/dist/lib/types.d.ts +2 -0
- package/package.json +21 -3
package/dist/lib/CoolGlobe.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { CoolGlobeProps } from "./types";
|
|
2
|
-
export declare const CoolGlobe: ({ statisticsData, resetSignal, countryNumericToIsoMap, countryNameToIsoMap, primaryMetric, colorScale, }: CoolGlobeProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const CoolGlobe: ({ statisticsData, resetSignal, preselectedCountry, countryNumericToIsoMap, countryNameToIsoMap, primaryMetric, colorScale, }: CoolGlobeProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default CoolGlobe;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
import type { Feature } from "geojson";
|
|
1
2
|
import type { ColorScaleInput, GlobeLevel, MetricRecord } from "./dashboardGlobe.types";
|
|
3
|
+
import type { Bounds } from "./CoolGlobe.types";
|
|
4
|
+
export declare const normalizeCountryIso: (code: string) => string;
|
|
5
|
+
export declare const findCountryFeatureByIso: (features: Feature[], isoA2: string, countryNameToIsoMap?: Record<string, string>) => Feature | undefined;
|
|
6
|
+
export declare const extractFeatureCoordinates: (geometry: unknown) => number[][];
|
|
7
|
+
export declare const getFeatureBounds: (featureItem: Feature) => Bounds | undefined;
|
|
8
|
+
export declare const getAltitudeFromBounds: (bounds: Bounds) => number;
|
|
2
9
|
export declare const getMetricValue: (metricRecord: MetricRecord | undefined, metricKey: string) => number;
|
|
3
10
|
export declare const createColorResolver: (values: number[], colorScale: ColorScaleInput) => (value: number) => string;
|
|
4
11
|
export declare const getZoomLevelByAltitude: (altitude: number) => GlobeLevel;
|
|
5
12
|
export declare const formatMetric: (value: number) => string;
|
|
13
|
+
export declare const escapeHtml: (raw: string) => string;
|
|
14
|
+
/** Removes trailing ISO-3166-1 alpha-2 codes from labels like "Germany (DE)" or "Bayern — DE". */
|
|
15
|
+
export declare const stripIsoFromDisplayName: (rawName: string, isoA2?: string) => string;
|
|
16
|
+
export declare const humanizeMetricKey: (key: string) => string;
|
|
17
|
+
export declare const countryCodeToFlagEmoji: (isoA2: string | undefined) => string;
|
|
18
|
+
export declare const isHiddenMetricKey: (key: string) => boolean;
|
|
19
|
+
export declare const formatMetricDisplay: (metricKey: string, value: number) => string;
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type { ColorScaleInput, StatisticsData } from "./dashboardGlobe.types";
|
|
|
2
2
|
export interface CoolGlobeProps {
|
|
3
3
|
statisticsData: StatisticsData;
|
|
4
4
|
resetSignal?: string | number;
|
|
5
|
+
/** ISO 3166-1 alpha-2 code — auto-selects and zooms to this country once geo data loads. */
|
|
6
|
+
preselectedCountry?: string;
|
|
5
7
|
primaryMetric?: string;
|
|
6
8
|
colorScale?: ColorScaleInput;
|
|
7
9
|
countryNumericToIsoMap?: Record<string, string>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cool-globe",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.4",
|
|
5
5
|
"description": "Reusable interactive React globe component library.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"keywords": [
|
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18"
|
|
30
|
+
},
|
|
28
31
|
"scripts": {
|
|
29
32
|
"dev": "vite",
|
|
30
33
|
"build": "vite build && tsc -p tsconfig.build.json",
|
|
@@ -35,12 +38,26 @@
|
|
|
35
38
|
"peerDependencies": {
|
|
36
39
|
"react": "^18.0.0 || ^19.0.0",
|
|
37
40
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
38
|
-
"react-globe.gl": "^2.37.1"
|
|
41
|
+
"react-globe.gl": "^2.37.1",
|
|
42
|
+
"three": "^0.180.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependenciesMeta": {
|
|
45
|
+
"react": {
|
|
46
|
+
"optional": false
|
|
47
|
+
},
|
|
48
|
+
"react-dom": {
|
|
49
|
+
"optional": false
|
|
50
|
+
},
|
|
51
|
+
"react-globe.gl": {
|
|
52
|
+
"optional": false
|
|
53
|
+
},
|
|
54
|
+
"three": {
|
|
55
|
+
"optional": false
|
|
56
|
+
}
|
|
39
57
|
},
|
|
40
58
|
"dependencies": {
|
|
41
59
|
"d3-interpolate": "^3.0.1",
|
|
42
60
|
"d3-scale": "^4.0.2",
|
|
43
|
-
"three": "^0.180.0",
|
|
44
61
|
"topojson-client": "^3.1.0"
|
|
45
62
|
},
|
|
46
63
|
"devDependencies": {
|
|
@@ -57,6 +74,7 @@
|
|
|
57
74
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
58
75
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
59
76
|
"globals": "^16.5.0",
|
|
77
|
+
"three": "^0.180.0",
|
|
60
78
|
"typescript": "~5.9.3",
|
|
61
79
|
"typescript-eslint": "^8.48.0",
|
|
62
80
|
"vite": "^7.3.1"
|