@redus/georedus-ui 0.19.4 → 0.20.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/CHANGELOG.md +18 -0
- package/README.md +132 -0
- package/dist/ExportImage/ExportImage.d.ts +1 -0
- package/dist/ExportImage/NorthArrow.d.ts +15 -0
- package/dist/ExportImage/constants.d.ts +2 -0
- package/dist/ExportImage/createMapBlob.d.ts +20 -0
- package/dist/ExportImage/createMapImage.d.ts +1 -0
- package/dist/ExportImage/index.d.ts +1 -0
- package/dist/ExportImage/paperDimensions.d.ts +8 -0
- package/dist/GeoReDUS/constants.d.ts +9 -0
- package/dist/GeoReDUSLogo/GeoReDUSLogo.d.ts +1 -1
- package/dist/LeftPanel/LeftPanel.d.ts +7 -3
- package/dist/LeftPanel/SharePanel.d.ts +7 -3
- package/dist/main.js +2690 -240
- package/dist/viewSpecs/presets/cem_censo/2010_2022/parseSchema.d.ts +1 -0
- package/dist/viewSpecs/presets/index.d.ts +5 -0
- package/dist/viewSpecs/presets/util/colorUtil.d.ts +2 -0
- package/dist/viewSpecs/presets/util/components/basicDownload.d.ts +12 -0
- package/dist/viewSpecs/presets/util/components/basicTooltip.d.ts +20 -0
- package/dist/viewSpecs/presets/util/components/confInputs.d.ts +127 -0
- package/dist/viewSpecs/presets/util/index.d.ts +6 -0
- package/dist/viewSpecs/presets/util/string.d.ts +1 -0
- package/dist/viewSpecs/presets/util/url.d.ts +7 -0
- package/dist/viewSpecs/presets/vector_circle/index.d.ts +75 -1
- package/dist/viewSpecs/presets/vector_line/index.d.ts +95 -2
- package/dist/viewSpecs/presets/vector_point_continuous/download.d.ts +9 -0
- package/dist/viewSpecs/presets/vector_point_continuous/index.d.ts +95 -0
- package/dist/viewSpecs/presets/vector_point_continuous/layers.d.ts +59 -0
- package/dist/viewSpecs/presets/vector_point_continuous/metadata/index.d.ts +11 -0
- package/dist/viewSpecs/presets/vector_point_continuous/parseStyleSpec.d.ts +34 -0
- package/dist/viewSpecs/presets/vector_point_continuous/sources.d.ts +8 -0
- package/dist/viewSpecs/presets/vector_point_single/confSchema.d.ts +63 -0
- package/dist/viewSpecs/presets/vector_point_single/download.d.ts +9 -0
- package/dist/viewSpecs/presets/vector_point_single/index.d.ts +142 -0
- package/dist/viewSpecs/presets/vector_point_single/layers.d.ts +53 -0
- package/dist/viewSpecs/presets/vector_point_single/metadata/index.d.ts +1 -0
- package/dist/viewSpecs/presets/vector_point_single/parseStyleSpec.d.ts +11 -0
- package/dist/viewSpecs/presets/vector_point_single/sources.d.ts +8 -0
- package/dist/viewSpecs/presets/vector_polygon/index.d.ts +93 -10
- package/dist/viewSpecs/presets/vector_polygon_categorical/confSchema.d.ts +14 -0
- package/dist/viewSpecs/presets/vector_polygon_categorical/download.d.ts +9 -0
- package/dist/viewSpecs/presets/vector_polygon_categorical/index.d.ts +108 -0
- package/dist/viewSpecs/presets/vector_polygon_categorical/layers.d.ts +58 -0
- package/dist/viewSpecs/presets/vector_polygon_categorical/metadata.d.ts +11 -0
- package/dist/viewSpecs/presets/vector_polygon_categorical/parseStyleSpec.d.ts +17 -0
- package/dist/viewSpecs/presets/vector_polygon_categorical/sources.d.ts +8 -0
- package/dist/viewSpecs/presets/vector_polygon_continuous/confSchema.d.ts +24 -0
- package/dist/viewSpecs/presets/vector_polygon_continuous/download.d.ts +9 -0
- package/dist/viewSpecs/presets/vector_polygon_continuous/index.d.ts +112 -0
- package/dist/viewSpecs/presets/vector_polygon_continuous/layers.d.ts +54 -0
- package/dist/viewSpecs/presets/vector_polygon_continuous/metadata/colorScaleStopResolvers.d.ts +21 -0
- package/dist/viewSpecs/presets/vector_polygon_continuous/metadata/index.d.ts +9 -0
- package/dist/viewSpecs/presets/vector_polygon_continuous/parseStyleSpec.d.ts +31 -0
- package/dist/viewSpecs/presets/vector_polygon_continuous/sources.d.ts +8 -0
- package/dist/viewSpecs/presets/vector_polygon_single/confSchema.d.ts +73 -0
- package/dist/viewSpecs/presets/vector_polygon_single/download.d.ts +9 -0
- package/dist/viewSpecs/presets/vector_polygon_single/index.d.ts +157 -0
- package/dist/viewSpecs/presets/vector_polygon_single/layers.d.ts +58 -0
- package/dist/viewSpecs/presets/vector_polygon_single/metadata.d.ts +1 -0
- package/dist/viewSpecs/presets/vector_polygon_single/parseStyleSpec.d.ts +7 -0
- package/dist/viewSpecs/presets/vector_polygon_single/sources.d.ts +7 -0
- package/dist/viewSpecs/util/colorSchemes/d3.d.ts +58 -0
- package/dist/viewSpecs/util/colorSchemes/georedus.d.ts +156 -0
- package/dist/viewSpecs/util/colorSchemes/index.d.ts +13 -0
- package/package.json +4 -2
- package/dist/viewSpecs/util/colorSchemes.d.ts +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @orioro/template-react
|
|
2
2
|
|
|
3
|
+
## 0.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- release vector_polygon presets
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @orioro/react-maplibre-util@0.8.0
|
|
13
|
+
- @orioro/react-chart-util@0.3.1
|
|
14
|
+
|
|
15
|
+
## 0.19.5
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- fix custom geojson aggregation
|
|
20
|
+
|
|
3
21
|
## 0.19.4
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
## Exportação de Mapa em Imagem
|
|
2
|
+
### Comparação opções de bibliotecas para exportação de mapa em imagem: Março 2026
|
|
3
|
+
|
|
4
|
+
| Biblioteca | Link | Minified Size | Bundle Size | Download Slow 3G | Download Emerging 4G | Launch | Last Publish | Weekly Download | Fork | Stars |
|
|
5
|
+
|---|---|---|---|---|---|---|---|---|---|---|
|
|
6
|
+
| **html2canvas** | https://www.npmjs.com/package/html2canvas | 193,5Kb | 303B | **6ms** | **338μs** | 27/09/19 | 22/01/22 | **5M** | **4.9K** | **31.8K** |
|
|
7
|
+
| **html-to-image** | https://www.npmjs.com/package/html-to-image | **12.9Kb** | **5.1Kb** | 103ms | 6ms | **26/10/20** | **14/02/25** | 1.3M | 663 | 7.1K |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
###
|
|
12
|
+
|
|
13
|
+
https://miro.com/app/live-embed/uXjVGu7s5fY=/?embedMode=view_only_without_ui&moveToViewport=1149%2C-723%2C5137%2C2496&embedId=518791624362
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
### Sobre as dimensões adotadas
|
|
19
|
+
|
|
20
|
+
A exportação da imagem está sendo feita para o tamanho de uma folha A4 que segue o padrão internacional ISO 216, que define as dimensões físicas dos formatos de papel da série A. Segundo a norma, uma folha A4 possui dimensões de **210 × 297 mm**.
|
|
21
|
+
|
|
22
|
+
As dimensões em pixels não são definidas diretamente pela ISO. Elas são calculadas a partir do tamanho físico da folha e da resolução de impressão (DPI — dots per inch), utilizando a fórmula:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
pixels = (mm/25.4) x DPI
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Por exemplo, uma folha A4 em 300 DPI corresponde aproximadamente a **2480 × 3508 px**.
|
|
29
|
+
|
|
30
|
+
Referências:
|
|
31
|
+
|
|
32
|
+
* [ISO 216 Standard](https://www.iso.org/standard/36631.html?utm_source=chatgpt.com)
|
|
33
|
+
* [PrintReadyKit – A4 Pixel Dimensions](https://printreadykit.com/paper-sizes/a4?utm_source=chatgpt.com)
|
|
34
|
+
* [FeetToPixels – Paper Sizes in Pixels](https://www.feettopixels.com/en/paper-sizes-in-pixels?utm_source=chatgpt.com)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Estilizando Camadas
|
|
39
|
+
|
|
40
|
+
Para estilizar camadas do na plataforma da GeoReDUS nós usamos os parâmetros da bibliteca do [MapLibre](https://maplibre.org/maplibre-style-spec/layers/) na [tabela de Cadastro](https://docs.google.com/spreadsheets/d/1Y2Pt8fXzhGUA_Nhwz7vOyEZUKi6FEP71DChfYBSTa7U/edit?gid=1006885047#gid=1006885047)
|
|
41
|
+
|
|
42
|
+
Nesta tabela existem 4 campos de estilização:
|
|
43
|
+
|
|
44
|
+
- color
|
|
45
|
+
- fill
|
|
46
|
+
- fill_pattern
|
|
47
|
+
- line
|
|
48
|
+
|
|
49
|
+
### Color
|
|
50
|
+
|
|
51
|
+
Temos uma padronização de paleta de cores de acordo com o tipo de dado. Para preencher o campo `color` deve-se usar o padrão nomeDaPaleta.colors.index
|
|
52
|
+
|
|
53
|
+
- **Dados Categóricos**
|
|
54
|
+
|
|
55
|
+
Usamos a paleta [schemePaired](https://d3js.org/d3-scale-chromatic/categorical#schemePaired) da biblioteca D3. É possível também ver a aplicação dessa paleta no [colorBrewer](https://colorbrewer2.org/#type=qualitative&scheme=Paired&n=12).
|
|
56
|
+
|
|
57
|
+
Assim para preencher o campo colors para dados categóricos siga a tabela abaixo
|
|
58
|
+
|
|
59
|
+
| visualização | hexadecimal | código |
|
|
60
|
+
| --------------------------------------------------------- | ----------- | ------------------------ |
|
|
61
|
+
| <img src="docs/assets/color_imgs/a6cee3.png" width="40"/> | `#a6cee3` | `schemePaired.colors.0` |
|
|
62
|
+
| <img src="docs/assets/color_imgs/1f78b4.png" width="40"/> | `#1f78b4` | `schemePaired.colors.1` |
|
|
63
|
+
| <img src="docs/assets/color_imgs/b2df8a.png" width="40"/> | `#b2df8a` | `schemePaired.colors.2` |
|
|
64
|
+
| <img src="docs/assets/color_imgs/33a02c.png" width="40"/> | `#33a02c` | `schemePaired.colors.3` |
|
|
65
|
+
| <img src="docs/assets/color_imgs/fb9a99.png" width="40"/> | `#fb9a99` | `schemePaired.colors.4` |
|
|
66
|
+
| <img src="docs/assets/color_imgs/e31a1c.png" width="40"/> | `#e31a1c` | `schemePaired.colors.5` |
|
|
67
|
+
| <img src="docs/assets/color_imgs/fdbf6f.png" width="40"/> | `#fdbf6f` | `schemePaired.colors.6` |
|
|
68
|
+
| <img src="docs/assets/color_imgs/ff7f00.png" width="40"/> | `#ff7f00` | `schemePaired.colors.7` |
|
|
69
|
+
| <img src="docs/assets/color_imgs/cab2d6.png" width="40"/> | `#cab2d6` | `schemePaired.colors.8` |
|
|
70
|
+
| <img src="docs/assets/color_imgs/6a3d9a.png" width="40"/> | `#6a3d9a` | `schemePaired.colors.9` |
|
|
71
|
+
| <img src="docs/assets/color_imgs/ffff99.png" width="40"/> | `#ffff99` | `schemePaired.colors.10` |
|
|
72
|
+
| <img src="docs/assets/color_imgs/b15928.png" width="40"/> | `#b15928` | `schemePaired.colors.11` |
|
|
73
|
+
|
|
74
|
+
### Fill
|
|
75
|
+
|
|
76
|
+
É possível customizar como será preenchida a camada, no caso de poligonos usando a coluna `fill` com a inserção de um `json`. Para isso siga os parâmetros da bibliteca [MapLibre](https://maplibre.org/maplibre-style-spec/layers/#fill).
|
|
77
|
+
|
|
78
|
+
No exemplo abaixo ele preenche zona urbana com a cor `#808080`, zona rural com a cor `#8B4513` e caso não se encaixe em nenhuma das duas categorias, preenche com a cor `#ff0000`.
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"layout": {
|
|
83
|
+
"visibility": "none"
|
|
84
|
+
},
|
|
85
|
+
"paint": {
|
|
86
|
+
"fill-opacity": 0.4,
|
|
87
|
+
"fill-color": [
|
|
88
|
+
"match",
|
|
89
|
+
["get", "layer"],
|
|
90
|
+
"Zona Urbana",
|
|
91
|
+
"#808080",
|
|
92
|
+
"Zona Rural",
|
|
93
|
+
"#8B4513",
|
|
94
|
+
"#ff0000"
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Fill_pattern
|
|
101
|
+
|
|
102
|
+
É possível inserir hashuras na coluna `fill_pattern`, para isto basta inserir o nome de uma hachura existente no projeto, são elas:
|
|
103
|
+
| visualização | nome hachura |
|
|
104
|
+
|--------------|--------------|
|
|
105
|
+
| <img src="docs/assets/hash_imgs/squares_1.png" width="40"/> | `squares_1` |
|
|
106
|
+
| <img src="docs/assets/hash_imgs/triangles_1.png" width="40"/> | `triangles_1` |
|
|
107
|
+
| <img src="docs/assets/hash_imgs/diamonds_1.png" width="40"/> | `diamonds_1` |
|
|
108
|
+
| <img src="docs/assets/hash_imgs/cross_1.png" width="40"/> | `cross_1` |
|
|
109
|
+
| <img src="docs/assets/hash_imgs/mosaic_1.png" width="40"/> | `mosaic_1` |
|
|
110
|
+
| <img src="docs/assets/hash_imgs/herringbone_8.png" width="40"/> | `mosaic_2` |
|
|
111
|
+
| <img src="docs/assets/hash_imgs/waves_1.png" width="40"/> | `waves_1` |
|
|
112
|
+
| <img src="docs/assets/hash_imgs/circles_1.png" width="40"/> | `circles_1` |
|
|
113
|
+
| <img src="docs/assets/hash_imgs/lines_1.png" width="40"/> | `lines_1` |
|
|
114
|
+
|
|
115
|
+
Todas as hachuras foram extraídas de [Pattern Monster](https://pattern.monster/). Para inserir novas hachuras, será necerrário importar o svg e inseri-lo em `svgPatterns` seguindo o padrão de código dos demais.
|
|
116
|
+
|
|
117
|
+
### Line
|
|
118
|
+
|
|
119
|
+
Para customizar uma linha, é muito parecido com a customização de um preenchimento (`fill`). Siga os parâmetros da bibliteca [MapLibre](https://maplibre.org/maplibre-style-spec/layers/#line), dentro de um `json`.
|
|
120
|
+
|
|
121
|
+
No exemplo abaixo estamos definindo o preenchimento e espaçamento de uma linha tracejada, bem como sua espessura:
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"paint": {
|
|
126
|
+
"line-color": "#9f846a",
|
|
127
|
+
"line-width": 5,
|
|
128
|
+
"line-dasharray": [2, 4],
|
|
129
|
+
"visible": "none"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ExportImage: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NorthArrow Control Component
|
|
3
|
+
*
|
|
4
|
+
* Displays a rotatable north arrow that syncs with the map's bearing.
|
|
5
|
+
* Click to reset the map bearing to 0°.
|
|
6
|
+
*
|
|
7
|
+
* @param {Object} props
|
|
8
|
+
* @param {string} [props.position='bottom-right'] - Position in MapLibre control bar
|
|
9
|
+
* @param {React.CSSProperties} [props.style] - Additional styles for the container
|
|
10
|
+
*/
|
|
11
|
+
export function NorthArrow({ position, className, hidden }: {
|
|
12
|
+
position?: string | undefined;
|
|
13
|
+
style?: React.CSSProperties | undefined;
|
|
14
|
+
}): React.ReactPortal | null;
|
|
15
|
+
import React from 'react';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function extractMapImageBlobs({ map, rootEl }: {
|
|
2
|
+
map: any;
|
|
3
|
+
rootEl: any;
|
|
4
|
+
}): Promise<{
|
|
5
|
+
mapCanvas: any;
|
|
6
|
+
blobLegend: Blob | null;
|
|
7
|
+
blobDescription: Blob | null;
|
|
8
|
+
blobQRCode: Blob | null;
|
|
9
|
+
blobLogo: Blob | null;
|
|
10
|
+
blobProjection: Blob | null;
|
|
11
|
+
blobNorthArrow: Blob | null;
|
|
12
|
+
blobScale: Blob | null;
|
|
13
|
+
}>;
|
|
14
|
+
export const LEGEND_CLASS_NAME: "LegendContainer";
|
|
15
|
+
export const IMAGE_DESCRIPTION_CLASS_NAME: "ImageDescription";
|
|
16
|
+
export const QR_CODE_CLASS_NAME: "QrCode";
|
|
17
|
+
export const LOGO_CLASS_NAME: "Logo";
|
|
18
|
+
export const PROJECTION_CLASS_NAME: "Projection";
|
|
19
|
+
export const NORTH_ARROW_CLASS_NAME: "NorthArrow";
|
|
20
|
+
export const SCALE_CONTROL_CLASS_NAME: "ScaleControl";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function composeMapImageCanvas(extractedBlobs: any): Promise<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ExportImage";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculate all paper layout dimensions based on a given paper width
|
|
3
|
+
* Uses A4 aspect ratio (1:√2) and derives all other constants
|
|
4
|
+
*
|
|
5
|
+
* @param {number} paperWidth - The width of the paper in pixels
|
|
6
|
+
* @returns {Object} Object containing all calculated dimensions
|
|
7
|
+
*/
|
|
8
|
+
export function getPaperDimensions(paperWidth: number): Object;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function GeoReDUSLogo(): React.JSX.Element;
|
|
1
|
+
export function GeoReDUSLogo(props: any): React.JSX.Element;
|
|
2
2
|
import React from 'react';
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
export const LeftPanel: React.MemoExoticComponent<typeof LeftPanelInner>;
|
|
2
|
-
declare function LeftPanelInner({ viewConfState, viewConfDispatch, viewSpecs, resolvedViews, open, onSetOpen,
|
|
2
|
+
declare function LeftPanelInner({ viewConfState, viewConfDispatch, viewSpecs, resolvedViews, resolvedLayout, open, onSetOpen, commitedViewState, municipioId, METADATA_API_ENDPOINT, baseMapStyle, topViews, categoryIcons, header: customHeader, footer: customFooter, }: {
|
|
3
3
|
viewConfState: any;
|
|
4
4
|
viewConfDispatch: any;
|
|
5
5
|
viewSpecs: any;
|
|
6
6
|
resolvedViews: any;
|
|
7
|
+
resolvedLayout: any;
|
|
7
8
|
open: any;
|
|
8
9
|
onSetOpen: any;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
commitedViewState: any;
|
|
11
|
+
municipioId: any;
|
|
12
|
+
METADATA_API_ENDPOINT: any;
|
|
13
|
+
baseMapStyle: any;
|
|
14
|
+
topViews: any;
|
|
11
15
|
categoryIcons?: undefined;
|
|
12
16
|
header?: undefined;
|
|
13
17
|
footer?: undefined;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
export function SharePanel({
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export function SharePanel({ resolvedLayout, commitedViewState, municipioId, METADATA_API_ENDPOINT, baseMapStyle, topViews, }: {
|
|
2
|
+
resolvedLayout: any;
|
|
3
|
+
commitedViewState: any;
|
|
4
|
+
municipioId: any;
|
|
5
|
+
METADATA_API_ENDPOINT: any;
|
|
6
|
+
baseMapStyle: any;
|
|
7
|
+
topViews: any;
|
|
4
8
|
}): React.JSX.Element;
|
|
5
9
|
import React from 'react';
|