@carto/kepler.gl 0.0.37 → 0.0.40-alpha.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.
Files changed (40) hide show
  1. package/dist/components/index.js +17 -1
  2. package/dist/components/map-container.js +17 -3
  3. package/dist/components/side-panel/layer-panel/layer-configurator.js +9 -4
  4. package/dist/components/side-panel/layer-panel/layer-visibility-by-zoom.js +102 -0
  5. package/dist/constants/default-settings.js +8 -3
  6. package/dist/layers/base-layer.js +19 -6
  7. package/dist/layers/layer-factory.js +12 -1
  8. package/dist/localization/ca.js +4 -1
  9. package/dist/localization/cn.js +4 -1
  10. package/dist/localization/en.js +4 -1
  11. package/dist/localization/es.js +4 -1
  12. package/dist/localization/fi.js +4 -1
  13. package/dist/localization/ja.js +4 -1
  14. package/dist/localization/pt.js +4 -1
  15. package/dist/localization/ru.js +4 -1
  16. package/dist/reducers/vis-state-merger.js +4 -3
  17. package/dist/reducers/vis-state-updaters.js +29 -29
  18. package/dist/schemas/vis-state-schema.js +5 -1
  19. package/package.json +1 -1
  20. package/src/components/index.js +3 -1
  21. package/src/components/map-container.js +15 -1
  22. package/src/components/side-panel/layer-panel/layer-configurator.js +7 -3
  23. package/src/components/side-panel/layer-panel/layer-visibility-by-zoom.js +99 -0
  24. package/src/constants/default-settings.js +5 -0
  25. package/src/layers/base-layer.js +16 -4
  26. package/src/layers/index.d.ts +1 -0
  27. package/src/layers/layer-factory.js +9 -0
  28. package/src/localization/ca.js +3 -0
  29. package/src/localization/cn.js +3 -0
  30. package/src/localization/en.js +3 -0
  31. package/src/localization/es.js +3 -0
  32. package/src/localization/fi.js +3 -0
  33. package/src/localization/ja.js +3 -0
  34. package/src/localization/pt.js +3 -0
  35. package/src/localization/ru.js +3 -0
  36. package/src/reducers/vis-state-merger.js +5 -4
  37. package/src/reducers/vis-state-updaters.js +3 -1
  38. package/src/schemas/schema-manager.d.ts +1 -0
  39. package/src/schemas/vis-state-schema.js +2 -0
  40. package/umd/keplergl.min.js +31 -31
@@ -162,6 +162,9 @@ export default {
162
162
  heightRange: '高さの範囲',
163
163
  heightMultiplier: '高さ乗数'
164
164
  },
165
+ layerVisibility: {
166
+ title: 'ズームレベルによる視認性'
167
+ },
165
168
  layerManager: {
166
169
  addData: 'データ追加',
167
170
  addLayer: 'レイヤ追加',
@@ -162,6 +162,9 @@ export default {
162
162
  heightRange: 'Alcance da Altura',
163
163
  heightMultiplier: 'Multiplicador de altura'
164
164
  },
165
+ layerVisibility: {
166
+ title: 'Visibilidade por nível de zoom'
167
+ },
165
168
  layerManager: {
166
169
  addData: 'Adicionar Dados',
167
170
  addLayer: 'Adicionar Camada',
@@ -164,6 +164,9 @@ export default {
164
164
  heightRange: 'Диапазон высоты',
165
165
  heightMultiplier: 'Множитель высоты'
166
166
  },
167
+ layerVisibility: {
168
+ title: 'Видимость по уровню масштабирования'
169
+ },
167
170
  layerManager: {
168
171
  addData: 'Добавить данные',
169
172
  addLayer: 'Добавить слой',
@@ -291,9 +291,9 @@ export function mergeInteractionTooltipConfig(state, tooltipConfig = {}) {
291
291
  } else {
292
292
  // if dataset is loaded
293
293
  const allFields = state.datasets[dataId].fields.map(d => d.name);
294
- const foundFieldsToShow = tooltipConfig.fieldsToShow[dataId].filter(field =>
295
- allFields.includes(field.name)
296
- );
294
+ const foundFieldsToShow = state.datasets[dataId].metadata.isDynamicSpatialIndex
295
+ ? tooltipConfig.fieldsToShow[dataId]
296
+ : tooltipConfig.fieldsToShow[dataId].filter(field => allFields.includes(field.name));
297
297
 
298
298
  mergedTooltip[dataId] = foundFieldsToShow;
299
299
  }
@@ -491,7 +491,8 @@ export function validateLayerWithData(
491
491
  color: savedLayer.config.color,
492
492
  isVisible: savedLayer.config.isVisible,
493
493
  hidden: savedLayer.config.hidden,
494
- highlightColor: savedLayer.config.highlightColor
494
+ highlightColor: savedLayer.config.highlightColor,
495
+ visibilityByZoom: savedLayer.config.visibilityByZoom
495
496
  });
496
497
 
497
498
  // find column fieldIdx
@@ -1715,7 +1715,9 @@ export function addDefaultLayers(state, datasets) {
1715
1715
  * @returns {Object} nextState
1716
1716
  */
1717
1717
  export function addDefaultTooltips(state, dataset) {
1718
- const tooltipFields = findFieldsToShow(dataset);
1718
+ const tooltipFields = dataset.metadata.isDynamicSpatialIndex
1719
+ ? {[dataset.id]: []}
1720
+ : findFieldsToShow(dataset);
1719
1721
  const merged = {
1720
1722
  ...state.interactionConfig.tooltip.config.fieldsToShow,
1721
1723
  ...tooltipFields
@@ -70,6 +70,7 @@ export type SavedLayer = {
70
70
  isVisible: boolean;
71
71
  visConfig: object;
72
72
  hidden: boolean;
73
+ visibilityByZoom: {min: number; max: number};
73
74
  textLabel: Merge<LayerTextLabel, {field: {name: string; type: string} | null}>;
74
75
  };
75
76
  visualChannels: SavedVisualChannels;
@@ -235,6 +235,7 @@ export const layerPropsV0 = {
235
235
  color: new LayerConfigSchemaV0({key: 'color'}),
236
236
  isVisible: new LayerConfigSchemaV0({key: 'isVisible'}),
237
237
  hidden: new LayerConfigSchemaV0({key: 'hidden'}),
238
+ visibilityByZoom: new LayerConfigSchemaV0({key: 'visibilityByZoom'}),
238
239
 
239
240
  // convert visConfig
240
241
  visConfig: new LayerVisConfigSchemaV0({key: 'visConfig'}),
@@ -451,6 +452,7 @@ export const layerPropsV1 = {
451
452
  version: VERSIONS.v1
452
453
  }),
453
454
  hidden: null,
455
+ visibilityByZoom: null,
454
456
  textLabel: new TextLabelSchemaV1({
455
457
  version: VERSIONS.v1,
456
458
  key: 'textLabel'