@redus/georedus-ui 0.19.1 → 0.19.3

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,5 +1,22 @@
1
1
  # @orioro/template-react
2
2
 
3
+ ## 0.19.3
4
+
5
+ ### Patch Changes
6
+
7
+ - update dependency versions
8
+ - Updated dependencies
9
+ - @orioro/react-maplibre-util@0.7.1
10
+ - @orioro/react-chart-util@0.3.1
11
+ - @orioro/vector-tile-util@0.3.1
12
+ - @orioro/react-dir-nav@0.2.1
13
+
14
+ ## 0.19.2
15
+
16
+ ### Patch Changes
17
+
18
+ - fix etapa de ensino
19
+
3
20
  ## 0.19.1
4
21
 
5
22
  ### Patch Changes
package/dist/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import { get, isPlainObject, pick, omit, set, uniqBy, groupBy, uniq } from 'lodash';
1
+ import { get, isPlainObject, pick, omit, set, uniqBy, groupBy, sortBy, uniq } from 'lodash';
2
2
  import { slugify, dataJoin, interpolate } from '@orioro/util';
3
3
  import { makeResolve, $$literal, withExpressionResolvers, expressions, ALL_EXPR, fetchExpr, resolve, resolveAsync } from '@orioro/resolve';
4
4
  import { __assign, __spreadArray, __awaiter, __generator, __makeTemplateObject } from 'tslib';
@@ -3631,12 +3631,12 @@ function influenceAreaLayers(_a) {
3631
3631
  };
3632
3632
  }
3633
3633
 
