@kepler.gl/reducers 3.3.0-alpha.27 → 3.3.0-alpha.28

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.
@@ -37,7 +37,7 @@ import { DELAY_TASK, ACTION_TASK, EXPAND_ZIP_TASK, LOAD_FILE_TASK, PROCESS_FILE_
37
37
  import { addNotification, applyLayerConfig, createNewDatasetSuccess, layerConfigChange, layerTypeChange, layerVisConfigChange, layerVisualChannelConfigChange, loadFileStepSuccess, loadFilesErr, loadFilesSuccess, loadNextFile, expandZipArchiveSuccess, nextFileBatch, setFilter, processFileContent, fitBounds as fitMapBounds, toggleLayerForMap, applyFilterConfig, loadColumnStatsSuccess, loadColumnStatsError, refreshDatasetSuccess, refreshDatasetError, refreshDatasetProgress, setLoadingProgress } from '@kepler.gl/actions';
38
38
 
39
39
  // Utils
40
- import { FILTER_UPDATER_PROPS, normalizeCameraBookmarks, normalizeCameraTour, addNewLayersToSplitMap, snapToMarks, applyFilterFieldName, applyTimeFilterEndFieldName, applyFiltersToDatasets, arrayInsert, combineSplitMapsByIndex, colorMaybeToRGB, computeSplitMapLayers, adjustValueToFilterDomain, areFilterFieldTypesCompatible, disableGpuIfInverted, filterTypeUsesGpu, getPlotBaseIndexByDataId, errorNotification, successNotification, editorFeaturesToFeatureCollection, extractRowsInsideFeature, isRasterTileExtractLayer, isVectorTileExtractLayer, mergeUserFeatureProperties, toSketchFeature, featureToFilterValue, filterDatasetCPU, generatePolygonFilter, getDefaultFilter, getFilterIdInFeature, getTimeWidgetTitleFormatter, isInRange, isObject, isPlainObject, isRgbColor, parseFieldValue, removeLayerFromSplitMaps, set, updateFilterPlot, removeFilterPlot, isLayerAnimatable, isSideFilter, getApplicationConfig, validateFiltersUpdateDatasets, normalizeLayerPropertyTransitions } from '@kepler.gl/utils';
40
+ import { FILTER_UPDATER_PROPS, normalizeCameraBookmarks, normalizeAnnotationCaption, normalizeCameraTour, addNewLayersToSplitMap, snapToMarks, applyFilterFieldName, applyTimeFilterEndFieldName, applyFiltersToDatasets, arrayInsert, combineSplitMapsByIndex, colorMaybeToRGB, computeSplitMapLayers, adjustValueToFilterDomain, areFilterFieldTypesCompatible, disableGpuIfInverted, filterTypeUsesGpu, getPlotBaseIndexByDataId, errorNotification, successNotification, editorFeaturesToFeatureCollection, extractRowsInsideFeature, isRasterTileExtractLayer, isVectorTileExtractLayer, mergeUserFeatureProperties, toSketchFeature, featureToFilterValue, filterDatasetCPU, generatePolygonFilter, getDefaultFilter, getFilterIdInFeature, getTimeWidgetTitleFormatter, isInRange, isObject, isPlainObject, isRgbColor, parseFieldValue, removeLayerFromSplitMaps, set, updateFilterPlot, removeFilterPlot, isLayerAnimatable, isSideFilter, getApplicationConfig, validateFiltersUpdateDatasets, normalizeLayerPropertyTransitions } from '@kepler.gl/utils';
41
41
  import { generateHashId, toArray, arrayMove } from '@kepler.gl/common-utils';
42
42
  // Mergers
43
43
  import { ALL_FIELD_TYPES, ANIMATION_WINDOW, BASE_SPEED, COMPARE_TYPES, DEFAULT_TEXT_LABEL, EDITOR_MODES, FILTER_TYPES, FILTER_VIEW_TYPES, LAYER_TYPES, FPS, LIGHT_AND_SHADOW_EFFECT, DISTANCE_FOG_TYPE, SURFACE_FOG_TYPE, MAX_DEFAULT_TOOLTIPS, PLOT_TYPES, SORT_ORDER, SYNC_TIMELINE_MODES, CHANNEL_SCALES, SCALE_TYPES, INITIAL_ANNOTATION_KIND, INITIAL_ANNOTATION_ANGLE, INITIAL_ANNOTATION_ARM_LENGTH, INITIAL_ANNOTATION_TEXT_WIDTH, INITIAL_ANNOTATION_TEXT_HEIGHT, INITIAL_ANNOTATION_LINE_WIDTH, INITIAL_ANNOTATION_LINE_COLOR, INITIAL_ANNOTATION_RULER_LENGTH_METERS, INITIAL_ANNOTATION_TEXT_SIDE, INITIAL_ANNOTATION_TEXT_VERTICAL_POSITION, ANNOTATION_ANGLE_BY_PLACEMENT, textPlacementFromAngle, AnnotationKind, DatasetType, getDatasetRefreshIntervalMs, getRemoteSourceFormat, GEOCODER_DATASET_NAME, GEOCODER_ICON_COLOR, GEOCODER_LAYER_ID } from '@kepler.gl/constants';
@@ -2600,9 +2600,12 @@ function makeNewAnnotation(config) {
2600
2600
  var derivedFromAngle = providedAngle != null ? textPlacementFromAngle(providedAngle) : undefined;
2601
2601
  var textSide = (_ref19 = (_config$textSide = config === null || config === void 0 ? void 0 : config.textSide) !== null && _config$textSide !== void 0 ? _config$textSide : derivedFromAngle === null || derivedFromAngle === void 0 ? void 0 : derivedFromAngle.side) !== null && _ref19 !== void 0 ? _ref19 : kind === AnnotationKind.TEXT || kind === AnnotationKind.RULER ? undefined : INITIAL_ANNOTATION_TEXT_SIDE;
2602
2602
  var textVerticalPosition = (_ref20 = (_config$textVerticalP = config === null || config === void 0 ? void 0 : config.textVerticalPosition) !== null && _config$textVerticalP !== void 0 ? _config$textVerticalP : derivedFromAngle === null || derivedFromAngle === void 0 ? void 0 : derivedFromAngle.vertical) !== null && _ref20 !== void 0 ? _ref20 : kind === AnnotationKind.TEXT || kind === AnnotationKind.RULER ? undefined : INITIAL_ANNOTATION_TEXT_VERTICAL_POSITION;
2603
- var base = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
2603
+ var base = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
2604
2604
  id: (_config$id = config === null || config === void 0 ? void 0 : config.id) !== null && _config$id !== void 0 ? _config$id : generateHashId(6),
2605
- kind: kind,
2605
+ kind: kind
2606
+ }, normalizeAnnotationCaption(_objectSpread(_objectSpread({}, config), {}, {
2607
+ kind: kind
2608
+ }))), {}, {
2606
2609
  isVisible: (_config$isVisible = config === null || config === void 0 ? void 0 : config.isVisible) !== null && _config$isVisible !== void 0 ? _config$isVisible : true
2607
2610
  }, propertyTransitions !== undefined ? {
2608
2611
  propertyTransitions: propertyTransitions
@@ -2726,6 +2729,10 @@ export var updateAnnotationUpdater = function updateAnnotationUpdater(state, _re
2726
2729
  var propertyTransitions = normalizeLayerPropertyTransitions(config.propertyTransitions);
2727
2730
  if (propertyTransitions === undefined) delete nextAnnotation.propertyTransitions;else nextAnnotation.propertyTransitions = propertyTransitions;
2728
2731
  }
2732
+ var caption = normalizeAnnotationCaption(nextAnnotation);
2733
+ delete nextAnnotation.viewport;
2734
+ delete nextAnnotation.readout;
2735
+ Object.assign(nextAnnotation, caption);
2729
2736
  var newAnnotations = _toConsumableArray(state.annotations);
2730
2737
  newAnnotations[idx] = nextAnnotation;
2731
2738
  return _objectSpread(_objectSpread({}, state), {}, {