@redus/georedus-ui 0.19.3 → 0.19.5
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
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
# @orioro/template-react
|
|
2
2
|
|
|
3
|
+
## 0.19.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix custom geojson aggregation
|
|
8
|
+
|
|
9
|
+
## 0.19.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- update dependencies
|
|
14
|
+
|
|
3
15
|
## 0.19.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
6
18
|
|
|
19
|
+
- fix total_pessoas_por_km2 mainDisplayValue
|
|
7
20
|
- update dependency versions
|
|
8
21
|
- Updated dependencies
|
|
9
22
|
- @orioro/react-maplibre-util@0.7.1
|
package/dist/main.js
CHANGED
|
@@ -4165,6 +4165,7 @@ var VIEW_TYPE_SURFACE_CHOROPLETH = 'surface_choropleth';
|
|
|
4165
4165
|
|
|
4166
4166
|
function parseSchema(viewSpec, allViewSpecs, context) {
|
|
4167
4167
|
var collection_id = viewSpec.collection_id,
|
|
4168
|
+
source_table_id = viewSpec.source_table_id,
|
|
4168
4169
|
indicator_path = viewSpec.indicator_path,
|
|
4169
4170
|
indicator_id = viewSpec.indicator_id,
|
|
4170
4171
|
indicator_label = viewSpec.indicator_label,
|
|
@@ -4199,6 +4200,7 @@ function parseSchema(viewSpec, allViewSpecs, context) {
|
|
|
4199
4200
|
var sourceLabel = "CENSO ".concat(year);
|
|
4200
4201
|
return {
|
|
4201
4202
|
viewId: viewId,
|
|
4203
|
+
source_table_id: source_table_id,
|
|
4202
4204
|
path: indicator_path,
|
|
4203
4205
|
label: indicator_label,
|
|
4204
4206
|
metodology: metodology,
|
|
@@ -5203,7 +5205,7 @@ function _customGeoJSON_metadata() {
|
|
|
5203
5205
|
});
|
|
5204
5206
|
variableId = context.view.conf.data.variableId;
|
|
5205
5207
|
variant = PARSED_SCHEMA.variantsByVariableId[variableId]; //
|
|
5206
|
-
// Fetch variable values using rpc aggregate_by_geojson
|
|
5208
|
+
// Fetch variable values using rpc aggregate_by_geojson with join
|
|
5207
5209
|
//
|
|
5208
5210
|
_context.next = 13;
|
|
5209
5211
|
return fetch("".concat(GLOBAL_CONTEXT.METADATA_API_ENDPOINT, "/rpc/aggregate_by_geojson"), {
|
|
@@ -5215,9 +5217,12 @@ function _customGeoJSON_metadata() {
|
|
|
5215
5217
|
geometries: AREAS_FEATURES.map(function (feat) {
|
|
5216
5218
|
return feat.geometry;
|
|
5217
5219
|
}),
|
|
5218
|
-
view: "
|
|
5220
|
+
view: "".concat(PARSED_SCHEMA.source_table_id),
|
|
5221
|
+
// no more need to generate a single unique table with all variables, since we are now sending the source table id in the body of the request to perform the join and aggregation in the backend
|
|
5222
|
+
join_table: "ibge_malha_br_setor_censitario_".concat(PARSED_SCHEMA.year),
|
|
5223
|
+
// added in order to perform the join in the backend
|
|
5219
5224
|
agg_column: variableId,
|
|
5220
|
-
agg_type: variableId.endsWith('
|
|
5225
|
+
agg_type: variableId.endsWith('_2') ? 'weighted_avg' : 'sum' // _2 is the new suffix to indicate percentage variables
|
|
5221
5226
|
})
|
|
5222
5227
|
}).then(function (res) {
|
|
5223
5228
|
return res.json();
|
|
@@ -5531,7 +5536,7 @@ function setor_censitario_layers(opts) {
|
|
|
5531
5536
|
var variableId = get$1(context, 'view.conf.data.variableId');
|
|
5532
5537
|
var variableLabel = get$1(context, "view.metadata.labels.".concat(variableId));
|
|
5533
5538
|
var mainValueDisplay;
|
|
5534
|
-
if (variableId === '
|
|
5539
|
+
if (variableId === 'total_pessoas_por_km2') {
|
|
5535
5540
|
try {
|
|
5536
5541
|
var value_src = JSON.parse(context.feature.properties.value_src);
|
|
5537
5542
|
mainValueDisplay = value_src['bas.v0001'];
|
|
@@ -5541,7 +5546,7 @@ function setor_censitario_layers(opts) {
|
|
|
5541
5546
|
}
|
|
5542
5547
|
} else {
|
|
5543
5548
|
var value = get$1(context, 'feature.properties.value');
|
|
5544
|
-
var isPercentage = variableId.endsWith('
|
|
5549
|
+
var isPercentage = variableId.endsWith('_2'); // _2 is the new suffix to indicate percentage variables
|
|
5545
5550
|
var format = isPercentage ? {
|
|
5546
5551
|
style: 'percent'
|
|
5547
5552
|
} : {};
|