@datosgeo-atdt/geo-ui 0.1.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/LICENSE +15 -0
- package/README.md +279 -0
- package/dist/components/MapaPMTiles.d.ts +22 -0
- package/dist/components/MapaPMTiles.d.ts.map +1 -0
- package/dist/geo-ui.css +1 -0
- package/dist/geo-ui.js +26225 -0
- package/dist/geo-ui.js.map +1 -0
- package/dist/geo-ui.umd.cjs +823 -0
- package/dist/geo-ui.umd.cjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/utils/csv.d.ts +8 -0
- package/dist/utils/csv.d.ts.map +1 -0
- package/dist/utils/jenks.d.ts +13 -0
- package/dist/utils/jenks.d.ts.map +1 -0
- package/dist/utils/pmtilesFeatureSearch.d.ts +18 -0
- package/dist/utils/pmtilesFeatureSearch.d.ts.map +1 -0
- package/package.json +77 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ParsedCSVData {
|
|
2
|
+
headers: string[];
|
|
3
|
+
rows: Record<string, string | number>[];
|
|
4
|
+
joinMap: Map<string, string | number>;
|
|
5
|
+
}
|
|
6
|
+
export declare function parseCSVFromURL(url: string, joinKey: string, valueField: string): Promise<ParsedCSVData>;
|
|
7
|
+
export declare function parseCSVFromFile(file: File, joinKey: string, valueField: string): Promise<ParsedCSVData>;
|
|
8
|
+
//# sourceMappingURL=csv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../../src/utils/csv.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACxC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CACvC;AAED,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CAiCxB;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CAgCxB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implementación del algoritmo de Jenks Natural Breaks (Fisher-Jenks)
|
|
3
|
+
* para clasificación de datos en rangos óptimos.
|
|
4
|
+
*
|
|
5
|
+
* Este algoritmo minimiza la varianza dentro de cada clase y maximiza
|
|
6
|
+
* la varianza entre clases.
|
|
7
|
+
*/
|
|
8
|
+
export declare function computeJenksBreaks(values: number[], k: number): number[];
|
|
9
|
+
/**
|
|
10
|
+
* Genera un array de colores interpolados entre dos colores para visualización de rangos.
|
|
11
|
+
*/
|
|
12
|
+
export declare function generateColorRamp(startColor: string, endColor: string, steps: number): string[];
|
|
13
|
+
//# sourceMappingURL=jenks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jenks.d.ts","sourceRoot":"","sources":["../../src/utils/jenks.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CA0ExE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA2B/F"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface BBoxFeature {
|
|
2
|
+
id: string | number;
|
|
3
|
+
bbox: [number, number, number, number];
|
|
4
|
+
properties: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Busca una feature en un archivo PMTiles por ID y extrae su bbox precalculado.
|
|
8
|
+
* Esta función es útil para hacer zoom a una feature específica.
|
|
9
|
+
*
|
|
10
|
+
* @param pmtilesUrl - URL del archivo PMTiles
|
|
11
|
+
* @param sourceLayer - Nombre de la capa vectorial
|
|
12
|
+
* @param featureId - ID de la feature a buscar
|
|
13
|
+
* @param bboxField - Campo donde está almacenado el bbox (default: 'bbox')
|
|
14
|
+
* @param idField - Campo que contiene el ID (default: usar el ID nativo de la feature)
|
|
15
|
+
* @returns La feature con su bbox o null si no se encuentra
|
|
16
|
+
*/
|
|
17
|
+
export declare function findFeatureBBox(pmtilesUrl: string, sourceLayer: string, featureId: string, bboxField?: string, idField?: string): Promise<BBoxFeature | null>;
|
|
18
|
+
//# sourceMappingURL=pmtilesFeatureSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pmtilesFeatureSearch.d.ts","sourceRoot":"","sources":["../../src/utils/pmtilesFeatureSearch.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,GAAE,MAAe,EAC1B,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CA+G7B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@datosgeo-atdt/geo-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Librería de componentes reutilizables en React para aplicaciones geoespaciales, que incluye mapas PMTiles, visualización de datos, unión con CSV y estilos temáticos.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"geospatial",
|
|
8
|
+
"gis",
|
|
9
|
+
"maplibre",
|
|
10
|
+
"pmtiles",
|
|
11
|
+
"vector-tiles",
|
|
12
|
+
"maps",
|
|
13
|
+
"cartografia",
|
|
14
|
+
"datos-geoespaciales",
|
|
15
|
+
"csv",
|
|
16
|
+
"data-visualization",
|
|
17
|
+
"thematic-maps",
|
|
18
|
+
"jenks",
|
|
19
|
+
"ui-components",
|
|
20
|
+
"frontend"
|
|
21
|
+
],
|
|
22
|
+
"homepage": "https://gitlab.com/atdt-desarrollogeo/componentes#readme",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://gitlab.com/atdt-desarrollogeo/componentes/issues"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://gitlab.com/atdt-desarrollogeo/componentes.git"
|
|
29
|
+
},
|
|
30
|
+
"license": "ISC",
|
|
31
|
+
"author": "Direccion de Datos Geograficos - ATDT",
|
|
32
|
+
"type": "module",
|
|
33
|
+
"main": "./dist/geo-ui.umd.cjs",
|
|
34
|
+
"module": "./dist/geo-ui.js",
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
|
+
"import": "./dist/geo-ui.js",
|
|
40
|
+
"require": "./dist/geo-ui.umd.cjs"
|
|
41
|
+
},
|
|
42
|
+
"./style.css": "./dist/style.css"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist"
|
|
46
|
+
],
|
|
47
|
+
"scripts": {
|
|
48
|
+
"dev": "vite",
|
|
49
|
+
"build": "tsc && vite build",
|
|
50
|
+
"preview": "vite preview",
|
|
51
|
+
"prepublishOnly": "npm run build"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"react": "^18.0.0",
|
|
55
|
+
"react-dom": "^18.0.0"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"maplibre-gl": "^5.0.0",
|
|
59
|
+
"pmtiles": "^4.1.1",
|
|
60
|
+
"papaparse": "^5.4.1",
|
|
61
|
+
"@mapbox/vector-tile": "^2.0.3",
|
|
62
|
+
"pbf": "^4.0.1"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@types/geojson": "^7946.0.14",
|
|
66
|
+
"@types/mapbox__vector-tile": "^1.3.4",
|
|
67
|
+
"@types/papaparse": "^5.3.15",
|
|
68
|
+
"@types/react": "^18.3.18",
|
|
69
|
+
"@types/react-dom": "^18.3.5",
|
|
70
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
71
|
+
"react": "^18.3.1",
|
|
72
|
+
"react-dom": "^18.3.1",
|
|
73
|
+
"typescript": "^5.7.2",
|
|
74
|
+
"vite": "^6.0.7",
|
|
75
|
+
"vite-plugin-dts": "^4.3.0"
|
|
76
|
+
}
|
|
77
|
+
}
|