3634
- var _excluded$8 = ["version"];
3634
+ var _excluded$9 = ["version"];
3635
3635
  function tableVectorSource(context, tableId) {
3636
3636
  var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
3637
3637
  _ref$version = _ref.version,
3638
3638
  version = _ref$version === void 0 ? '1' : _ref$version,
3639
- override = _objectWithoutProperties(_ref, _excluded$8);
3639
+ override = _objectWithoutProperties(_ref, _excluded$9);
3640
3640
  var VECTOR_TILE_SERVER_ENDPOINT = context.VECTOR_TILE_SERVER_ENDPOINT;
3641
3641
  return _objectSpread2({
3642
3642
  type: 'vector',
@@ -4092,23 +4092,46 @@ function cem_escolas_2022(config, allViewSpecs, context) {
4092
4092
  var $tooltip = {
4093
4093
  title: ['$literal', ['$get', 'feature.properties.no_escola']],
4094
4094
  entries: [[indicator_label, ['$literal', ['$coalesce', ['$get', "feature.properties.".concat(VARIABLE_ID, "::string({\n number: ").concat(JSON.stringify(number_format), ",\n boolean: {\n true: 'Sim',\n false: 'N\xE3o'\n }\n })")], 'Sem dados']]], sizing_variable_id ? [sizing_variable_label, ['$literal', ['$get', "feature.properties.".concat(sizing_variable_id, "::string")]]] : null, ['Etapas de ensino', ['$literal', resolve.fn(function (context) {
4095
- var ETAPAS = {
4096
- in_inf_cre: 'Infantil / Creche',
4097
- in_inf_pre: 'Infantil / Pré-escola',
4098
- in_fund_ai: 'Fundamental I',
4099
- in_fund_af: 'Fundamental II',
4100
- in_med: 'Ensino Médio'
4101
- };
4102
- return Object.entries(ETAPAS).filter(function (_ref3) {
4103
- var _context$feature, _context$feature2;
4104
- var _ref4 = _slicedToArray(_ref3, 2),
4105
- key = _ref4[0];
4106
- _ref4[1];
4107
- return (context === null || context === void 0 || (_context$feature = context.feature) === null || _context$feature === void 0 ? void 0 : _context$feature.properties) && (context === null || context === void 0 || (_context$feature2 = context.feature) === null || _context$feature2 === void 0 ? void 0 : _context$feature2.properties[key]);
4108
- }).map(function (_ref5) {
4109
- var _ref6 = _slicedToArray(_ref5, 2);
4110
- _ref6[0];
4111
- var label = _ref6[1];
4095
+ var _context$feature;
4096
+ var properties = (context === null || context === void 0 || (_context$feature = context.feature) === null || _context$feature === void 0 ? void 0 : _context$feature.properties) || {};
4097
+
4098
+ // Mapeamos os rótulos aos possíveis finais de string (sufixos)
4099
+ // que essa coluna pode ter na base de 2022 ou nas bases >= 2023
4100
+ // 'in_inf_cre' é o sufixo para a etapa "Infantil / Creche" na base de 2022, enquanto 'edu02_etp_cre_0' é o sufixo para a mesma etapa nas bases de 2023 em diante
4101
+ // Na tabela de 2023, a coluna se chama in23_edu02_etp_cre_0, por exemplo, mas como só nos importam os sufixos finais, conseguimos usar a mesma lógica para todos os anos
4102
+ var ETAPAS = [{
4103
+ label: 'Infantil / Creche',
4104
+ sufixos: ['in_inf_cre', 'edu02_etp_cre_0']
4105
+ }, {
4106
+ label: 'Infantil / Pré-escola',
4107
+ sufixos: ['in_inf_pre', 'edu02_etp_pre_0']
4108
+ }, {
4109
+ label: 'Fundamental I',
4110
+ sufixos: ['in_fund_ai', 'edu02_etp_fn1_0']
4111
+ }, {
4112
+ label: 'Fundamental II',
4113
+ sufixos: ['in_fund_af', 'edu02_etp_fn2_0']
4114
+ }, {
4115
+ label: 'Ensino Médio',
4116
+ sufixos: ['in_med', 'edu02_etp_em_0']
4117
+ }];
4118
+ return ETAPAS.filter(function (_ref3) {
4119
+ var sufixos = _ref3.sufixos;
4120
+ // Percorre todas as propriedades da feature atual
4121
+ return Object.entries(properties).some(function (_ref4) {
4122
+ var _ref5 = _slicedToArray(_ref4, 2),
4123
+ key = _ref5[0],
4124
+ value = _ref5[1];
4125
+ return (
4126
+ // Verifica se o nome da coluna termina com algum dos sufixos mapeados
4127
+ // E se o valor da coluna é "truthy" (maior que 0, true, etc)
4128
+ sufixos.some(function (sufixo) {
4129
+ return key.endsWith(sufixo);
4130
+ }) && value
4131
+ );
4132
+ });
4133
+ }).map(function (_ref6) {
4134
+ var label = _ref6.label;
4112
4135
  return label;
4113
4136
  }).join(', ');
4114
4137
  })]], ['Rede de ensino', ['$literal', ['$get', 'feature.properties.tp_dependencia']]]].filter(Boolean)
@@ -4953,7 +4976,8 @@ function cem_censo_2010_2022(viewSpec, allViewSpecs, context) {
4953
4976
  };
4954
4977
  }
4955
4978
 
4956
- function download(context) {
4979
+ function download(context, _ref) {
4980
+ var PARSED_SCHEMA = _ref.PARSED_SCHEMA;
4957
4981
  var METADATA_API_ENDPOINT = context.METADATA_API_ENDPOINT;
4958
4982
  return downloadResolver({
4959
4983
  fileNameBase: ['$template', '${0}_${1}_georedus_censo_${2}', [['$get', 'view.conf.data.variableId'], ['$get', 'municipioId'], '2022']],
@@ -4961,48 +4985,49 @@ function download(context) {
4961
4985
  availableVariableIds: [],
4962
4986
  fetchData: resolve.fn(function (ctx) {
4963
4987
  return /*#__PURE__*/function () {
4964
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
4965
- var options, variableId, dataUrl, data, geometriesUrl, geometries;
4988
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
4989
+ var options, variableId, source_table_id, dataUrl, data, geometriesUrl, geometries;
4966
4990
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4967
4991
  while (1) switch (_context.prev = _context.next) {
4968
4992
  case 0:
4969
- _ref.variableIds, options = _ref.options;
4993
+ _ref2.variableIds, options = _ref2.options;
4970
4994
  variableId = ctx.view.conf.data.variableId;
4971
- dataUrl = "".concat(METADATA_API_ENDPOINT, "/cem_censo_2022_pessoas?") + "cd_mun=eq.".concat(ctx.app.municipioId, "&") + "select=id,".concat(variableId, ",").concat(variableId, "_src");
4972
- _context.next = 5;
4995
+ source_table_id = PARSED_SCHEMA.variantsByVariableId[variableId].source_table_id;
4996
+ dataUrl = "".concat(METADATA_API_ENDPOINT, "/").concat(source_table_id, "?") + "cd_mun=eq.".concat(ctx.app.municipioId, "&") + "select=id,".concat(variableId, ",").concat(variableId, "_src");
4997
+ _context.next = 6;
4973
4998
  return fetch(dataUrl).then(function (res) {
4974
4999
  return res.json();
4975
5000
  });
4976
- case 5:
5001
+ case 6:
4977
5002
  data = _context.sent.map(function (entry) {
4978
5003
  var newEntry = _objectSpread2(_objectSpread2({}, entry), entry["".concat(variableId, "_src")]);
4979
5004
  delete newEntry["".concat(variableId, "_src")];
4980
5005
  return newEntry;
4981
5006
  });
4982
5007
  if (!(options.format === 'CSV')) {
4983
- _context.next = 8;
5008
+ _context.next = 9;
4984
5009
  break;
4985
5010
  }
4986
5011
  return _context.abrupt("return", data);
4987
- case 8:
5012
+ case 9:
4988
5013
  geometriesUrl = "".concat(METADATA_API_ENDPOINT, "/ibge_malha_br_setor_censitario_2022?") + "cd_mun=eq.".concat(ctx.app.municipioId, "&") + "select=id,geom";
4989
- _context.next = 11;
5014
+ _context.next = 12;
4990
5015
  return fetch(geometriesUrl).then(function (res) {
4991
5016
  return res.json();
4992
5017
  });
4993
- case 11:
5018
+ case 12:
4994
5019
  geometries = _context.sent;
4995
5020
  return _context.abrupt("return", dataJoin([geometries, data], {
4996
5021
  key: 'id'
4997
5022
  }));
4998
- case 13:
5023
+ case 14:
4999
5024
  case "end":
5000
5025
  return _context.stop();
5001
5026
  }
5002
5027
  }, _callee);
5003
5028
  }));
5004
5029
  return function (_x) {
5005
- return _ref2.apply(this, arguments);
5030
+ return _ref3.apply(this, arguments);
5006
5031
  };
5007
5032
  }();
5008
5033
  })
@@ -5883,7 +5908,9 @@ function cem_censo_2022(viewSpec, allViewSpecs, context) {
5883
5908
  if (!PARSED_SCHEMA) {
5884
5909
  return null;
5885
5910
  }
5886
- var DOWNLOAD = download(context);
5911
+ var DOWNLOAD = download(context, {
5912
+ PARSED_SCHEMA: PARSED_SCHEMA
5913
+ });
5887
5914
  var CHOROPLETH = choropleth({
5888
5915
  GLOBAL_CONTEXT: context,
5889
5916
  PARSED_SCHEMA: PARSED_SCHEMA
@@ -6288,7 +6315,7 @@ function cem_saude_2024(viewSpec, allViewSpecs, context) {
6288
6315
  }));
6289
6316
  }
6290
6317
 
6291
- var _excluded$7 = ["label", "color", "line", "fill", "tiles", "source_layer", "sources", "layers"];
6318
+ var _excluded$8 = ["label", "color", "line", "fill", "tiles", "source_layer", "sources", "layers"];
6292
6319
  function _parseTiles$2(tiles, context) {
6293
6320
  tiles = Array.isArray(tiles) ? tiles : typeof tiles === 'string' ? [tiles] : null;
6294
6321
  if (!tiles) {
@@ -6311,7 +6338,7 @@ function vector_polygon(_ref, allViewSpecs, context) {
6311
6338
  sources = _ref$sources === void 0 ? {} : _ref$sources,
6312
6339
  _ref$layers = _ref.layers,
6313
6340
  layers = _ref$layers === void 0 ? {} : _ref$layers,
6314
- props = _objectWithoutProperties(_ref, _excluded$7);
6341
+ props = _objectWithoutProperties(_ref, _excluded$8);
6315
6342
  if (!source_layer) {
6316
6343
  throw new Error('source_layer must be defined');
6317
6344
  }
@@ -6365,7 +6392,7 @@ function vector_polygon(_ref, allViewSpecs, context) {
6365
6392
  });
6366
6393
  }
6367
6394
 
6368
- var _excluded$6 = ["line", "color", "tiles", "source_layer", "sources", "layers"];
6395
+ var _excluded$7 = ["line", "color", "tiles", "source_layer", "sources", "layers"];
6369
6396
  function _parseTiles$1(tiles, context) {
6370
6397
  tiles = Array.isArray(tiles) ? tiles : typeof tiles === 'string' ? [tiles] : null;
6371
6398
  if (!tiles) {
@@ -6385,7 +6412,7 @@ function vector_line(_ref, allViewSpecs, context) {
6385
6412
  sources = _ref$sources === void 0 ? {} : _ref$sources,
6386
6413
  _ref$layers = _ref.layers,
6387
6414
  layers = _ref$layers === void 0 ? {} : _ref$layers,
6388
- props = _objectWithoutProperties(_ref, _excluded$6);
6415
+ props = _objectWithoutProperties(_ref, _excluded$7);
6389
6416
  if (!source_layer) {
6390
6417
  throw new Error('source_layer must be defined');
6391
6418
  }
@@ -6422,7 +6449,7 @@ function vector_line(_ref, allViewSpecs, context) {
6422
6449
  });
6423
6450
  }
6424
6451
 
6425
- var _excluded$5 = ["circle", "color", "tiles", "source_layer", "sources", "layers"];
6452
+ var _excluded$6 = ["circle", "color", "tiles", "source_layer", "sources", "layers"];
6426
6453
  function _parseTiles(tiles, context) {
6427
6454
  tiles = Array.isArray(tiles) ? tiles : typeof tiles === 'string' ? [tiles] : null;
6428
6455
  if (!tiles) {
@@ -6442,7 +6469,7 @@ function vector_circle(_ref, allViewSpecs, context) {
6442
6469
  sources = _ref$sources === void 0 ? {} : _ref$sources,
6443
6470
  _ref$layers = _ref.layers,
6444
6471
  layers = _ref$layers === void 0 ? {} : _ref$layers,
6445
- props = _objectWithoutProperties(_ref, _excluded$5);
6472
+ props = _objectWithoutProperties(_ref, _excluded$6);
6446
6473
  if (!source_layer) {
6447
6474
  throw new Error('source_layer must be defined');
6448
6475
  }
@@ -8024,6 +8051,217 @@ function temperatura_superficie(_ref7) {
8024
8051
  }));
8025
8052
  }
8026
8053
 
8054
+ var _excluded$5 = ["circle", "color", "tiles", "source_layer", "sources", "layers", "VECTOR_TILE_SERVER_ENDPOINT", "METADATA_API_ENDPOINT"],
8055
+ _excluded2$1 = ["geom"];
8056
+ var ISOCHRONE_COLORS = [{
8057
+ value: 15,
8058
+ label: '15 min',
8059
+ color: '#2ECC71'
8060
+ }, {
8061
+ value: 30,
8062
+ label: '30 min',
8063
+ color: '#F1C40F'
8064
+ }, {
8065
+ value: 45,
8066
+ label: '45 min',
8067
+ color: '#E67E22'
8068
+ }, {
8069
+ value: 60,
8070
+ label: '60 min',
8071
+ color: '#E74C3C'
8072
+ }];
8073
+ function piloto_mobilidade_stops(_ref) {
8074
+ var _ref$circle = _ref.circle,
8075
+ circle = _ref$circle === void 0 ? {} : _ref$circle,
8076
+ color = _ref.color,
8077
+ tiles = _ref.tiles,
8078
+ source_layer = _ref.source_layer,
8079
+ _ref$sources = _ref.sources,
8080
+ sources = _ref$sources === void 0 ? {} : _ref$sources,
8081
+ _ref$layers = _ref.layers,
8082
+ layers = _ref$layers === void 0 ? {} : _ref$layers;
8083
+ _ref.VECTOR_TILE_SERVER_ENDPOINT;
8084
+ var METADATA_API_ENDPOINT = _ref.METADATA_API_ENDPOINT,
8085
+ props = _objectWithoutProperties(_ref, _excluded$5);
8086
+ if (!source_layer) {
8087
+ throw new Error('source_layer must be defined');
8088
+ }
8089
+ return _objectSpread2(_objectSpread2({}, props), {}, {
8090
+ // confSchema: {
8091
+ // data: {
8092
+ // isocrona_origem_stop_id: {
8093
+ // label: 'ID do ponto de ônibus analisado',
8094
+ // type: 'text',
8095
+ // },
8096
+ // },
8097
+ // },
8098
+ metadata: {
8099
+ isocrona_origem_polygons_geojson: resolveAsync.fn(/*#__PURE__*/function () {
8100
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(context) {
8101
+ var _context$view;
8102
+ var stop_id, isocrona_origem_polygons;
8103
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
8104
+ while (1) switch (_context.prev = _context.next) {
8105
+ case 0:
8106
+ stop_id = context === null || context === void 0 || (_context$view = context.view) === null || _context$view === void 0 || (_context$view = _context$view.conf) === null || _context$view === void 0 || (_context$view = _context$view.data) === null || _context$view === void 0 ? void 0 : _context$view.isocrona_origem_stop_id;
8107
+ if (stop_id) {
8108
+ _context.next = 3;
8109
+ break;
8110
+ }
8111
+ return _context.abrupt("return", null);
8112
+ case 3:
8113
+ _context.next = 5;
8114
+ return fetch("".concat(METADATA_API_ENDPOINT, "/fnp_piloto_mobilidade_2026_isocronas_origem?id=eq.").concat(stop_id)).then(function (res) {
8115
+ return res.json();
8116
+ });
8117
+ case 5:
8118
+ isocrona_origem_polygons = _context.sent;
8119
+ return _context.abrupt("return", {
8120
+ type: 'FeatureCollection',
8121
+ features: sortBy(isocrona_origem_polygons, 'isochrone').reverse().map(function (_ref3) {
8122
+ var geom = _ref3.geom,
8123
+ properties = _objectWithoutProperties(_ref3, _excluded2$1);
8124
+ return {
8125
+ type: 'Feature',
8126
+ properties: properties,
8127
+ geometry: geom
8128
+ };
8129
+ })
8130
+ });
8131
+ case 7:
8132
+ case "end":
8133
+ return _context.stop();
8134
+ }
8135
+ }, _callee);
8136
+ }));
8137
+ return function (_x) {
8138
+ return _ref2.apply(this, arguments);
8139
+ };
8140
+ }())
8141
+ },
8142
+ sources: _objectSpread2({
8143
+ main: {
8144
+ promoteId: 'id',
8145
+ type: 'vector',
8146
+ tiles: tiles
8147
+ },
8148
+ isocrona_origem_polygons: resolve.fn(function (context) {
8149
+ var _context$view2;
8150
+ var isocrona_origem_polygons_geojson = context === null || context === void 0 || (_context$view2 = context.view) === null || _context$view2 === void 0 || (_context$view2 = _context$view2.metadata) === null || _context$view2 === void 0 ? void 0 : _context$view2.isocrona_origem_polygons_geojson;
8151
+ if (!isocrona_origem_polygons_geojson) {
8152
+ return null;
8153
+ }
8154
+ return {
8155
+ type: 'geojson',
8156
+ data: isocrona_origem_polygons_geojson
8157
+ };
8158
+ })
8159
+ }, sources),
8160
+ layers: _objectSpread2(_defineProperty(_defineProperty({}, "main_circle", _objectSpread2(_objectSpread2({
8161
+ zIndex: Z_OVERLAY_TOP_3000,
8162
+ source: 'main',
8163
+ 'source-layer': source_layer,
8164
+ type: 'circle'
8165
+ }, circle), {}, {
8166
+ filter: resolve.fn(function (context) {
8167
+ var _context$view3;
8168
+ var isocrona_origem_stop_id = context === null || context === void 0 || (_context$view3 = context.view) === null || _context$view3 === void 0 || (_context$view3 = _context$view3.conf) === null || _context$view3 === void 0 || (_context$view3 = _context$view3.data) === null || _context$view3 === void 0 ? void 0 : _context$view3.isocrona_origem_stop_id;
8169
+ return isocrona_origem_stop_id ? ['==', ['get', 'stop_id'], isocrona_origem_stop_id] : ['all'];
8170
+ }),
8171
+ paint: resolve.fn(function (context) {
8172
+ var _context$view4;
8173
+ var PAINT_BASE = {
8174
+ 'circle-color': color,
8175
+ 'circle-stroke-color': '#000000',
8176
+ 'circle-radius': 6
8177
+ };
8178
+ var isocrona_origem_stop_id = context === null || context === void 0 || (_context$view4 = context.view) === null || _context$view4 === void 0 || (_context$view4 = _context$view4.conf) === null || _context$view4 === void 0 || (_context$view4 = _context$view4.data) === null || _context$view4 === void 0 ? void 0 : _context$view4.isocrona_origem_stop_id;
8179
+ return isocrona_origem_stop_id ? _objectSpread2(_objectSpread2({}, PAINT_BASE), {}, {
8180
+ 'circle-stroke-width': 3,
8181
+ 'circle-radius': 10
8182
+ // 'circle-color': 'red',
8183
+ }) : _objectSpread2(_objectSpread2({}, PAINT_BASE), {}, {
8184
+ 'circle-radius': 4,
8185
+ 'circle-stroke-width': 1,
8186
+ 'circle-stroke-opacity': ['interpolate', ['linear'], ['zoom'], 12, 0, 16, 0.8],
8187
+ 'circle-opacity': ['interpolate', ['linear'], ['zoom'], 10, 0.2, 16, 0.9]
8188
+ });
8189
+ }),
8190
+ onClick: resolve.fn(function (ctx) {
8191
+ return function (e) {
8192
+ var _ctx$view;
8193
+ var isocrona_origem_stop_id = ctx === null || ctx === void 0 || (_ctx$view = ctx.view) === null || _ctx$view === void 0 || (_ctx$view = _ctx$view.conf) === null || _ctx$view === void 0 || (_ctx$view = _ctx$view.data) === null || _ctx$view === void 0 ? void 0 : _ctx$view.isocrona_origem_stop_id;
8194
+ ctx.app.viewConfDispatch({
8195
+ type: 'SET_VIEW',
8196
+ payload: {
8197
+ viewConf: _objectSpread2(_objectSpread2({}, ctx.view.conf), {}, {
8198
+ data: _objectSpread2(_objectSpread2({}, ctx.view.conf), {}, {
8199
+ isocrona_origem_stop_id: isocrona_origem_stop_id ? null : e.properties.stop_id
8200
+ })
8201
+ })
8202
+ }
8203
+ });
8204
+ };
8205
+ }),
8206
+ tooltip: {
8207
+ title: ['$literal', resolve.fn(function (ctx) {
8208
+ var _ctx$feature;
8209
+ return ctx === null || ctx === void 0 || (_ctx$feature = ctx.feature) === null || _ctx$feature === void 0 || (_ctx$feature = _ctx$feature.properties) === null || _ctx$feature === void 0 ? void 0 : _ctx$feature.stop_name;
8210
+ })],
8211
+ entries: ['$literal', resolve.fn(function (ctx) {
8212
+ var _ctx$feature2;
8213
+ console.log(ctx.feature.properties);
8214
+ return _typeof((_ctx$feature2 = ctx.feature) === null || _ctx$feature2 === void 0 ? void 0 : _ctx$feature2.properties) === 'object' ? Object.entries({
8215
+ Linhas: ctx.feature.properties.routes ? JSON.parse(ctx.feature.properties.routes).join(', ') : null,
8216
+ ID: ctx.feature.properties.stop_id
8217
+ }) : [];
8218
+ })]
8219
+ }
8220
+ })), "isocrona_origem_polygons", resolve.fn(function (context) {
8221
+ var _context$view5;
8222
+ var isocrona_origem_polygons_geojson = context === null || context === void 0 || (_context$view5 = context.view) === null || _context$view5 === void 0 || (_context$view5 = _context$view5.metadata) === null || _context$view5 === void 0 ? void 0 : _context$view5.isocrona_origem_polygons_geojson;
8223
+ if (!isocrona_origem_polygons_geojson) {
8224
+ return null;
8225
+ }
8226
+ return {
8227
+ source: 'isocrona_origem_polygons',
8228
+ type: 'fill',
8229
+ paint: {
8230
+ 'fill-opacity': 1,
8231
+ 'fill-color': ['match', ['get', 'isochrone']].concat(_toConsumableArray(ISOCHRONE_COLORS.flatMap(function (item) {
8232
+ return [item.value, item.color];
8233
+ })), ['#CCCCCC' // fallback
8234
+ ])
8235
+ },
8236
+ // tooltip: {
8237
+ // title: [
8238
+ // '$literal',
8239
+ // resolve.fn((ctx) => {
8240
+ // return ctx?.feature?.properties?.name
8241
+ // }),
8242
+ // ],
8243
+ // entries: [
8244
+ // '$literal',
8245
+ // resolve.fn((ctx) => {
8246
+ // return typeof ctx.feature?.properties === 'object'
8247
+ // ? Object.entries({
8248
+ // 'Tempo de deslocamento':
8249
+ // ctx.feature.properties.isochrone + ' min',
8250
+ // })
8251
+ // : []
8252
+ // }),
8253
+ // ],
8254
+ // },
8255
+ legends: [{
8256
+ type: 'CategoricalLegend',
8257
+ title: 'Tempo de deslocamento',
8258
+ items: ISOCHRONE_COLORS
8259
+ }]
8260
+ };
8261
+ })), layers)
8262
+ });
8263
+ }
8264
+
8027
8265
  var index = /*#__PURE__*/Object.freeze({
8028
8266
  __proto__: null,
8029
8267
  STAGE_SPECIAL_KEYS: STAGE_SPECIAL_KEYS,
@@ -8044,6 +8282,7 @@ var index = /*#__PURE__*/Object.freeze({
8044
8282
  fetchViewSpecs: fetchViewSpecs,
8045
8283
  hand: hand,
8046
8284
  overture_places_poc: overture_places_poc,
8285
+ piloto_mobilidade_stops: piloto_mobilidade_stops,
8047
8286
  redus_mutirao_cop_2025: redus_mutirao_cop_2025,
8048
8287
  resolveConfSchema: resolveConfSchema,
8049
8288
  resolveControls: resolveControls,
@@ -11679,6 +11918,7 @@ function GeoReDUSInner(_ref2) {
11679
11918
  return {
11680
11919
  municipioId: municipioId,
11681
11920
  baseMapStyle: baseMapStyle,
11921
+ viewConfDispatch: viewConfDispatch,
11682
11922
  //
11683
11923
  // Pass only zoomLevel instead of zoom itself
11684
11924
  // in order for views not recompute on every zoom change
@@ -11687,7 +11927,7 @@ function GeoReDUSInner(_ref2) {
11687
11927
  regional: regional,
11688
11928
  mapBounds: mapBounds
11689
11929
  };
11690
- }, [municipioId, baseMapStyle, zoomLevel, regional, mapBounds]);
11930
+ }, [municipioId, baseMapStyle, viewConfDispatch, zoomLevel, regional, mapBounds]);
11691
11931
  var _useViews = useViews({
11692
11932
  viewSpecs: viewSpecsQuery.data,
11693
11933
  viewConfState: viewConfState,
@@ -12131,9 +12371,6 @@ function GeoReDUSInner(_ref2) {
12131
12371
  right: '20px',
12132
12372
  zIndex: 20
12133
12373
  },
12134
- spinnerProps: {
12135
- size: 20
12136
- },
12137
12374
  message: null
12138
12375
  })), children);
12139
12376
  }
@@ -6,3 +6,4 @@ export * from "./hand";
6
6
  export * from "./overture_places_poc";
7
7
  export * from "./redus_mutirao_cop_2025";
8
8
  export * from "./temperatura_superficie";
9
+ export * from "./piloto_mobilidade_stops";
@@ -0,0 +1,103 @@
1
+ export function piloto_mobilidade_stops({ circle, color, tiles, source_layer, sources, layers, VECTOR_TILE_SERVER_ENDPOINT, METADATA_API_ENDPOINT, ...props }: {
2
+ [x: string]: any;
3
+ circle?: {} | undefined;
4
+ color: any;
5
+ tiles: any;
6
+ source_layer: any;
7
+ sources?: {} | undefined;
8
+ layers?: {} | undefined;
9
+ VECTOR_TILE_SERVER_ENDPOINT: any;
10
+ METADATA_API_ENDPOINT: any;
11
+ }): {
12
+ metadata: {
13
+ isocrona_origem_polygons_geojson: {
14
+ [x: string]: any;
15
+ $$resolver: symbol;
16
+ $$unresolved?: Record<string | number, import("@orioro/resolve").ResolutionNode> | undefined;
17
+ dependencies: any;
18
+ value: (...args: any[]) => any;
19
+ defaultValue?: any;
20
+ context?: any;
21
+ };
22
+ };
23
+ sources: {
24
+ main: {
25
+ promoteId: string;
26
+ type: string;
27
+ tiles: any;
28
+ };
29
+ isocrona_origem_polygons: {
30
+ [x: string]: any;
31
+ $$resolver: symbol;
32
+ $$unresolved?: Record<string | number, import("@orioro/resolve").ResolutionNode> | undefined;
33
+ dependencies: any;
34
+ value: (...args: any[]) => any;
35
+ defaultValue?: any;
36
+ context?: any;
37
+ };
38
+ };
39
+ layers: {
40
+ main_circle: {
41
+ filter: {
42
+ [x: string]: any;
43
+ $$resolver: symbol;
44
+ $$unresolved?: Record<string | number, import("@orioro/resolve").ResolutionNode> | undefined;
45
+ dependencies: any;
46
+ value: (...args: any[]) => any;
47
+ defaultValue?: any;
48
+ context?: any;
49
+ };
50
+ paint: {
51
+ [x: string]: any;
52
+ $$resolver: symbol;
53
+ $$unresolved?: Record<string | number, import("@orioro/resolve").ResolutionNode> | undefined;
54
+ dependencies: any;
55
+ value: (...args: any[]) => any;
56
+ defaultValue?: any;
57
+ context?: any;
58
+ };
59
+ onClick: {
60
+ [x: string]: any;
61
+ $$resolver: symbol;
62
+ $$unresolved?: Record<string | number, import("@orioro/resolve").ResolutionNode> | undefined;
63
+ dependencies: any;
64
+ value: (...args: any[]) => any;
65
+ defaultValue?: any;
66
+ context?: any;
67
+ };
68
+ tooltip: {
69
+ title: (string | {
70
+ [x: string]: any;
71
+ $$resolver: symbol;
72
+ $$unresolved?: Record<string | number, import("@orioro/resolve").ResolutionNode> | undefined;
73
+ dependencies: any;
74
+ value: (...args: any[]) => any;
75
+ defaultValue?: any;
76
+ context?: any;
77
+ })[];
78
+ entries: (string | {
79
+ [x: string]: any;
80
+ $$resolver: symbol;
81
+ $$unresolved?: Record<string | number, import("@orioro/resolve").ResolutionNode> | undefined;
82
+ dependencies: any;
83
+ value: (...args: any[]) => any;
84
+ defaultValue?: any;
85
+ context?: any;
86
+ })[];
87
+ };
88
+ zIndex: number;
89
+ source: string;
90
+ 'source-layer': any;
91
+ type: string;
92
+ };
93
+ isocrona_origem_polygons: {
94
+ [x: string]: any;
95
+ $$resolver: symbol;
96
+ $$unresolved?: Record<string | number, import("@orioro/resolve").ResolutionNode> | undefined;
97
+ dependencies: any;
98
+ value: (...args: any[]) => any;
99
+ defaultValue?: any;
100
+ context?: any;
101
+ };
102
+ };
103
+ };
@@ -1,4 +1,6 @@
1
- export function download(context: any): {
1
+ export function download(context: any, { PARSED_SCHEMA }: {
2
+ PARSED_SCHEMA: any;
3
+ }): {
2
4
  [x: string]: any;
3
5
  $$resolver: symbol;
4
6
  $$unresolved?: Record<string | number, import("@orioro/resolve").ResolutionNode> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redus/georedus-ui",
3
- "version": "0.19.1",
3
+ "version": "0.19.3",
4
4
  "packageManager": "yarn@4.0.2",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
@@ -31,7 +31,7 @@
31
31
  "react-map-gl": "^8.0.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@orioro/dev": "^0.0.5",
34
+ "@orioro/dev": "^0.0.6",
35
35
  "@orioro/react-versioned-state": "^0.0.2",
36
36
  "@radix-ui/themes": "^3.0.1",
37
37
  "@types/geojson": "^7946.0.16",
@@ -49,21 +49,21 @@
49
49
  "@mapbox/tilebelt": "2.0.0",
50
50
  "@mdi/js": "^7.4.47",
51
51
  "@mdi/react": "^1.6.1",
52
- "@orioro/cast": "^0.0.11",
53
- "@orioro/get": "^0.0.2",
54
- "@orioro/react-chart-util": "^0.3.0",
55
- "@orioro/react-csv": "^0.0.11",
56
- "@orioro/react-dialogs": "^0.0.10",
57
- "@orioro/react-dir-nav": "^0.2.0",
58
- "@orioro/react-maplibre-util": "^0.7.0",
59
- "@orioro/react-sortable": "^0.0.10",
60
- "@orioro/react-ui-core": "^0.0.14",
61
- "@orioro/resolve": "^0.1.9",
62
- "@orioro/scale-util": "^0.0.9",
63
- "@orioro/tree-model": "^0.0.2",
64
- "@orioro/util": "^0.14.0",
65
- "@orioro/validate": "^0.0.2",
66
- "@orioro/vector-tile-util": "^0.3.0",
52
+ "@orioro/cast": "^0.0.12",
53
+ "@orioro/get": "^0.0.12",
54
+ "@orioro/react-chart-util": "^0.3.1",
55
+ "@orioro/react-csv": "^0.0.17",
56
+ "@orioro/react-dialogs": "^0.1.5",
57
+ "@orioro/react-dir-nav": "^0.2.1",
58
+ "@orioro/react-maplibre-util": "^0.7.1",
59
+ "@orioro/react-sortable": "^0.0.16",
60
+ "@orioro/react-ui-core": "^0.0.20",
61
+ "@orioro/resolve": "^0.1.12",
62
+ "@orioro/scale-util": "^0.0.12",
63
+ "@orioro/tree-model": "^0.0.10",
64
+ "@orioro/util": "^0.16.0",
65
+ "@orioro/validate": "^0.0.10",
66
+ "@orioro/vector-tile-util": "^0.3.1",
67
67
  "@radix-ui/react-collapsible": "^1.1.3",
68
68
  "@tanstack/react-query": "^5.18.0",
69
69
  "@turf/turf": "^7.1.0",