@opengeoweb/core 4.22.1 → 5.0.1
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/index.js +1057 -1074
- package/package.json +6 -6
- package/src/lib/components/ComponentsLookUp/componentsLookUp.d.ts +4 -4
- package/src/lib/components/ConfigurableMap/ConfigurableMapConnect.d.ts +6 -6
- package/src/lib/components/FeatureInfo/GetFeatureInfoButtonConnect.d.ts +2 -2
- package/src/lib/components/FeatureInfo/GetFeatureInfoDialog.d.ts +4 -5
- package/src/lib/components/FeatureInfo/utils.d.ts +2 -2
- package/src/lib/components/LayerManager/AddLayersButton/AddLayersButton.d.ts +2 -2
- package/src/lib/components/LayerManager/AddLayersPopup/AddLayersPopup.d.ts +2 -2
- package/src/lib/components/LayerManager/BaseLayerRow/BaseLayerRow.d.ts +2 -2
- package/src/lib/components/LayerManager/BaseLayerRow/BaseLayers/BaseLayers.d.ts +3 -3
- package/src/lib/components/LayerManager/BaseLayerRow/BaseLayers/BaseLayersConnect.d.ts +6 -6
- package/src/lib/components/LayerManager/DescriptionRow/DescriptionRow.d.ts +2 -2
- package/src/lib/components/LayerManager/DockedLayerManagerConnect.d.ts +3 -4
- package/src/lib/components/LayerManager/LayerContainerRow/LayerRow/DimensionSelect/DimensionSelect.d.ts +3 -3
- package/src/lib/components/LayerManager/LayerContainerRow/LayerRow/LayerRow.d.ts +5 -4
- package/src/lib/components/LayerManager/LayerContainerRow/LayerRow/RenderLayers/RenderLayers.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerManager.d.ts +4 -4
- package/src/lib/components/LayerManager/LayerManagerConnect.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerManagerMapButtonConnect.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerManagerUtils.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerSelect/KeywordFilterButton/KeywordFilterButtonConnect.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResults.d.ts +3 -4
- package/src/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsListItem.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsListItemConnect.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerSelect/LayerInfo/LayerInfoButtonConnect.d.ts +3 -4
- package/src/lib/components/LayerManager/LayerSelect/LayerInfo/LayerInfoDialog.d.ts +3 -4
- package/src/lib/components/LayerManager/LayerSelect/LayerInfo/LayerInfoLegend.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerSelect/LayerInfo/LayerInfoUtils.d.ts +6 -7
- package/src/lib/components/LayerManager/LayerSelect/LayerList/LayerAddRemoveButton.d.ts +3 -3
- package/src/lib/components/LayerManager/LayerSelect/LayerList/LayerList.d.ts +4 -6
- package/src/lib/components/LayerManager/LayerSelect/LayerList/LayerListRow.d.ts +4 -4
- package/src/lib/components/LayerManager/LayerSelect/LayerSelect.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerSelect/LayerSelectButtonConnect.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerSelect/LayerSelectUtils.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerSelect/ServiceList/ServiceChip.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerSelect/ServiceList/ServiceChipConnect.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerSelect/ServiceList/ServiceList.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerSelect/ServiceOptionsDialog/ServiceOptionsDialog.d.ts +4 -5
- package/src/lib/components/LayerManager/LayerSelect/ServicePopup/ServicePopup.d.ts +4 -5
- package/src/lib/components/LayerManager/LayerSelect/ServicePopup/ServicePopupDialogConnect.d.ts +2 -2
- package/src/lib/components/LayerManager/LayerSelect/ServicePopup/utils.d.ts +4 -5
- package/src/lib/components/LayerManager/useFetchServices.d.ts +2 -2
- package/src/lib/components/Legend/Legend.d.ts +2 -2
- package/src/lib/components/Legend/LegendConnect.d.ts +3 -3
- package/src/lib/components/Legend/LegendDialog.d.ts +3 -4
- package/src/lib/components/Legend/LegendLayout.d.ts +2 -2
- package/src/lib/components/Legend/LegendMapButtonConnect.d.ts +2 -2
- package/src/lib/components/MapDraw/MapDrawTool.stories.d.ts +1 -0
- package/src/lib/components/MapDraw/mapDrawUtils.d.ts +34 -0
- package/src/lib/components/MapDraw/storyComponents/EditModeButton.d.ts +8 -0
- package/src/lib/components/MapDraw/storyComponents/FeatureLayers.d.ts +8 -0
- package/src/lib/components/MapDraw/storyComponents/GeoJSONTextField.d.ts +8 -0
- package/src/lib/components/MapDraw/storyComponents/StoryLayout.d.ts +10 -0
- package/src/lib/components/MapDraw/useMapDrawTool.d.ts +35 -6
- package/src/lib/components/MapTime/MapTime.d.ts +3 -3
- package/src/lib/components/MapView/MapViewConnect.LayerChangeEnabledOpacity.stories.d.ts +2 -3
- package/src/lib/components/MapView/MapViewLayer.d.ts +1 -1
- package/src/lib/components/MultiMapDimensionSelect/DimensionSelectButtonConnect.d.ts +2 -2
- package/src/lib/components/MultiMapDimensionSelect/DimensionSelectDialogConnect.d.ts +2 -2
- package/src/lib/components/MultiMapDimensionSelect/MultiDimensionSelectMapButtonsConnect.d.ts +2 -2
- package/src/lib/components/MultiMapView/HarmoniePresets/HarmonieTempAndPrecipPreset.d.ts +3 -3
- package/src/lib/components/MultiMapView/ModelRunInterval/ModelRunInterval.d.ts +3 -3
- package/src/lib/components/MultiMapView/MultiMapViewConnect.d.ts +4 -4
- package/src/lib/components/ReactMapView/ReactMapViewParseLayer.d.ts +2 -2
- package/src/lib/components/ReactMapView/types.d.ts +9 -9
- package/src/lib/components/ReactMapView/utils.d.ts +5 -5
- package/src/lib/components/SyncGroups/SyncGroupViewer.d.ts +5 -5
- package/src/lib/components/SyncGroups/utils.d.ts +2 -2
- package/src/lib/components/TimeSlider/TimeSliderButtons/AnimationLengthButton/AnimationLengthButton.d.ts +2 -2
- package/src/lib/components/TimeSlider/TimeSliderButtons/OptionsMenuButton/OptionsMenu.d.ts +1 -1
- package/src/lib/components/TimeSlider/TimeSliderButtons/OptionsMenuButton/OptionsMenuButton.d.ts +1 -1
- package/src/lib/components/TimeSlider/TimeSliderButtons/TimeSpanButton/TimeSpanButton.d.ts +10 -3
- package/src/lib/components/TimeSlider/TimeSliderButtons/TimeSpanButton/TimeSpanButtonConnect.d.ts +5 -0
- package/src/lib/components/TimeSlider/TimeSliderButtons/TimeStepButton/TimeStepButton.d.ts +2 -2
- package/src/lib/components/TimeSlider/TimeSliderCurrentTimeBox/TimeSliderCurrentTimeBox.d.ts +2 -2
- package/src/lib/components/TimeSlider/TimeSliderCurrentTimeBox/TimeSliderCurrentTimeBoxConnect.d.ts +9 -10
- package/src/lib/components/TimeSlider/TimeSliderCurrentTimeBox/TimeSliderCurrentTimeBoxRenderFunctions.d.ts +2 -2
- package/src/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegend.d.ts +4 -3
- package/src/lib/components/TimeSlider/TimeSliderLegend/drawFunctions/drawBackground.d.ts +3 -3
- package/src/lib/components/TimeSlider/TimeSliderLegend/drawFunctions/drawTimeScale.d.ts +3 -3
- package/src/lib/components/TimeSlider/TimeSliderLegend/drawFunctions/drawTimeSliderLegend.d.ts +2 -2
- package/src/lib/components/TimeSlider/constants.d.ts +3 -0
- package/src/lib/components/TimeSlider/timeSliderUtils.d.ts +14 -48
- package/src/lib/components/TimeSliderLite/timeSliderLiteUtils.d.ts +4 -4
- package/src/lib/components/WMSLoader/WMSLayerTree/WMSLayerTree.d.ts +2 -2
- package/src/lib/components/WMSLoader/WMSLayerTree/WMSLayerTreeConnect.d.ts +8 -9
- package/src/lib/components/WMSLoader/WMSLoaderConnect.d.ts +2 -2
- package/src/lib/components/WMSLoader/services.d.ts +2 -2
- package/src/lib/hooks/useSetupDialog/useSetupDialog.d.ts +2 -3
- package/src/lib/index.d.ts +8 -8
- package/src/lib/store/coreModuleConfig.d.ts +1 -1
- package/src/lib/store/generic/index.d.ts +2 -2
- package/src/lib/store/generic/selectors.d.ts +1 -1
- package/src/lib/store/generic/synchronizationGroups/index.d.ts +4 -4
- package/src/lib/store/generic/synchronizationGroups/selectors.d.ts +4 -4
- package/src/lib/store/generic/synchronizationGroups/types.d.ts +2 -2
- package/src/lib/store/generic/types.d.ts +2 -1
- package/src/lib/store/layerSelect/index.d.ts +1 -0
- package/src/lib/store/layerSelect/reducer.d.ts +2 -2
- package/src/lib/store/layerSelect/selectors.d.ts +1 -1
- package/src/lib/store/layerSelect/types.d.ts +1 -1
- package/src/lib/store/layerSelect/utils.d.ts +2 -0
- package/src/lib/store/mapStore/index.d.ts +2 -0
- package/src/lib/store/mapStore/layers/index.d.ts +1 -0
- package/src/lib/store/mapStore/layers/reducer.d.ts +1 -1
- package/src/lib/store/mapStore/layers/selectors.d.ts +2 -2
- package/src/lib/store/mapStore/layers/types.d.ts +1 -0
- package/src/lib/store/mapStore/map/constants.d.ts +4 -0
- package/src/lib/store/mapStore/map/enums.d.ts +37 -0
- package/src/lib/store/mapStore/map/index.d.ts +5 -0
- package/src/lib/store/mapStore/map/reducer.d.ts +5 -5
- package/src/lib/store/mapStore/map/selectors.d.ts +77 -76
- package/src/lib/store/mapStore/map/types.d.ts +9 -26
- package/src/lib/store/mapStore/map/utils.d.ts +35 -6
- package/src/lib/store/mapStore/service/index.d.ts +1 -0
- package/src/lib/store/mapStore/utils/helpers.d.ts +1 -1
- package/src/lib/store/mapStore/utils/index.d.ts +1 -0
- package/src/lib/store/snackbar/index.d.ts +1 -0
- package/src/lib/store/ui/index.d.ts +1 -0
- package/src/lib/store/ui/selectors.d.ts +2 -2
- package/src/lib/store/ui/types.d.ts +1 -1
- package/src/lib/storybookUtils/HelperComponents.d.ts +2 -2
- package/src/lib/storybookUtils/defaultStorySettings.d.ts +5 -5
- package/src/lib/types/types.d.ts +4 -5
- package/src/lib/utils/__mocks__/getCapabilities.d.ts +2 -2
- package/src/lib/utils/defaultTestSettings.d.ts +11 -12
- package/src/lib/utils/jsonPresetFilter.d.ts +8 -8
- package/src/lib/utils/publicLayers.d.ts +44 -44
- package/src/lib/utils/testLayers.d.ts +10 -10
- package/src/lib/utils/testUtils.d.ts +9 -9
- package/src/lib/components/LayerManager/LayerSelect/LayerList/LayerListUtils.d.ts +0 -2
- package/src/lib/components/TimeSlider/TimeSliderButtons/TimeScaleButton/TimeScaleButton.d.ts +0 -12
- package/src/lib/components/TimeSlider/TimeSliderButtons/TimeScaleButton/TimeScaleButton.spec.d.ts +0 -1
- package/src/lib/components/TimeSlider/TimeSliderButtons/TimeScaleButton/TimeScaleButtonConnect.d.ts +0 -5
- package/src/lib/components/TimeSlider/TimeSliderButtons/TimeScaleButton/TimeScaleButtonConnect.spec.d.ts +0 -1
- /package/src/lib/components/{LayerManager/LayerSelect/LayerList/LayerListUtils.spec.d.ts → TimeSlider/TimeSliderButtons/TimeSpanButton/TimeSpanButtonConnect.spec.d.ts} +0 -0
package/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import produce, { enableES5, isDraftable, isDraft, current, produce as produce$1 } from 'immer';
|
|
2
2
|
import { createSelector } from 'reselect';
|
|
3
|
-
import _, { isEqual as isEqual$1,
|
|
3
|
+
import _, { isEqual as isEqual$1, compact, debounce, groupBy, throttle as throttle$2, range } from 'lodash';
|
|
4
4
|
import moment from 'moment';
|
|
5
|
+
import { takeLatest, put, select, call, takeEvery, all, delay } from 'redux-saga/effects';
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import React__default, { Component, useRef, useState as useState$1, useEffect as useEffect$1, useCallback, createElement, PureComponent, forwardRef, useContext, createContext, Fragment, cloneElement, isValidElement, createRef, useLayoutEffect as useLayoutEffect$1 } from 'react';
|
|
7
|
-
import { takeLatest, put, select, call, takeEvery, all, delay } from 'redux-saga/effects';
|
|
8
8
|
import { useDispatch, useSelector, connect, Provider } from 'react-redux';
|
|
9
9
|
import { Paper, Box as Box$2, Typography, Grid, MenuItem, useTheme as useTheme$2, Button, Popper, ListItemText, ListItemIcon, FormControl, InputLabel, List, ListItemButton, CircularProgress, ListSubheader, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, InputAdornment, DialogActions, LinearProgress, Backdrop, ListItem, ListItemSecondaryAction, Checkbox, Switch, styled as styled$1, Slider, Menu, Tooltip, IconButton, ButtonGroup, Divider, Snackbar } from '@mui/material';
|
|
10
10
|
import { CustomTooltip, ToolContainerDraggable, CustomIconButton, TooltipSelect, AlertIcon, useControlledTooltip, tooltipContainerStyles, sliderHeaderStyle, CustomSlider, ToggleMenu, CustomAccordion, AlertBanner, calculateDialogSizeAndPosition, CustomToggleButton, SearchHighlight, useMakeSureContainerStaysInsideWindow, withEggs } from '@opengeoweb/shared';
|
|
@@ -231,7 +231,7 @@ function isPlainObject$2(value) {
|
|
|
231
231
|
return EnhancerArray;
|
|
232
232
|
})(Array));
|
|
233
233
|
function freezeDraftable(val) {
|
|
234
|
-
return isDraftable(val) ?
|
|
234
|
+
return isDraftable(val) ? produce(val, function () {
|
|
235
235
|
}) : val;
|
|
236
236
|
}
|
|
237
237
|
// src/immutableStateInvariantMiddleware.ts
|
|
@@ -374,7 +374,7 @@ function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defau
|
|
|
374
374
|
return result;
|
|
375
375
|
}
|
|
376
376
|
else {
|
|
377
|
-
return
|
|
377
|
+
return produce(previousState, function (draft) {
|
|
378
378
|
return caseReducer(draft, action);
|
|
379
379
|
});
|
|
380
380
|
}
|
|
@@ -530,7 +530,7 @@ function createStateOperator(mutator) {
|
|
|
530
530
|
return state;
|
|
531
531
|
}
|
|
532
532
|
else {
|
|
533
|
-
return
|
|
533
|
+
return produce(state, runMutator);
|
|
534
534
|
}
|
|
535
535
|
};
|
|
536
536
|
}
|
|
@@ -1218,6 +1218,34 @@ var selectors$5 = /*#__PURE__*/Object.freeze({
|
|
|
1218
1218
|
getLayerStyles: getLayerStyles$1
|
|
1219
1219
|
});
|
|
1220
1220
|
|
|
1221
|
+
/* *
|
|
1222
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1223
|
+
* you may not use this file except in compliance with the License.
|
|
1224
|
+
* You may obtain a copy of the License at
|
|
1225
|
+
*
|
|
1226
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1227
|
+
*
|
|
1228
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1229
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1230
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1231
|
+
* See the License for the specific language governing permissions and
|
|
1232
|
+
* limitations under the License.
|
|
1233
|
+
*
|
|
1234
|
+
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1235
|
+
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
1236
|
+
* */
|
|
1237
|
+
var AnimationLength$1;
|
|
1238
|
+
(function (AnimationLength) {
|
|
1239
|
+
AnimationLength[AnimationLength["Minutes15"] = 15] = "Minutes15";
|
|
1240
|
+
AnimationLength[AnimationLength["Minutes30"] = 30] = "Minutes30";
|
|
1241
|
+
AnimationLength[AnimationLength["Hours1"] = 60] = "Hours1";
|
|
1242
|
+
AnimationLength[AnimationLength["Hours2"] = 120] = "Hours2";
|
|
1243
|
+
AnimationLength[AnimationLength["Hours3"] = 180] = "Hours3";
|
|
1244
|
+
AnimationLength[AnimationLength["Hours6"] = 360] = "Hours6";
|
|
1245
|
+
AnimationLength[AnimationLength["Hours12"] = 720] = "Hours12";
|
|
1246
|
+
AnimationLength[AnimationLength["Hours24"] = 1440] = "Hours24";
|
|
1247
|
+
})(AnimationLength$1 || (AnimationLength$1 = {}));
|
|
1248
|
+
|
|
1221
1249
|
function _iterableToArrayLimit(arr, i) {
|
|
1222
1250
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1223
1251
|
if (null != _i) {
|
|
@@ -1957,54 +1985,6 @@ var getLastTimeStepForLayerId = function getLastTimeStepForLayerId(layerId) {
|
|
|
1957
1985
|
return wmjsTimeDim.getLastValue();
|
|
1958
1986
|
};
|
|
1959
1987
|
|
|
1960
|
-
/* *
|
|
1961
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1962
|
-
* you may not use this file except in compliance with the License.
|
|
1963
|
-
* You may obtain a copy of the License at
|
|
1964
|
-
*
|
|
1965
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1966
|
-
*
|
|
1967
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1968
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1969
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1970
|
-
* See the License for the specific language governing permissions and
|
|
1971
|
-
* limitations under the License.
|
|
1972
|
-
*
|
|
1973
|
-
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1974
|
-
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
1975
|
-
* */
|
|
1976
|
-
var Scale;
|
|
1977
|
-
(function (Scale) {
|
|
1978
|
-
Scale[Scale["Minutes5"] = 0] = "Minutes5";
|
|
1979
|
-
Scale[Scale["Hour"] = 1] = "Hour";
|
|
1980
|
-
Scale[Scale["Hours3"] = 2] = "Hours3";
|
|
1981
|
-
Scale[Scale["Hours6"] = 3] = "Hours6";
|
|
1982
|
-
Scale[Scale["Hours12"] = 4] = "Hours12";
|
|
1983
|
-
Scale[Scale["Day"] = 5] = "Day";
|
|
1984
|
-
Scale[Scale["Days2"] = 6] = "Days2";
|
|
1985
|
-
Scale[Scale["Week"] = 7] = "Week";
|
|
1986
|
-
Scale[Scale["Weeks2"] = 8] = "Weeks2";
|
|
1987
|
-
Scale[Scale["Month"] = 9] = "Month";
|
|
1988
|
-
Scale[Scale["Months3"] = 10] = "Months3";
|
|
1989
|
-
Scale[Scale["Year"] = 11] = "Year";
|
|
1990
|
-
Scale[Scale["DataScale"] = 12] = "DataScale";
|
|
1991
|
-
})(Scale || (Scale = {}));
|
|
1992
|
-
var AnimationLength;
|
|
1993
|
-
(function (AnimationLength) {
|
|
1994
|
-
AnimationLength[AnimationLength["Minutes15"] = 15] = "Minutes15";
|
|
1995
|
-
AnimationLength[AnimationLength["Minutes30"] = 30] = "Minutes30";
|
|
1996
|
-
AnimationLength[AnimationLength["Hours1"] = 60] = "Hours1";
|
|
1997
|
-
AnimationLength[AnimationLength["Hours2"] = 120] = "Hours2";
|
|
1998
|
-
AnimationLength[AnimationLength["Hours3"] = 180] = "Hours3";
|
|
1999
|
-
AnimationLength[AnimationLength["Hours6"] = 360] = "Hours6";
|
|
2000
|
-
AnimationLength[AnimationLength["Hours12"] = 720] = "Hours12";
|
|
2001
|
-
AnimationLength[AnimationLength["Hours24"] = 1440] = "Hours24";
|
|
2002
|
-
})(AnimationLength || (AnimationLength = {}));
|
|
2003
|
-
var MapActionOrigin;
|
|
2004
|
-
(function (MapActionOrigin) {
|
|
2005
|
-
MapActionOrigin["map"] = "map";
|
|
2006
|
-
})(MapActionOrigin || (MapActionOrigin = {}));
|
|
2007
|
-
|
|
2008
1988
|
/* *
|
|
2009
1989
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2010
1990
|
* you may not use this file except in compliance with the License.
|
|
@@ -2068,385 +2048,99 @@ var types$3 = /*#__PURE__*/Object.freeze({
|
|
|
2068
2048
|
|
|
2069
2049
|
var types$2 = /*#__PURE__*/Object.freeze({
|
|
2070
2050
|
__proto__: null,
|
|
2071
|
-
get
|
|
2072
|
-
get AnimationLength () { return AnimationLength; },
|
|
2073
|
-
get MapActionOrigin () { return MapActionOrigin; },
|
|
2051
|
+
get AnimationLength () { return AnimationLength$1; },
|
|
2074
2052
|
get LayerType () { return LayerType; },
|
|
2075
2053
|
get LayerStatus () { return LayerStatus; },
|
|
2076
2054
|
get LayerActionOrigin () { return LayerActionOrigin; }
|
|
2077
2055
|
});
|
|
2078
2056
|
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
var speedFactors = [0.1, 0.2, 0.5, 1, 2, 4, 8, 16]; // Declares available animation speed multipliers for default delay
|
|
2084
|
-
/**
|
|
2085
|
-
* Returns speed delay for given speedFactor. For options, see defined above in "speedFactors"
|
|
2086
|
-
*/
|
|
2087
|
-
var getSpeedDelay = function getSpeedDelay(speedFactor) {
|
|
2088
|
-
return defaultDelay / speedFactor;
|
|
2089
|
-
};
|
|
2090
|
-
var getSpeedFactor = function getSpeedFactor(speedDelay) {
|
|
2091
|
-
return defaultDelay / speedDelay;
|
|
2092
|
-
};
|
|
2093
|
-
var getSelectedTime = function getSelectedTime(timeDimension) {
|
|
2094
|
-
var currentValueIsValid = timeDimension && timeDimension.currentValue && moment.utc(timeDimension.currentValue).isValid();
|
|
2095
|
-
var selectedTime = currentValueIsValid && timeDimension ? moment.utc(timeDimension.currentValue).unix() : moment.utc().unix();
|
|
2096
|
-
return selectedTime;
|
|
2097
|
-
};
|
|
2098
|
-
/**
|
|
2099
|
-
* Returns time bounds from the given dimension. If no time dimension given, current time is returned as default
|
|
2100
|
-
*/
|
|
2101
|
-
var getTimeBounds = function getTimeBounds(dimensions) {
|
|
2102
|
-
var defaultStartEnd = moment.utc().set({
|
|
2103
|
-
second: 0,
|
|
2104
|
-
millisecond: 0
|
|
2105
|
-
}).unix();
|
|
2106
|
-
var timeDimension = dimensions === null || dimensions === void 0 ? void 0 : dimensions.find(function (dim) {
|
|
2107
|
-
return dim.name === 'time';
|
|
2108
|
-
});
|
|
2109
|
-
var startTime = timeDimension && timeDimension.minValue ? moment.utc(timeDimension.minValue).unix() : defaultStartEnd;
|
|
2110
|
-
var endTime = timeDimension && timeDimension.maxValue ? moment.utc(timeDimension.maxValue).unix() : defaultStartEnd;
|
|
2111
|
-
var selectedTime = getSelectedTime(timeDimension);
|
|
2112
|
-
return {
|
|
2113
|
-
selectedTime: selectedTime,
|
|
2114
|
-
startTime: startTime,
|
|
2115
|
-
endTime: endTime
|
|
2116
|
-
};
|
|
2117
|
-
};
|
|
2118
|
-
/**
|
|
2119
|
-
* Returns time bounds as *Moment* time instances from the given dimension. If no time dimension given, current time is returned as default
|
|
2120
|
-
*/
|
|
2121
|
-
var getMomentTimeBounds = function getMomentTimeBounds(dimensions) {
|
|
2122
|
-
var _getTimeBounds = getTimeBounds(dimensions),
|
|
2123
|
-
selectedTime = _getTimeBounds.selectedTime,
|
|
2124
|
-
startTime = _getTimeBounds.startTime,
|
|
2125
|
-
endTime = _getTimeBounds.endTime;
|
|
2126
|
-
return {
|
|
2127
|
-
selectedTime: moment.unix(selectedTime),
|
|
2128
|
-
startTime: moment.unix(startTime),
|
|
2129
|
-
endTime: moment.unix(endTime)
|
|
2130
|
-
};
|
|
2131
|
-
};
|
|
2132
|
-
var scalingCoefficient = function scalingCoefficient(end, start, width) {
|
|
2133
|
-
return width / (end - start);
|
|
2134
|
-
};
|
|
2135
|
-
var timestampToPixelEdges = function timestampToPixelEdges(timestamp, start, end, width) {
|
|
2136
|
-
return (timestamp - start) * scalingCoefficient(end, start, width);
|
|
2137
|
-
};
|
|
2138
|
-
var timestampToPixel = function timestampToPixel(timestamp, centerTime, widthPx, secondsPerPx) {
|
|
2139
|
-
return widthPx / 2 - (centerTime - timestamp) / secondsPerPx;
|
|
2140
|
-
};
|
|
2141
|
-
var pixelToTimestamp = function pixelToTimestamp(timePx, centerTime, widthPx, secondsPerPx) {
|
|
2142
|
-
return centerTime - (widthPx / 2 - timePx) * secondsPerPx;
|
|
2143
|
-
};
|
|
2144
|
-
var onsetNewDateDebounced = function onsetNewDateDebounced(dateToSet, onSetNewDate) {
|
|
2145
|
-
debounce(function () {
|
|
2146
|
-
onSetNewDate(dateToSet);
|
|
2147
|
-
}, 10, {
|
|
2148
|
-
leading: true
|
|
2149
|
-
})();
|
|
2150
|
-
};
|
|
2151
|
-
var roundWithTimeStep = function roundWithTimeStep(unixTime, timeStep, type) {
|
|
2152
|
-
var adjustedTimeStep = timeStep * 60;
|
|
2153
|
-
if (!type || type === 'round') {
|
|
2154
|
-
return Math.round(unixTime / adjustedTimeStep) * adjustedTimeStep;
|
|
2155
|
-
}
|
|
2156
|
-
if (type === 'floor') {
|
|
2157
|
-
return Math.floor(unixTime / adjustedTimeStep) * adjustedTimeStep;
|
|
2158
|
-
}
|
|
2159
|
-
if (type === 'ceil') {
|
|
2160
|
-
return Math.ceil(unixTime / adjustedTimeStep) * adjustedTimeStep;
|
|
2161
|
-
}
|
|
2162
|
-
return undefined;
|
|
2163
|
-
};
|
|
2164
|
-
var setNewRoundedTime = function setNewRoundedTime(x, centerTime, width, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate) {
|
|
2165
|
-
var unixTime = pixelToTimestamp(x, centerTime, width, secondsPerPx);
|
|
2166
|
-
var roundedTime = roundWithTimeStep(unixTime, timeStep);
|
|
2167
|
-
var maxTime = Math.max(roundedTime, dataStartTime);
|
|
2168
|
-
var newTime = Math.min(maxTime, dataEndTime || roundedTime);
|
|
2169
|
-
var selectedTimeString = moment.unix(newTime).toISOString();
|
|
2170
|
-
onsetNewDateDebounced(selectedTimeString, onSetNewDate);
|
|
2171
|
-
};
|
|
2172
|
-
var getDataLimitsFromLayers = function getDataLimitsFromLayers(layers) {
|
|
2173
|
-
return layers.reduce(function (_ref, layer) {
|
|
2174
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
2175
|
-
start = _ref2[0],
|
|
2176
|
-
end = _ref2[1];
|
|
2177
|
-
var dimension = getWMJSTimeDimensionForLayerId(layer.id);
|
|
2178
|
-
if (dimension) {
|
|
2179
|
-
var lastValue = moment(dimension.getLastValue()).unix();
|
|
2180
|
-
var firstValue = moment(dimension.getFirstValue()).unix();
|
|
2181
|
-
var newLast = lastValue > end ? lastValue : end;
|
|
2182
|
-
var newFirst = firstValue < start ? firstValue : start;
|
|
2183
|
-
return [newFirst, newLast];
|
|
2184
|
-
}
|
|
2185
|
-
return [start, end];
|
|
2186
|
-
},
|
|
2187
|
-
/* Using the maximum 32-bit value and 0 as starting points
|
|
2188
|
-
* bigger values like Number.MAX_VALUE or Number.MAX_SAFE_INTEGER
|
|
2189
|
-
* cause weird behaviour as timestamps break at 32bit limit (year 2038)
|
|
2190
|
-
*/
|
|
2191
|
-
[2147483647, 0]);
|
|
2192
|
-
};
|
|
2193
|
-
var setPreviousTimeStep = function setPreviousTimeStep(timeStep, currentTime, dataStartTime, onSetNewDate) {
|
|
2194
|
-
var nextTime = currentTime - timeStep;
|
|
2195
|
-
var roundedTime = roundWithTimeStep(nextTime, timeStep, 'floor');
|
|
2196
|
-
var newTime = Math.max(roundedTime, dataStartTime || roundedTime);
|
|
2197
|
-
var selectedTimeString = moment.unix(newTime).toISOString();
|
|
2198
|
-
onsetNewDateDebounced(selectedTimeString, onSetNewDate);
|
|
2199
|
-
};
|
|
2200
|
-
var setNextTimeStep = function setNextTimeStep(timeStep, currentTime, dataEndTime, onSetNewDate) {
|
|
2201
|
-
var nextTime = currentTime + timeStep;
|
|
2202
|
-
var roundedTime = roundWithTimeStep(nextTime, timeStep, 'ceil');
|
|
2203
|
-
var newTime = Math.min(roundedTime, dataEndTime || roundedTime);
|
|
2204
|
-
var selectedTimeString = moment.unix(newTime).toISOString();
|
|
2205
|
-
onsetNewDateDebounced(selectedTimeString, onSetNewDate);
|
|
2206
|
-
};
|
|
2207
|
-
/**
|
|
2208
|
-
* updates unfiltered selected time and moves selected time a given distance
|
|
2209
|
-
* in pixels. Unfiltered selected time can be outside data data limits, but
|
|
2210
|
-
* selected time cannot.
|
|
2211
|
-
*/
|
|
2212
|
-
var moveSelectedTimePx = function moveSelectedTimePx(x, canvasWidth, centerTime, dataStartTime, dataEndTime, secondsPerPx, timeStep, unfilteredSelectedTime, setUnfilteredSelectedTime, onSetNewDate) {
|
|
2213
|
-
var _map = [dataStartTime, dataEndTime, unfilteredSelectedTime].map(function (timestamp) {
|
|
2214
|
-
return timestampToPixel(timestamp, centerTime, canvasWidth, secondsPerPx);
|
|
2215
|
-
}),
|
|
2216
|
-
_map2 = _slicedToArray(_map, 3),
|
|
2217
|
-
leftMarkerPx = _map2[0],
|
|
2218
|
-
rightMarkerPx = _map2[1],
|
|
2219
|
-
unfilteredSelectedTimePx = _map2[2];
|
|
2220
|
-
setUnfilteredSelectedTime(pixelToTimestamp(unfilteredSelectedTimePx + x, centerTime, canvasWidth, secondsPerPx));
|
|
2221
|
-
var clickedUnfilteredSelectedTimePx = unfilteredSelectedTimePx + x;
|
|
2222
|
-
var minClickedUnfilteredSelectedTimePx = Math.min(clickedUnfilteredSelectedTimePx, rightMarkerPx);
|
|
2223
|
-
var newUnfilteredSelectedTimePx = Math.max(minClickedUnfilteredSelectedTimePx, leftMarkerPx);
|
|
2224
|
-
setNewRoundedTime(newUnfilteredSelectedTimePx, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
|
|
2225
|
-
};
|
|
2226
|
-
/**
|
|
2227
|
-
* This function calculates a suitable secondsPerpx value,
|
|
2228
|
-
* when a data scale is selected. secondsPerPx is different for every data set
|
|
2229
|
-
* and is calculated here with a function getDataLimitsfromLayers.
|
|
2230
|
-
* There in the function the largest time range of all layers is selected.
|
|
2231
|
-
* @param layers
|
|
2232
|
-
* @returns secondsPerPx for data sets of layers calculated 60*2*3,
|
|
2233
|
-
* where 3 is found by trying how to get the whole data range
|
|
2234
|
-
* to fit in the time slider
|
|
2235
|
-
*/
|
|
2236
|
-
var getScaleToSecondsPerPxForDataScale = function getScaleToSecondsPerPxForDataScale(layers) {
|
|
2237
|
-
var _getDataLimitsFromLay = getDataLimitsFromLayers(layers),
|
|
2238
|
-
_getDataLimitsFromLay2 = _slicedToArray(_getDataLimitsFromLay, 2),
|
|
2239
|
-
dataStartTime = _getDataLimitsFromLay2[0],
|
|
2240
|
-
dataEndTime = _getDataLimitsFromLay2[1];
|
|
2241
|
-
var dataRegionInSeconds = dataEndTime - dataStartTime;
|
|
2242
|
-
return Math.floor(dataRegionInSeconds / 360); // 60 * 2 * 3, 3 is a hand shake value
|
|
2243
|
-
};
|
|
2244
|
-
/**
|
|
2245
|
-
* In this Map collection all fundamental scales
|
|
2246
|
-
* (Scale.Minutes5 ... Scale.Year) are mapped with their corresponding
|
|
2247
|
-
* secondsPerPx numbers. A Scale.DataScale is not included since its
|
|
2248
|
-
* secondsPerPx number is different for every data set.
|
|
2249
|
-
* @returns a Map including information explained above
|
|
2250
|
-
*/
|
|
2251
|
-
var secondsPerPxToScale = new Map([[2.5, Scale.Minutes5], [30, Scale.Hour], [3 * 30, Scale.Hours3], [6 * 30, Scale.Hours6], [24 * 30, Scale.Day], [7 * 24 * 30, Scale.Week], [30 * 24 * 30, Scale.Month], [365 * 24 * 30, Scale.Year]]);
|
|
2252
|
-
/**
|
|
2253
|
-
* Here secondsPerPxToScale is converted to an iterator object and
|
|
2254
|
-
* then keys are turned to values and values turned to keys
|
|
2255
|
-
* to make it easier in some parts GeoWeb to fetch a secondsPerpx for
|
|
2256
|
-
* a certain fundamental scale (Scale.Minutes5 ... Scale.year)
|
|
2257
|
-
* @returns an Object, where names are fundamental scale values (0 - 7) and
|
|
2258
|
-
* values are their corresponding secondsPerPx numbers.
|
|
2259
|
-
*/
|
|
2260
|
-
var scaleToSecondsPerPx = _toConsumableArray(secondsPerPxToScale.entries()).reduce(function (acc, _ref3) {
|
|
2261
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
2262
|
-
k = _ref4[0],
|
|
2263
|
-
v = _ref4[1];
|
|
2264
|
-
return Object.assign(Object.assign({}, acc), _defineProperty$1({}, v, Number(k)));
|
|
2265
|
-
}, {});
|
|
2266
|
-
/**
|
|
2267
|
-
* This function creates and returns an array where there is secondsPerPx
|
|
2268
|
-
* number of the data set added for a data scale (dataScaleToSecondsPerPx)
|
|
2269
|
-
* to secondsPerPxToScale.
|
|
2270
|
-
* @param dataScaleToSecondsPerPx
|
|
2271
|
-
* @returns an array containing secondsPerPx numbers.
|
|
2272
|
-
* The secondsPerPx number for a data scale is included
|
|
2273
|
-
* contrary to secondsPerPxToScale.
|
|
2274
|
-
*/
|
|
2275
|
-
var secondsPerPxValues = function secondsPerPxValues(dataScaleToSecondsPerPx) {
|
|
2276
|
-
var sortedSecondsPerPx = _toConsumableArray(secondsPerPxToScale).map(function (value) {
|
|
2277
|
-
return Number(value[0]);
|
|
2278
|
-
});
|
|
2279
|
-
var full = [].concat(_toConsumableArray(sortedSecondsPerPx), [dataScaleToSecondsPerPx]);
|
|
2280
|
-
return full;
|
|
2281
|
-
};
|
|
2282
|
-
var defaultDataScaleToSecondsPerPx = 43200;
|
|
2283
|
-
var getNewCenterOfFixedPointZoom = function getNewCenterOfFixedPointZoom(fixedTimePoint, oldSecondsPerPx, newSecondsPerPx, oldCenterTime) {
|
|
2284
|
-
var centerToFixedPointPx = (fixedTimePoint - oldCenterTime) / oldSecondsPerPx;
|
|
2285
|
-
return fixedTimePoint - centerToFixedPointPx * newSecondsPerPx;
|
|
2286
|
-
};
|
|
2287
|
-
/**
|
|
2288
|
-
* Move the time slider such that a given time point (timePoint)
|
|
2289
|
-
* is at a given pixel width (timePointPx).
|
|
2290
|
-
* @returns a new center time for the resulting position
|
|
2291
|
-
*/
|
|
2292
|
-
var moveRelativeToTimePoint = function moveRelativeToTimePoint(timePoint, timePointPx, secondsPerPx, canvasWidth) {
|
|
2293
|
-
return timePoint - secondsPerPx * (timePointPx - canvasWidth / 2);
|
|
2294
|
-
};
|
|
2295
|
-
/** This reusable custom hook tells whether given pointer event targets current canvas node.
|
|
2296
|
-
* Example:
|
|
2057
|
+
/* *
|
|
2058
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2059
|
+
* you may not use this file except in compliance with the License.
|
|
2060
|
+
* You may obtain a copy of the License at
|
|
2297
2061
|
*
|
|
2298
|
-
*
|
|
2299
|
-
* ...
|
|
2300
|
-
* return isAllowedCanvasNodePointed ? (<CanvasComponent ref={nodeRef}>Component with ref</CanvasComponent>) : (<CanvasComponent>Component with NO ref</CanvasComponent>);
|
|
2301
|
-
* ...
|
|
2302
|
-
*/
|
|
2303
|
-
var useCanvasTarget = function useCanvasTarget(eventType) {
|
|
2304
|
-
var nodeRef = React__default.useRef(null);
|
|
2305
|
-
var _React$useState = React__default.useState(false),
|
|
2306
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2307
|
-
isTargetNode = _React$useState2[0],
|
|
2308
|
-
setTargetNode = _React$useState2[1];
|
|
2309
|
-
// Check if pointer event targets current node element
|
|
2310
|
-
var pointerEventListener = React__default.useCallback(function (event) {
|
|
2311
|
-
setTargetNode(nodeRef.current.canvas ? nodeRef.current.canvas.isEqualNode(event.target) : false);
|
|
2312
|
-
}, [nodeRef]);
|
|
2313
|
-
React__default.useEffect(function () {
|
|
2314
|
-
document.addEventListener(eventType, pointerEventListener);
|
|
2315
|
-
return function () {
|
|
2316
|
-
return document.removeEventListener(eventType, pointerEventListener);
|
|
2317
|
-
};
|
|
2318
|
-
}, [eventType, pointerEventListener]); // Only add/remove event listener when listener really changes, that is, NOT necessarily between every re-render.
|
|
2319
|
-
return [isTargetNode, nodeRef];
|
|
2320
|
-
};
|
|
2321
|
-
var needleGeom = {
|
|
2322
|
-
smallWidth: 126,
|
|
2323
|
-
largeWidth: 167,
|
|
2324
|
-
height: 24,
|
|
2325
|
-
cornerRadius: 5,
|
|
2326
|
-
lineWidth: 1
|
|
2327
|
-
};
|
|
2328
|
-
var AUTO_MOVE_AREA_PADDING = 1;
|
|
2329
|
-
var getAutoMoveAreaWidth = function getAutoMoveAreaWidth(scale) {
|
|
2330
|
-
return (scale === Scale.Year ? needleGeom.largeWidth : needleGeom.smallWidth) / 2 + AUTO_MOVE_AREA_PADDING;
|
|
2331
|
-
};
|
|
2332
|
-
/** Reusable business logic for how to handle events that set time to now (closest).
|
|
2333
|
-
* Used in NowButton and TimeSliderLegend.
|
|
2334
|
-
*/
|
|
2335
|
-
var handleSetNowEvent = function handleSetNowEvent(timeStep, dataStartTime, dataEndTime, currentTime, onSetNewDate, onSetCenterTime) {
|
|
2336
|
-
if (dataStartTime < dataEndTime) {
|
|
2337
|
-
if (dataEndTime < currentTime) {
|
|
2338
|
-
onSetNewDate(moment.utc(dataEndTime * millisecondsInSecond).toISOString());
|
|
2339
|
-
onSetCenterTime(dataEndTime);
|
|
2340
|
-
} else if (dataStartTime > currentTime) {
|
|
2341
|
-
onSetNewDate(moment.utc(dataStartTime * millisecondsInSecond).toISOString());
|
|
2342
|
-
onSetCenterTime(dataStartTime);
|
|
2343
|
-
} else {
|
|
2344
|
-
var closestToCurrent = roundWithTimeStep(currentTime, timeStep);
|
|
2345
|
-
onSetNewDate(moment.utc(closestToCurrent * millisecondsInSecond).toISOString());
|
|
2346
|
-
onSetCenterTime(closestToCurrent);
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
};
|
|
2350
|
-
var TimeInMinutes;
|
|
2351
|
-
(function (TimeInMinutes) {
|
|
2352
|
-
TimeInMinutes[TimeInMinutes["YEAR"] = 525600] = "YEAR";
|
|
2353
|
-
TimeInMinutes[TimeInMinutes["MONTH"] = 43800] = "MONTH";
|
|
2354
|
-
TimeInMinutes[TimeInMinutes["DAY"] = 1440] = "DAY";
|
|
2355
|
-
TimeInMinutes[TimeInMinutes["HOUR"] = 60] = "HOUR";
|
|
2356
|
-
TimeInMinutes[TimeInMinutes["MINUTE"] = 1] = "MINUTE";
|
|
2357
|
-
})(TimeInMinutes || (TimeInMinutes = {}));
|
|
2358
|
-
/**
|
|
2062
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2359
2063
|
*
|
|
2360
|
-
*
|
|
2361
|
-
*
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
};
|
|
2064
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2065
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2066
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2067
|
+
* See the License for the specific language governing permissions and
|
|
2068
|
+
* limitations under the License.
|
|
2069
|
+
*
|
|
2070
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2071
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
2072
|
+
* */
|
|
2073
|
+
var Scale;
|
|
2074
|
+
(function (Scale) {
|
|
2075
|
+
Scale[Scale["Minutes5"] = 0] = "Minutes5";
|
|
2076
|
+
Scale[Scale["Hour"] = 1] = "Hour";
|
|
2077
|
+
Scale[Scale["Hours3"] = 2] = "Hours3";
|
|
2078
|
+
Scale[Scale["Hours6"] = 3] = "Hours6";
|
|
2079
|
+
Scale[Scale["Day"] = 4] = "Day";
|
|
2080
|
+
Scale[Scale["Week"] = 5] = "Week";
|
|
2081
|
+
Scale[Scale["Month"] = 6] = "Month";
|
|
2082
|
+
Scale[Scale["Year"] = 7] = "Year";
|
|
2083
|
+
})(Scale || (Scale = {}));
|
|
2084
|
+
var Span;
|
|
2085
|
+
(function (Span) {
|
|
2086
|
+
Span[Span["Hour"] = 0] = "Hour";
|
|
2087
|
+
Span[Span["Hours3"] = 1] = "Hours3";
|
|
2088
|
+
Span[Span["Hours6"] = 2] = "Hours6";
|
|
2089
|
+
Span[Span["Hours12"] = 3] = "Hours12";
|
|
2090
|
+
Span[Span["Day"] = 4] = "Day";
|
|
2091
|
+
Span[Span["Days2"] = 5] = "Days2";
|
|
2092
|
+
Span[Span["Week"] = 6] = "Week";
|
|
2093
|
+
Span[Span["Weeks2"] = 7] = "Weeks2";
|
|
2094
|
+
Span[Span["Month"] = 8] = "Month";
|
|
2095
|
+
Span[Span["Months3"] = 9] = "Months3";
|
|
2096
|
+
Span[Span["Year"] = 10] = "Year";
|
|
2097
|
+
Span[Span["DataSpan"] = 11] = "DataSpan";
|
|
2098
|
+
})(Span || (Span = {}));
|
|
2099
|
+
var AnimationLength;
|
|
2100
|
+
(function (AnimationLength) {
|
|
2101
|
+
AnimationLength[AnimationLength["Minutes15"] = 15] = "Minutes15";
|
|
2102
|
+
AnimationLength[AnimationLength["Minutes30"] = 30] = "Minutes30";
|
|
2103
|
+
AnimationLength[AnimationLength["Hours1"] = 60] = "Hours1";
|
|
2104
|
+
AnimationLength[AnimationLength["Hours2"] = 120] = "Hours2";
|
|
2105
|
+
AnimationLength[AnimationLength["Hours3"] = 180] = "Hours3";
|
|
2106
|
+
AnimationLength[AnimationLength["Hours6"] = 360] = "Hours6";
|
|
2107
|
+
AnimationLength[AnimationLength["Hours12"] = 720] = "Hours12";
|
|
2108
|
+
AnimationLength[AnimationLength["Hours24"] = 1440] = "Hours24";
|
|
2109
|
+
})(AnimationLength || (AnimationLength = {}));
|
|
2110
|
+
var MapActionOrigin;
|
|
2111
|
+
(function (MapActionOrigin) {
|
|
2112
|
+
MapActionOrigin["map"] = "map";
|
|
2113
|
+
})(MapActionOrigin || (MapActionOrigin = {}));
|
|
2410
2114
|
|
|
2411
|
-
var
|
|
2115
|
+
var enums = /*#__PURE__*/Object.freeze({
|
|
2412
2116
|
__proto__: null,
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
speedFactors: speedFactors,
|
|
2418
|
-
getSpeedDelay: getSpeedDelay,
|
|
2419
|
-
getSpeedFactor: getSpeedFactor,
|
|
2420
|
-
getSelectedTime: getSelectedTime,
|
|
2421
|
-
getTimeBounds: getTimeBounds,
|
|
2422
|
-
getMomentTimeBounds: getMomentTimeBounds,
|
|
2423
|
-
scalingCoefficient: scalingCoefficient,
|
|
2424
|
-
timestampToPixelEdges: timestampToPixelEdges,
|
|
2425
|
-
timestampToPixel: timestampToPixel,
|
|
2426
|
-
pixelToTimestamp: pixelToTimestamp,
|
|
2427
|
-
onsetNewDateDebounced: onsetNewDateDebounced,
|
|
2428
|
-
roundWithTimeStep: roundWithTimeStep,
|
|
2429
|
-
setNewRoundedTime: setNewRoundedTime,
|
|
2430
|
-
getDataLimitsFromLayers: getDataLimitsFromLayers,
|
|
2431
|
-
setPreviousTimeStep: setPreviousTimeStep,
|
|
2432
|
-
setNextTimeStep: setNextTimeStep,
|
|
2433
|
-
moveSelectedTimePx: moveSelectedTimePx,
|
|
2434
|
-
getScaleToSecondsPerPxForDataScale: getScaleToSecondsPerPxForDataScale,
|
|
2435
|
-
secondsPerPxToScale: secondsPerPxToScale,
|
|
2436
|
-
scaleToSecondsPerPx: scaleToSecondsPerPx,
|
|
2437
|
-
secondsPerPxValues: secondsPerPxValues,
|
|
2438
|
-
defaultDataScaleToSecondsPerPx: defaultDataScaleToSecondsPerPx,
|
|
2439
|
-
getNewCenterOfFixedPointZoom: getNewCenterOfFixedPointZoom,
|
|
2440
|
-
moveRelativeToTimePoint: moveRelativeToTimePoint,
|
|
2441
|
-
useCanvasTarget: useCanvasTarget,
|
|
2442
|
-
needleGeom: needleGeom,
|
|
2443
|
-
AUTO_MOVE_AREA_PADDING: AUTO_MOVE_AREA_PADDING,
|
|
2444
|
-
getAutoMoveAreaWidth: getAutoMoveAreaWidth,
|
|
2445
|
-
handleSetNowEvent: handleSetNowEvent,
|
|
2446
|
-
get TimeInMinutes () { return TimeInMinutes; },
|
|
2447
|
-
minutesToDescribedDuration: minutesToDescribedDuration
|
|
2117
|
+
get Scale () { return Scale; },
|
|
2118
|
+
get Span () { return Span; },
|
|
2119
|
+
get AnimationLength () { return AnimationLength; },
|
|
2120
|
+
get MapActionOrigin () { return MapActionOrigin; }
|
|
2448
2121
|
});
|
|
2449
2122
|
|
|
2123
|
+
/* *
|
|
2124
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2125
|
+
* you may not use this file except in compliance with the License.
|
|
2126
|
+
* You may obtain a copy of the License at
|
|
2127
|
+
*
|
|
2128
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2129
|
+
*
|
|
2130
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2131
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2132
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2133
|
+
* See the License for the specific language governing permissions and
|
|
2134
|
+
* limitations under the License.
|
|
2135
|
+
*
|
|
2136
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2137
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
2138
|
+
* */
|
|
2139
|
+
var defaultAnimationDelayAtStart = 250;
|
|
2140
|
+
var defaultDelay = 1000; // [ms]
|
|
2141
|
+
var defaultTimeStep = 60;
|
|
2142
|
+
var defaultSecondsPerPx = 80;
|
|
2143
|
+
|
|
2450
2144
|
var createMap = function createMap(_ref) {
|
|
2451
2145
|
var id = _ref.id,
|
|
2452
2146
|
_ref$isAnimating = _ref.isAnimating,
|
|
@@ -2480,18 +2174,18 @@ var createMap = function createMap(_ref) {
|
|
|
2480
2174
|
dimensions = _ref$dimensions === void 0 ? [] : _ref$dimensions,
|
|
2481
2175
|
autoUpdateLayerId = _ref.autoUpdateLayerId,
|
|
2482
2176
|
autoTimeStepLayerId = _ref.autoTimeStepLayerId,
|
|
2483
|
-
_ref$
|
|
2484
|
-
|
|
2177
|
+
_ref$timeSliderSpan = _ref.timeSliderSpan,
|
|
2178
|
+
timeSliderSpan = _ref$timeSliderSpan === void 0 ? Span.Day : _ref$timeSliderSpan,
|
|
2485
2179
|
_ref$timeStep = _ref.timeStep,
|
|
2486
2180
|
timeStep = _ref$timeStep === void 0 ? defaultTimeStep : _ref$timeStep,
|
|
2487
2181
|
_ref$animationDelay = _ref.animationDelay,
|
|
2488
2182
|
animationDelay = _ref$animationDelay === void 0 ? defaultAnimationDelayAtStart : _ref$animationDelay,
|
|
2183
|
+
_ref$timeSliderWidth = _ref.timeSliderWidth,
|
|
2184
|
+
timeSliderWidth = _ref$timeSliderWidth === void 0 ? 440 : _ref$timeSliderWidth,
|
|
2489
2185
|
_ref$timeSliderCenter = _ref.timeSliderCenterTime,
|
|
2490
2186
|
timeSliderCenterTime = _ref$timeSliderCenter === void 0 ? moment.utc().unix() : _ref$timeSliderCenter,
|
|
2491
2187
|
_ref$timeSliderSecond = _ref.timeSliderSecondsPerPx,
|
|
2492
|
-
timeSliderSecondsPerPx = _ref$timeSliderSecond === void 0 ?
|
|
2493
|
-
_ref$timeSliderDataSc = _ref.timeSliderDataScaleToSecondsPerPx,
|
|
2494
|
-
timeSliderDataScaleToSecondsPerPx = _ref$timeSliderDataSc === void 0 ? defaultDataScaleToSecondsPerPx : _ref$timeSliderDataSc,
|
|
2188
|
+
timeSliderSecondsPerPx = _ref$timeSliderSecond === void 0 ? defaultSecondsPerPx : _ref$timeSliderSecond,
|
|
2495
2189
|
_ref$isTimestepAuto = _ref.isTimestepAuto,
|
|
2496
2190
|
isTimestepAuto = _ref$isTimestepAuto === void 0 ? true : _ref$isTimestepAuto,
|
|
2497
2191
|
_ref$isTimeSliderHove = _ref.isTimeSliderHoverOn,
|
|
@@ -2520,12 +2214,12 @@ var createMap = function createMap(_ref) {
|
|
|
2520
2214
|
dimensions: dimensions,
|
|
2521
2215
|
autoUpdateLayerId: autoUpdateLayerId,
|
|
2522
2216
|
autoTimeStepLayerId: autoTimeStepLayerId,
|
|
2523
|
-
|
|
2217
|
+
timeSliderSpan: timeSliderSpan,
|
|
2524
2218
|
timeStep: timeStep,
|
|
2525
2219
|
animationDelay: animationDelay,
|
|
2220
|
+
timeSliderWidth: timeSliderWidth,
|
|
2526
2221
|
timeSliderCenterTime: timeSliderCenterTime,
|
|
2527
2222
|
timeSliderSecondsPerPx: timeSliderSecondsPerPx,
|
|
2528
|
-
timeSliderDataScaleToSecondsPerPx: timeSliderDataScaleToSecondsPerPx,
|
|
2529
2223
|
isTimestepAuto: isTimestepAuto,
|
|
2530
2224
|
isTimeSliderHoverOn: isTimeSliderHoverOn,
|
|
2531
2225
|
isTimeSliderVisible: isTimeSliderVisible,
|
|
@@ -2686,6 +2380,56 @@ var getTimeStepFromDataInterval = function getTimeStepFromDataInterval(timeInter
|
|
|
2686
2380
|
var getActiveLayerTimeStep = function getActiveLayerTimeStep(timeDimension) {
|
|
2687
2381
|
return (timeDimension === null || timeDimension === void 0 ? void 0 : timeDimension.timeInterval) ? getTimeStepFromDataInterval(timeDimension.timeInterval) : undefined;
|
|
2688
2382
|
};
|
|
2383
|
+
var getSpeedFactor = function getSpeedFactor(speedDelay) {
|
|
2384
|
+
return defaultDelay / speedDelay;
|
|
2385
|
+
};
|
|
2386
|
+
/**
|
|
2387
|
+
* Returns speed delay for given speedFactor. For options, see defined above in "speedFactors"
|
|
2388
|
+
*/
|
|
2389
|
+
var getSpeedDelay = function getSpeedDelay(speedFactor) {
|
|
2390
|
+
return defaultDelay / speedFactor;
|
|
2391
|
+
};
|
|
2392
|
+
var roundWithTimeStep = function roundWithTimeStep(unixTime, timeStep, type) {
|
|
2393
|
+
var adjustedTimeStep = timeStep * 60;
|
|
2394
|
+
if (!type || type === 'round') {
|
|
2395
|
+
return Math.round(unixTime / adjustedTimeStep) * adjustedTimeStep;
|
|
2396
|
+
}
|
|
2397
|
+
if (type === 'floor') {
|
|
2398
|
+
return Math.floor(unixTime / adjustedTimeStep) * adjustedTimeStep;
|
|
2399
|
+
}
|
|
2400
|
+
if (type === 'ceil') {
|
|
2401
|
+
return Math.ceil(unixTime / adjustedTimeStep) * adjustedTimeStep;
|
|
2402
|
+
}
|
|
2403
|
+
return undefined;
|
|
2404
|
+
};
|
|
2405
|
+
/**
|
|
2406
|
+
* In this Map collection all fundamental scales
|
|
2407
|
+
* (Scale.Minutes5 ... Scale.Year) are mapped with their corresponding
|
|
2408
|
+
* secondsPerPx numbers.
|
|
2409
|
+
* @returns a Map including information explained above
|
|
2410
|
+
*/
|
|
2411
|
+
var secondsPerPxToScale = new Map([[2.5, Scale.Minutes5], [30, Scale.Hour], [3 * 30, Scale.Hours3], [6 * 30, Scale.Hours6], [24 * 30, Scale.Day], [7 * 24 * 30, Scale.Week], [30 * 24 * 30, Scale.Month], [365 * 24 * 30, Scale.Year]]);
|
|
2412
|
+
var secondsToSpan = new Map([[3600, Span.Hour], [3 * 3600, Span.Hours3], [6 * 3600, Span.Hours6], [12 * 3600, Span.Hours12], [24 * 3600, Span.Day], [2 * 24 * 3600, Span.Days2], [7 * 24 * 3600, Span.Week], [2 * 7 * 24 * 3600, Span.Weeks2], [30 * 24 * 3600, Span.Month], [3 * 30 * 24 * 3600, Span.Months3], [365 * 24 * 3600, Span.Year]]);
|
|
2413
|
+
/**
|
|
2414
|
+
* Here secondsPerPxToScale is converted to an iterator object and
|
|
2415
|
+
* then keys are turned to values and values turned to keys
|
|
2416
|
+
* to make it easier in some parts GeoWeb to fetch a secondsPerpx for
|
|
2417
|
+
* a certain fundamental scale (Scale.Minutes5 ... Scale.year)
|
|
2418
|
+
* @returns an Object, where names are fundamental scale values (0 - 7) and
|
|
2419
|
+
* values are their corresponding secondsPerPx numbers.
|
|
2420
|
+
*/
|
|
2421
|
+
var scaleToSecondsPerPx = _toConsumableArray(secondsPerPxToScale.entries()).reduce(function (acc, _ref2) {
|
|
2422
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
2423
|
+
k = _ref3[0],
|
|
2424
|
+
v = _ref3[1];
|
|
2425
|
+
return Object.assign(Object.assign({}, acc), _defineProperty$1({}, v, Number(k)));
|
|
2426
|
+
}, {});
|
|
2427
|
+
var spanToSeconds = _toConsumableArray(secondsToSpan.entries()).reduce(function (acc, _ref4) {
|
|
2428
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
2429
|
+
k = _ref5[0],
|
|
2430
|
+
v = _ref5[1];
|
|
2431
|
+
return Object.assign(Object.assign({}, acc), _defineProperty$1({}, v, Number(k)));
|
|
2432
|
+
}, {});
|
|
2689
2433
|
|
|
2690
2434
|
var utils$1 = /*#__PURE__*/Object.freeze({
|
|
2691
2435
|
__proto__: null,
|
|
@@ -2697,7 +2441,14 @@ var utils$1 = /*#__PURE__*/Object.freeze({
|
|
|
2697
2441
|
produceDraftStateSetMapDimensionFromLayerChangeDimension: produceDraftStateSetMapDimensionFromLayerChangeDimension,
|
|
2698
2442
|
moveArrayElements: moveArrayElements,
|
|
2699
2443
|
getTimeStepFromDataInterval: getTimeStepFromDataInterval,
|
|
2700
|
-
getActiveLayerTimeStep: getActiveLayerTimeStep
|
|
2444
|
+
getActiveLayerTimeStep: getActiveLayerTimeStep,
|
|
2445
|
+
getSpeedFactor: getSpeedFactor,
|
|
2446
|
+
getSpeedDelay: getSpeedDelay,
|
|
2447
|
+
roundWithTimeStep: roundWithTimeStep,
|
|
2448
|
+
secondsPerPxToScale: secondsPerPxToScale,
|
|
2449
|
+
secondsToSpan: secondsToSpan,
|
|
2450
|
+
scaleToSecondsPerPx: scaleToSecondsPerPx,
|
|
2451
|
+
spanToSeconds: spanToSeconds
|
|
2701
2452
|
});
|
|
2702
2453
|
|
|
2703
2454
|
/* *
|
|
@@ -2986,13 +2737,15 @@ var createLayer = function createLayer(_a) {
|
|
|
2986
2737
|
var id = _a.id,
|
|
2987
2738
|
_a$opacity = _a.opacity,
|
|
2988
2739
|
opacity = _a$opacity === void 0 ? 1 : _a$opacity,
|
|
2740
|
+
_a$acceptanceTimeInMi = _a.acceptanceTimeInMinutes,
|
|
2741
|
+
acceptanceTimeInMinutes = _a$acceptanceTimeInMi === void 0 ? 60 : _a$acceptanceTimeInMi,
|
|
2989
2742
|
_a$enabled = _a.enabled,
|
|
2990
2743
|
enabled = _a$enabled === void 0 ? true : _a$enabled,
|
|
2991
2744
|
_a$layerType = _a.layerType,
|
|
2992
2745
|
layerType = _a$layerType === void 0 ? 'mapLayer' : _a$layerType,
|
|
2993
2746
|
_a$status = _a.status,
|
|
2994
2747
|
status = _a$status === void 0 ? 'default' : _a$status,
|
|
2995
|
-
props = __rest$1(_a, ["id", "opacity", "enabled", "layerType", "status"]);
|
|
2748
|
+
props = __rest$1(_a, ["id", "opacity", "acceptanceTimeInMinutes", "enabled", "layerType", "status"]);
|
|
2996
2749
|
var wmjsLayer = getWMLayerById(id);
|
|
2997
2750
|
var dimensions = props.dimensions || (wmjsLayer ? wmjsLayer.getDimensions() : []).map(function (dim) {
|
|
2998
2751
|
return {
|
|
@@ -3005,6 +2758,7 @@ var createLayer = function createLayer(_a) {
|
|
|
3005
2758
|
dimensions: dimensions,
|
|
3006
2759
|
id: id,
|
|
3007
2760
|
opacity: opacity,
|
|
2761
|
+
acceptanceTimeInMinutes: acceptanceTimeInMinutes,
|
|
3008
2762
|
enabled: enabled,
|
|
3009
2763
|
layerType: layerType,
|
|
3010
2764
|
status: status
|
|
@@ -3542,7 +3296,7 @@ var createLayersWithIds = function createLayersWithIds(state, layers) {
|
|
|
3542
3296
|
if (!layers) {
|
|
3543
3297
|
return layers;
|
|
3544
3298
|
}
|
|
3545
|
-
return produce(layers, function (draft) {
|
|
3299
|
+
return produce$1(layers, function (draft) {
|
|
3546
3300
|
for (var j = 0; j < draft.length; j += 1) {
|
|
3547
3301
|
var layer = draft[j];
|
|
3548
3302
|
if (!layer.id) {
|
|
@@ -3627,16 +3381,14 @@ var slice$6 = createSlice({
|
|
|
3627
3381
|
}
|
|
3628
3382
|
draft.byId[mapId].isAnimating = false;
|
|
3629
3383
|
},
|
|
3630
|
-
|
|
3384
|
+
setTimeSliderSpan: function setTimeSliderSpan(draft, action) {
|
|
3631
3385
|
var _action$payload3 = action.payload,
|
|
3632
3386
|
mapId = _action$payload3.mapId,
|
|
3633
|
-
|
|
3387
|
+
timeSliderSpan = _action$payload3.timeSliderSpan;
|
|
3634
3388
|
if (!draft.byId[mapId]) {
|
|
3635
3389
|
return;
|
|
3636
3390
|
}
|
|
3637
|
-
draft.byId[mapId].
|
|
3638
|
-
var scaleToSecPerPx = timeSliderScale === Scale.DataScale ? draft.byId[mapId].timeSliderDataScaleToSecondsPerPx : scaleToSecondsPerPx[timeSliderScale];
|
|
3639
|
-
draft.byId[mapId].timeSliderSecondsPerPx = scaleToSecPerPx;
|
|
3391
|
+
draft.byId[mapId].timeSliderSpan = timeSliderSpan;
|
|
3640
3392
|
},
|
|
3641
3393
|
setTimeStep: function setTimeStep(draft, action) {
|
|
3642
3394
|
var _action$payload4 = action.payload,
|
|
@@ -3725,44 +3477,41 @@ var slice$6 = createSlice({
|
|
|
3725
3477
|
}
|
|
3726
3478
|
map.autoUpdateLayerId = autoUpdateLayerId;
|
|
3727
3479
|
},
|
|
3728
|
-
|
|
3480
|
+
setTimeSliderWidth: function setTimeSliderWidth(draft, action) {
|
|
3729
3481
|
var _action$payload12 = action.payload,
|
|
3730
3482
|
mapId = _action$payload12.mapId,
|
|
3731
|
-
|
|
3483
|
+
timeSliderWidth = _action$payload12.timeSliderWidth;
|
|
3732
3484
|
if (!draft.byId[mapId]) {
|
|
3733
3485
|
return;
|
|
3734
3486
|
}
|
|
3735
|
-
draft.byId[mapId].
|
|
3487
|
+
draft.byId[mapId].timeSliderWidth = timeSliderWidth;
|
|
3736
3488
|
},
|
|
3737
|
-
|
|
3489
|
+
setTimeSliderCenterTime: function setTimeSliderCenterTime(draft, action) {
|
|
3738
3490
|
var _action$payload13 = action.payload,
|
|
3739
3491
|
mapId = _action$payload13.mapId,
|
|
3740
|
-
|
|
3492
|
+
timeSliderCenterTime = _action$payload13.timeSliderCenterTime;
|
|
3741
3493
|
if (!draft.byId[mapId]) {
|
|
3742
3494
|
return;
|
|
3743
3495
|
}
|
|
3744
|
-
draft.byId[mapId].
|
|
3496
|
+
draft.byId[mapId].timeSliderCenterTime = timeSliderCenterTime;
|
|
3745
3497
|
},
|
|
3746
|
-
|
|
3498
|
+
setTimeSliderUnfilteredSelectedTime: function setTimeSliderUnfilteredSelectedTime(draft, action) {
|
|
3747
3499
|
var _action$payload14 = action.payload,
|
|
3748
3500
|
mapId = _action$payload14.mapId,
|
|
3749
|
-
|
|
3501
|
+
timeSliderUnfilteredSelectedTime = _action$payload14.timeSliderUnfilteredSelectedTime;
|
|
3750
3502
|
if (!draft.byId[mapId]) {
|
|
3751
3503
|
return;
|
|
3752
3504
|
}
|
|
3753
|
-
|
|
3754
|
-
var scale = secondsPerPxToScaleValue === undefined ? Scale.DataScale : secondsPerPxToScale.get(timeSliderSecondsPerPx);
|
|
3755
|
-
draft.byId[mapId].timeSliderSecondsPerPx = timeSliderSecondsPerPx;
|
|
3756
|
-
draft.byId[mapId].timeSliderScale = scale;
|
|
3505
|
+
draft.byId[mapId].timeSliderUnfilteredSelectedTime = timeSliderUnfilteredSelectedTime;
|
|
3757
3506
|
},
|
|
3758
|
-
|
|
3507
|
+
setTimeSliderSecondsPerPx: function setTimeSliderSecondsPerPx(draft, action) {
|
|
3759
3508
|
var _action$payload15 = action.payload,
|
|
3760
3509
|
mapId = _action$payload15.mapId,
|
|
3761
|
-
|
|
3510
|
+
timeSliderSecondsPerPx = _action$payload15.timeSliderSecondsPerPx;
|
|
3762
3511
|
if (!draft.byId[mapId]) {
|
|
3763
3512
|
return;
|
|
3764
3513
|
}
|
|
3765
|
-
draft.byId[mapId].
|
|
3514
|
+
draft.byId[mapId].timeSliderSecondsPerPx = timeSliderSecondsPerPx;
|
|
3766
3515
|
},
|
|
3767
3516
|
toggleAutoUpdate: function toggleAutoUpdate(draft, action) {
|
|
3768
3517
|
var _action$payload16 = action.payload,
|
|
@@ -4580,6 +4329,41 @@ var selectors$3 = /*#__PURE__*/Object.freeze({
|
|
|
4580
4329
|
getDialogFocused: getDialogFocused
|
|
4581
4330
|
});
|
|
4582
4331
|
|
|
4332
|
+
/* *
|
|
4333
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4334
|
+
* you may not use this file except in compliance with the License.
|
|
4335
|
+
* You may obtain a copy of the License at
|
|
4336
|
+
*
|
|
4337
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4338
|
+
*
|
|
4339
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4340
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4341
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4342
|
+
* See the License for the specific language governing permissions and
|
|
4343
|
+
* limitations under the License.
|
|
4344
|
+
*
|
|
4345
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4346
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
4347
|
+
* */
|
|
4348
|
+
var DialogTypes;
|
|
4349
|
+
(function (DialogTypes) {
|
|
4350
|
+
DialogTypes["LayerInfo"] = "layerInfo";
|
|
4351
|
+
DialogTypes["SyncGroups"] = "syncGroups";
|
|
4352
|
+
DialogTypes["TimeSeriesSelect"] = "timeSeriesSelect";
|
|
4353
|
+
DialogTypes["TimeSeriesManager"] = "timeSeriesManager";
|
|
4354
|
+
DialogTypes["KeywordFilter"] = "keywordFilter";
|
|
4355
|
+
DialogTypes["DimensionSelectEnsembleMember"] = "dimensionSelect-ensemble_member";
|
|
4356
|
+
DialogTypes["DimensionSelectElevation"] = "dimensionSelect-elevation";
|
|
4357
|
+
DialogTypes["LayerManager"] = "layerManager";
|
|
4358
|
+
DialogTypes["LayerSelect"] = "layerSelect";
|
|
4359
|
+
DialogTypes["DockedLayerManager"] = "dockedLayerManager";
|
|
4360
|
+
})(DialogTypes || (DialogTypes = {}));
|
|
4361
|
+
|
|
4362
|
+
var types$1 = /*#__PURE__*/Object.freeze({
|
|
4363
|
+
__proto__: null,
|
|
4364
|
+
get DialogTypes () { return DialogTypes; }
|
|
4365
|
+
});
|
|
4366
|
+
|
|
4583
4367
|
/* *
|
|
4584
4368
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4585
4369
|
* you may not use this file except in compliance with the License.
|
|
@@ -4835,7 +4619,7 @@ var slice$5 = createSlice({
|
|
|
4835
4619
|
}
|
|
4836
4620
|
});
|
|
4837
4621
|
var setBboxOrTimeSync = function setBboxOrTimeSync(state, action) {
|
|
4838
|
-
return produce(state, function (draft) {
|
|
4622
|
+
return produce$1(state, function (draft) {
|
|
4839
4623
|
var _action$payload6 = action.payload,
|
|
4840
4624
|
targets = _action$payload6.targets,
|
|
4841
4625
|
source = _action$payload6.source,
|
|
@@ -4917,7 +4701,7 @@ var SyncGroupActionOrigin;
|
|
|
4917
4701
|
SyncGroupActionOrigin["activateLayerId"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_ACTIVELAYERIDACTION";
|
|
4918
4702
|
})(SyncGroupActionOrigin || (SyncGroupActionOrigin = {}));
|
|
4919
4703
|
|
|
4920
|
-
var types
|
|
4704
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
4921
4705
|
__proto__: null,
|
|
4922
4706
|
SyncGroupTypeList: SyncGroupTypeList,
|
|
4923
4707
|
get SyncGroupActionOrigin () { return SyncGroupActionOrigin; }
|
|
@@ -5090,11 +4874,12 @@ var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
|
5090
4874
|
|
|
5091
4875
|
var index$1 = /*#__PURE__*/Object.freeze({
|
|
5092
4876
|
__proto__: null,
|
|
5093
|
-
actions: actions,
|
|
5094
4877
|
constants: constants,
|
|
5095
|
-
types: types
|
|
5096
|
-
|
|
5097
|
-
|
|
4878
|
+
types: types,
|
|
4879
|
+
syncGroupsSelectors: selectors$2,
|
|
4880
|
+
syncGroupsTypes: types,
|
|
4881
|
+
actions: actions,
|
|
4882
|
+
initialState: initialState$4
|
|
5098
4883
|
});
|
|
5099
4884
|
|
|
5100
4885
|
/* *
|
|
@@ -5469,15 +5254,15 @@ var getAutoTimeStepLayerId = createSelector(getMapById, function (store) {
|
|
|
5469
5254
|
return store === null || store === void 0 ? void 0 : store.autoTimeStepLayerId;
|
|
5470
5255
|
});
|
|
5471
5256
|
/**
|
|
5472
|
-
* Gets
|
|
5257
|
+
* Gets span of a time slider of a map
|
|
5473
5258
|
*
|
|
5474
|
-
* Example:
|
|
5259
|
+
* Example: span = getSpan(store, 'mapid_1')
|
|
5475
5260
|
* @param {object} store store: object - store object
|
|
5476
5261
|
* @param {string} mapId mapId: string - Id of the map
|
|
5477
|
-
* @returns {
|
|
5262
|
+
* @returns {Span} returnType: Span - span as an enum
|
|
5478
5263
|
*/
|
|
5479
|
-
var
|
|
5480
|
-
return store ? store.
|
|
5264
|
+
var getMapTimeSliderSpan = createSelector(getMapById, function (store) {
|
|
5265
|
+
return store ? store.timeSliderSpan : Span.Day;
|
|
5481
5266
|
});
|
|
5482
5267
|
/**
|
|
5483
5268
|
* Gets time step of a map
|
|
@@ -5505,6 +5290,17 @@ var getMapTimeStepWithoutDefault = createSelector(getMapById, function (store) {
|
|
|
5505
5290
|
var getMapAnimationDelay = createSelector(getMapById, function (store) {
|
|
5506
5291
|
return store ? store.animationDelay : defaultAnimationDelayAtStart;
|
|
5507
5292
|
});
|
|
5293
|
+
/**
|
|
5294
|
+
* Returns the width of time slider
|
|
5295
|
+
*
|
|
5296
|
+
* Example: timeSliderWith = getMapTimeSliderWidth(store, 'mapid_1')
|
|
5297
|
+
* @param {object} store store: object - store object
|
|
5298
|
+
* @param {string} mapId mapId: string - Id of the map
|
|
5299
|
+
* @returns {number} returnType: number - center time as a unix timestamp
|
|
5300
|
+
*/
|
|
5301
|
+
var getMapTimeSliderWidth = createSelector(getMapById, function (store) {
|
|
5302
|
+
return store ? store.timeSliderWidth : 0;
|
|
5303
|
+
});
|
|
5508
5304
|
/**
|
|
5509
5305
|
* Returns the center time of time slider
|
|
5510
5306
|
*
|
|
@@ -5537,18 +5333,7 @@ var getTimeSliderUnfilteredSelectedTime = createSelector(getMapById, function (s
|
|
|
5537
5333
|
* @returns {number} returnType: number - the number of seconds per pixel
|
|
5538
5334
|
*/
|
|
5539
5335
|
var getMapTimeSliderSecondsPerPx = createSelector(getMapById, function (store) {
|
|
5540
|
-
return store ? store.timeSliderSecondsPerPx :
|
|
5541
|
-
});
|
|
5542
|
-
/**
|
|
5543
|
-
* Returns the number of scale to seconds pixel on the time slider
|
|
5544
|
-
*
|
|
5545
|
-
* Example: dataScaleToSecondsPerPx = getMapTimeSliderDataScaleToSecondsPerPx(store, 'mapid_1')
|
|
5546
|
-
* @param {object} store store: object - store object
|
|
5547
|
-
* @param {string} mapId mapId: string - Id of the map
|
|
5548
|
-
* @returns {number} returnType: number - the number of scaleto seconds pixel
|
|
5549
|
-
*/
|
|
5550
|
-
var getMapTimeSliderDataScaleToSecondsPerPx = createSelector(getMapById, function (store) {
|
|
5551
|
-
return store ? store.timeSliderDataScaleToSecondsPerPx : defaultDataScaleToSecondsPerPx;
|
|
5336
|
+
return store ? store.timeSliderSecondsPerPx : defaultSecondsPerPx;
|
|
5552
5337
|
});
|
|
5553
5338
|
/**
|
|
5554
5339
|
* Returns map is timestep auto
|
|
@@ -5858,14 +5643,14 @@ var selectors = /*#__PURE__*/Object.freeze({
|
|
|
5858
5643
|
getActiveLayerId: getActiveLayerId,
|
|
5859
5644
|
getAutoUpdateLayerId: getAutoUpdateLayerId,
|
|
5860
5645
|
getAutoTimeStepLayerId: getAutoTimeStepLayerId,
|
|
5861
|
-
|
|
5646
|
+
getMapTimeSliderSpan: getMapTimeSliderSpan,
|
|
5862
5647
|
getMapTimeStep: getMapTimeStep,
|
|
5863
5648
|
getMapTimeStepWithoutDefault: getMapTimeStepWithoutDefault,
|
|
5864
5649
|
getMapAnimationDelay: getMapAnimationDelay,
|
|
5650
|
+
getMapTimeSliderWidth: getMapTimeSliderWidth,
|
|
5865
5651
|
getMapTimeSliderCenterTime: getMapTimeSliderCenterTime,
|
|
5866
5652
|
getTimeSliderUnfilteredSelectedTime: getTimeSliderUnfilteredSelectedTime,
|
|
5867
5653
|
getMapTimeSliderSecondsPerPx: getMapTimeSliderSecondsPerPx,
|
|
5868
|
-
getMapTimeSliderDataScaleToSecondsPerPx: getMapTimeSliderDataScaleToSecondsPerPx,
|
|
5869
5654
|
isTimestepAuto: isTimestepAuto,
|
|
5870
5655
|
isTimeSliderHoverOn: isTimeSliderHoverOn,
|
|
5871
5656
|
isZoomControlsVisible: isZoomControlsVisible,
|
|
@@ -5886,25 +5671,6 @@ var selectors = /*#__PURE__*/Object.freeze({
|
|
|
5886
5671
|
getDockedLayerManagerSize: getDockedLayerManagerSize
|
|
5887
5672
|
});
|
|
5888
5673
|
|
|
5889
|
-
var DialogTypes;
|
|
5890
|
-
(function (DialogTypes) {
|
|
5891
|
-
DialogTypes["LayerInfo"] = "layerInfo";
|
|
5892
|
-
DialogTypes["SyncGroups"] = "syncGroups";
|
|
5893
|
-
DialogTypes["TimeSeriesSelect"] = "timeSeriesSelect";
|
|
5894
|
-
DialogTypes["TimeSeriesManager"] = "timeSeriesManager";
|
|
5895
|
-
DialogTypes["KeywordFilter"] = "keywordFilter";
|
|
5896
|
-
DialogTypes["DimensionSelectEnsembleMember"] = "dimensionSelect-ensemble_member";
|
|
5897
|
-
DialogTypes["DimensionSelectElevation"] = "dimensionSelect-elevation";
|
|
5898
|
-
DialogTypes["LayerManager"] = "layerManager";
|
|
5899
|
-
DialogTypes["LayerSelect"] = "layerSelect";
|
|
5900
|
-
DialogTypes["DockedLayerManager"] = "dockedLayerManager";
|
|
5901
|
-
})(DialogTypes || (DialogTypes = {}));
|
|
5902
|
-
|
|
5903
|
-
var types = /*#__PURE__*/Object.freeze({
|
|
5904
|
-
__proto__: null,
|
|
5905
|
-
get DialogTypes () { return DialogTypes; }
|
|
5906
|
-
});
|
|
5907
|
-
|
|
5908
5674
|
/* *
|
|
5909
5675
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5910
5676
|
* you may not use this file except in compliance with the License.
|
|
@@ -5966,225 +5732,6 @@ var produceFilters = function produceFilters(filterNames, filterType, draft, lay
|
|
|
5966
5732
|
}
|
|
5967
5733
|
});
|
|
5968
5734
|
};
|
|
5969
|
-
|
|
5970
|
-
var layerSelectFilterAdapter = createEntityAdapter();
|
|
5971
|
-
var layerSelectActiveServicesAdapter = createEntityAdapter();
|
|
5972
|
-
var initialServicePopupState = {
|
|
5973
|
-
isOpen: false,
|
|
5974
|
-
url: '',
|
|
5975
|
-
serviceId: '',
|
|
5976
|
-
variant: 'add'
|
|
5977
|
-
};
|
|
5978
|
-
var initialState$3 = {
|
|
5979
|
-
filters: {
|
|
5980
|
-
searchFilter: '',
|
|
5981
|
-
activeServices: layerSelectActiveServicesAdapter.getInitialState(),
|
|
5982
|
-
filters: layerSelectFilterAdapter.getInitialState()
|
|
5983
|
-
},
|
|
5984
|
-
allServicesEnabled: true,
|
|
5985
|
-
activeLayerInfo: {
|
|
5986
|
-
name: '',
|
|
5987
|
-
title: '',
|
|
5988
|
-
leaf: true,
|
|
5989
|
-
path: [],
|
|
5990
|
-
serviceName: ''
|
|
5991
|
-
},
|
|
5992
|
-
servicePopup: initialServicePopupState
|
|
5993
|
-
};
|
|
5994
|
-
var slice$4 = createSlice({
|
|
5995
|
-
initialState: initialState$3,
|
|
5996
|
-
name: DialogTypes.LayerSelect,
|
|
5997
|
-
reducers: {
|
|
5998
|
-
setSearchFilter: function setSearchFilter(draft, action) {
|
|
5999
|
-
var filterText = action.payload.filterText;
|
|
6000
|
-
draft.filters.searchFilter = filterText;
|
|
6001
|
-
},
|
|
6002
|
-
setAllServicesEnabled: function setAllServicesEnabled(draft, action) {
|
|
6003
|
-
var allServicesEnabled = action.payload.allServicesEnabled;
|
|
6004
|
-
draft.allServicesEnabled = allServicesEnabled;
|
|
6005
|
-
},
|
|
6006
|
-
closeServicePopupOpen: function closeServicePopupOpen(draft) {
|
|
6007
|
-
draft.servicePopup.isOpen = false;
|
|
6008
|
-
},
|
|
6009
|
-
toggleServicePopup: function toggleServicePopup(draft, action) {
|
|
6010
|
-
var _action$payload = action.payload,
|
|
6011
|
-
variant = _action$payload.variant,
|
|
6012
|
-
isOpen = _action$payload.isOpen;
|
|
6013
|
-
draft.servicePopup.isOpen = isOpen;
|
|
6014
|
-
draft.servicePopup.url = action.payload.url ? action.payload.url : '';
|
|
6015
|
-
draft.servicePopup.variant = variant;
|
|
6016
|
-
draft.servicePopup.serviceId = action.payload.serviceId ? action.payload.serviceId : '';
|
|
6017
|
-
},
|
|
6018
|
-
layerSelectRemoveService: function layerSelectRemoveService(draft, action) {
|
|
6019
|
-
var serviceId = action.payload.serviceId;
|
|
6020
|
-
// 1. Find a service that is to be removed
|
|
6021
|
-
var foundService = draft.filters.activeServices.entities[serviceId];
|
|
6022
|
-
// 2. Go through all keywords for removed service, and decrement the amount of all found keywords
|
|
6023
|
-
foundService.filterIds.forEach(function (filterId) {
|
|
6024
|
-
var foundObject = draft.filters.filters.entities[filterId];
|
|
6025
|
-
if (foundObject && foundObject.amount) {
|
|
6026
|
-
foundObject.amount -= 1;
|
|
6027
|
-
foundObject.amountVisible -= 1;
|
|
6028
|
-
}
|
|
6029
|
-
if (foundObject && foundObject.amount === 0) {
|
|
6030
|
-
delete draft.filters.filters.entities[filterId];
|
|
6031
|
-
draft.filters.filters.ids = draft.filters.filters.ids.filter(function (serviceId) {
|
|
6032
|
-
return serviceId !== filterId;
|
|
6033
|
-
});
|
|
6034
|
-
}
|
|
6035
|
-
});
|
|
6036
|
-
// Finally remove object from activeServices, so if the service is added again later on, new object and keywords will be re-added
|
|
6037
|
-
layerSelectActiveServicesAdapter.removeOne(draft.filters.activeServices, serviceId);
|
|
6038
|
-
},
|
|
6039
|
-
enableActiveService: function enableActiveService(draft, action) {
|
|
6040
|
-
var _action$payload2 = action.payload,
|
|
6041
|
-
serviceId = _action$payload2.serviceId,
|
|
6042
|
-
keywords = _action$payload2.filters;
|
|
6043
|
-
draft.filters.activeServices.entities[serviceId].enabled = true;
|
|
6044
|
-
var _iterator = _createForOfIteratorHelper(keywords),
|
|
6045
|
-
_step;
|
|
6046
|
-
try {
|
|
6047
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6048
|
-
var keyword = _step.value;
|
|
6049
|
-
draft.filters.filters.entities[keyword].amountVisible += 1;
|
|
6050
|
-
}
|
|
6051
|
-
} catch (err) {
|
|
6052
|
-
_iterator.e(err);
|
|
6053
|
-
} finally {
|
|
6054
|
-
_iterator.f();
|
|
6055
|
-
}
|
|
6056
|
-
},
|
|
6057
|
-
disableActiveService: function disableActiveService(draft, action) {
|
|
6058
|
-
var _action$payload3 = action.payload,
|
|
6059
|
-
serviceId = _action$payload3.serviceId,
|
|
6060
|
-
keywords = _action$payload3.filters;
|
|
6061
|
-
draft.filters.activeServices.entities[serviceId].enabled = false;
|
|
6062
|
-
var _iterator2 = _createForOfIteratorHelper(keywords),
|
|
6063
|
-
_step2;
|
|
6064
|
-
try {
|
|
6065
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
6066
|
-
var keyword = _step2.value;
|
|
6067
|
-
draft.filters.filters.entities[keyword].amountVisible -= 1;
|
|
6068
|
-
}
|
|
6069
|
-
} catch (err) {
|
|
6070
|
-
_iterator2.e(err);
|
|
6071
|
-
} finally {
|
|
6072
|
-
_iterator2.f();
|
|
6073
|
-
}
|
|
6074
|
-
},
|
|
6075
|
-
toggleFilter: function toggleFilter(draft, action) {
|
|
6076
|
-
var filterIds = action.payload.filterIds;
|
|
6077
|
-
filterIds.forEach(function (filterId) {
|
|
6078
|
-
draft.filters.filters.entities[filterId].checked = !draft.filters.filters.entities[filterId].checked;
|
|
6079
|
-
});
|
|
6080
|
-
},
|
|
6081
|
-
enableOnlyOneFilter: function enableOnlyOneFilter(draft, action) {
|
|
6082
|
-
var filterId = action.payload.filterId;
|
|
6083
|
-
draft.filters.filters.ids.forEach(function (filterId) {
|
|
6084
|
-
draft.filters.filters.entities[filterId].checked = false;
|
|
6085
|
-
});
|
|
6086
|
-
draft.filters.filters.entities[filterId].checked = true;
|
|
6087
|
-
},
|
|
6088
|
-
setActiveLayerInfo: function setActiveLayerInfo(draft, action) {
|
|
6089
|
-
var layer = action.payload.layer;
|
|
6090
|
-
draft.activeLayerInfo = layer;
|
|
6091
|
-
}
|
|
6092
|
-
},
|
|
6093
|
-
extraReducers: function extraReducers(builder) {
|
|
6094
|
-
builder.addCase(serviceActions.serviceSetLayers, function (draft, action) {
|
|
6095
|
-
var _a, _b;
|
|
6096
|
-
var _action$payload4 = action.payload,
|
|
6097
|
-
serviceId = _action$payload4.id,
|
|
6098
|
-
serviceUrl = _action$payload4.serviceUrl,
|
|
6099
|
-
serviceName = _action$payload4.name,
|
|
6100
|
-
scope = _action$payload4.scope,
|
|
6101
|
-
_abstract = _action$payload4["abstract"],
|
|
6102
|
-
layers = _action$payload4.layers,
|
|
6103
|
-
isUpdating = _action$payload4.isUpdating;
|
|
6104
|
-
if (isUpdating) {
|
|
6105
|
-
return;
|
|
6106
|
-
}
|
|
6107
|
-
var keywords = layers.reduce(function (keywords, layer) {
|
|
6108
|
-
var _a;
|
|
6109
|
-
if (layer.leaf) {
|
|
6110
|
-
return keywords.concat((_a = layer.keywords) !== null && _a !== void 0 ? _a : []);
|
|
6111
|
-
}
|
|
6112
|
-
return keywords;
|
|
6113
|
-
}, []);
|
|
6114
|
-
var groups = layers.reduce(function (groups, layer) {
|
|
6115
|
-
var _a;
|
|
6116
|
-
if (layer.leaf) {
|
|
6117
|
-
return groups.concat((_a = layer.path) !== null && _a !== void 0 ? _a : []);
|
|
6118
|
-
}
|
|
6119
|
-
return groups;
|
|
6120
|
-
}, []);
|
|
6121
|
-
if (!((_b = (_a = draft.filters.activeServices.entities[serviceId]) === null || _a === void 0 ? void 0 : _a.filterIds) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
6122
|
-
// If the service has no filters yet, add them
|
|
6123
|
-
produceFilters(groups, FilterType.Group, draft, layerSelectFilterAdapter);
|
|
6124
|
-
produceFilters(keywords, FilterType.Keyword, draft, layerSelectFilterAdapter);
|
|
6125
|
-
}
|
|
6126
|
-
var filterIds = groups.map(function (group) {
|
|
6127
|
-
return getFilterId(FilterType.Group, group);
|
|
6128
|
-
}).concat(keywords.map(function (keyword) {
|
|
6129
|
-
return getFilterId(FilterType.Keyword, keyword);
|
|
6130
|
-
}));
|
|
6131
|
-
draft.filters.activeServices.entities[serviceId] = {
|
|
6132
|
-
serviceId: serviceId,
|
|
6133
|
-
enabled: draft.allServicesEnabled,
|
|
6134
|
-
filterIds: filterIds,
|
|
6135
|
-
scope: scope,
|
|
6136
|
-
serviceName: serviceName,
|
|
6137
|
-
serviceUrl: serviceUrl,
|
|
6138
|
-
"abstract": _abstract,
|
|
6139
|
-
isLoading: false
|
|
6140
|
-
};
|
|
6141
|
-
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
6142
|
-
draft.filters.activeServices.ids.push(serviceId);
|
|
6143
|
-
}
|
|
6144
|
-
}).addCase(serviceActions.fetchInitialServices, function (draft, action) {
|
|
6145
|
-
var services = action.payload.services;
|
|
6146
|
-
services.forEach(function (service) {
|
|
6147
|
-
var serviceId = service.id,
|
|
6148
|
-
serviceName = service.name,
|
|
6149
|
-
serviceUrl = service.serviceUrl,
|
|
6150
|
-
_abstract2 = service["abstract"],
|
|
6151
|
-
scope = service.scope;
|
|
6152
|
-
draft.filters.activeServices.entities[serviceId] = {
|
|
6153
|
-
serviceId: serviceId,
|
|
6154
|
-
enabled: draft.allServicesEnabled,
|
|
6155
|
-
filterIds: [],
|
|
6156
|
-
scope: scope,
|
|
6157
|
-
serviceName: serviceName,
|
|
6158
|
-
serviceUrl: serviceUrl,
|
|
6159
|
-
"abstract": _abstract2,
|
|
6160
|
-
isLoading: true
|
|
6161
|
-
};
|
|
6162
|
-
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
6163
|
-
draft.filters.activeServices.ids.push(serviceId);
|
|
6164
|
-
}
|
|
6165
|
-
});
|
|
6166
|
-
});
|
|
6167
|
-
}
|
|
6168
|
-
});
|
|
6169
|
-
var reducer$3 = slice$4.reducer;
|
|
6170
|
-
var layerSelectActions = slice$4.actions;
|
|
6171
|
-
|
|
6172
|
-
/* *
|
|
6173
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6174
|
-
* you may not use this file except in compliance with the License.
|
|
6175
|
-
* You may obtain a copy of the License at
|
|
6176
|
-
*
|
|
6177
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6178
|
-
*
|
|
6179
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
6180
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6181
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6182
|
-
* See the License for the specific language governing permissions and
|
|
6183
|
-
* limitations under the License.
|
|
6184
|
-
*
|
|
6185
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6186
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6187
|
-
* */
|
|
6188
5735
|
var filterLayersFromService = function filterLayersFromService(serviceId, services, filterIds, allFiltersActive, searchString) {
|
|
6189
5736
|
var mapStoreService = services[serviceId];
|
|
6190
5737
|
if (!mapStoreService) {
|
|
@@ -6223,6 +5770,208 @@ var filterLayersFromService = function filterLayersFromService(serviceId, servic
|
|
|
6223
5770
|
});
|
|
6224
5771
|
};
|
|
6225
5772
|
|
|
5773
|
+
var layerSelectFilterAdapter = createEntityAdapter();
|
|
5774
|
+
var layerSelectActiveServicesAdapter = createEntityAdapter();
|
|
5775
|
+
var initialServicePopupState = {
|
|
5776
|
+
isOpen: false,
|
|
5777
|
+
url: '',
|
|
5778
|
+
serviceId: '',
|
|
5779
|
+
variant: 'add'
|
|
5780
|
+
};
|
|
5781
|
+
var initialState$3 = {
|
|
5782
|
+
filters: {
|
|
5783
|
+
searchFilter: '',
|
|
5784
|
+
activeServices: layerSelectActiveServicesAdapter.getInitialState(),
|
|
5785
|
+
filters: layerSelectFilterAdapter.getInitialState()
|
|
5786
|
+
},
|
|
5787
|
+
allServicesEnabled: true,
|
|
5788
|
+
activeLayerInfo: {
|
|
5789
|
+
name: '',
|
|
5790
|
+
title: '',
|
|
5791
|
+
leaf: true,
|
|
5792
|
+
path: [],
|
|
5793
|
+
serviceName: ''
|
|
5794
|
+
},
|
|
5795
|
+
servicePopup: initialServicePopupState
|
|
5796
|
+
};
|
|
5797
|
+
var slice$4 = createSlice({
|
|
5798
|
+
initialState: initialState$3,
|
|
5799
|
+
name: DialogTypes.LayerSelect,
|
|
5800
|
+
reducers: {
|
|
5801
|
+
setSearchFilter: function setSearchFilter(draft, action) {
|
|
5802
|
+
var filterText = action.payload.filterText;
|
|
5803
|
+
draft.filters.searchFilter = filterText;
|
|
5804
|
+
},
|
|
5805
|
+
setAllServicesEnabled: function setAllServicesEnabled(draft, action) {
|
|
5806
|
+
var allServicesEnabled = action.payload.allServicesEnabled;
|
|
5807
|
+
draft.allServicesEnabled = allServicesEnabled;
|
|
5808
|
+
},
|
|
5809
|
+
closeServicePopupOpen: function closeServicePopupOpen(draft) {
|
|
5810
|
+
draft.servicePopup.isOpen = false;
|
|
5811
|
+
},
|
|
5812
|
+
toggleServicePopup: function toggleServicePopup(draft, action) {
|
|
5813
|
+
var _action$payload = action.payload,
|
|
5814
|
+
variant = _action$payload.variant,
|
|
5815
|
+
isOpen = _action$payload.isOpen;
|
|
5816
|
+
draft.servicePopup.isOpen = isOpen;
|
|
5817
|
+
draft.servicePopup.url = action.payload.url ? action.payload.url : '';
|
|
5818
|
+
draft.servicePopup.variant = variant;
|
|
5819
|
+
draft.servicePopup.serviceId = action.payload.serviceId ? action.payload.serviceId : '';
|
|
5820
|
+
},
|
|
5821
|
+
layerSelectRemoveService: function layerSelectRemoveService(draft, action) {
|
|
5822
|
+
var serviceId = action.payload.serviceId;
|
|
5823
|
+
// 1. Find a service that is to be removed
|
|
5824
|
+
var foundService = draft.filters.activeServices.entities[serviceId];
|
|
5825
|
+
// 2. Go through all keywords for removed service, and decrement the amount of all found keywords
|
|
5826
|
+
foundService.filterIds.forEach(function (filterId) {
|
|
5827
|
+
var foundObject = draft.filters.filters.entities[filterId];
|
|
5828
|
+
if (foundObject && foundObject.amount) {
|
|
5829
|
+
foundObject.amount -= 1;
|
|
5830
|
+
foundObject.amountVisible -= 1;
|
|
5831
|
+
}
|
|
5832
|
+
if (foundObject && foundObject.amount === 0) {
|
|
5833
|
+
delete draft.filters.filters.entities[filterId];
|
|
5834
|
+
draft.filters.filters.ids = draft.filters.filters.ids.filter(function (serviceId) {
|
|
5835
|
+
return serviceId !== filterId;
|
|
5836
|
+
});
|
|
5837
|
+
}
|
|
5838
|
+
});
|
|
5839
|
+
// Finally remove object from activeServices, so if the service is added again later on, new object and keywords will be re-added
|
|
5840
|
+
layerSelectActiveServicesAdapter.removeOne(draft.filters.activeServices, serviceId);
|
|
5841
|
+
},
|
|
5842
|
+
enableActiveService: function enableActiveService(draft, action) {
|
|
5843
|
+
var _action$payload2 = action.payload,
|
|
5844
|
+
serviceId = _action$payload2.serviceId,
|
|
5845
|
+
keywords = _action$payload2.filters;
|
|
5846
|
+
draft.filters.activeServices.entities[serviceId].enabled = true;
|
|
5847
|
+
var _iterator = _createForOfIteratorHelper(keywords),
|
|
5848
|
+
_step;
|
|
5849
|
+
try {
|
|
5850
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
5851
|
+
var keyword = _step.value;
|
|
5852
|
+
draft.filters.filters.entities[keyword].amountVisible += 1;
|
|
5853
|
+
}
|
|
5854
|
+
} catch (err) {
|
|
5855
|
+
_iterator.e(err);
|
|
5856
|
+
} finally {
|
|
5857
|
+
_iterator.f();
|
|
5858
|
+
}
|
|
5859
|
+
},
|
|
5860
|
+
disableActiveService: function disableActiveService(draft, action) {
|
|
5861
|
+
var _action$payload3 = action.payload,
|
|
5862
|
+
serviceId = _action$payload3.serviceId,
|
|
5863
|
+
keywords = _action$payload3.filters;
|
|
5864
|
+
draft.filters.activeServices.entities[serviceId].enabled = false;
|
|
5865
|
+
var _iterator2 = _createForOfIteratorHelper(keywords),
|
|
5866
|
+
_step2;
|
|
5867
|
+
try {
|
|
5868
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
5869
|
+
var keyword = _step2.value;
|
|
5870
|
+
draft.filters.filters.entities[keyword].amountVisible -= 1;
|
|
5871
|
+
}
|
|
5872
|
+
} catch (err) {
|
|
5873
|
+
_iterator2.e(err);
|
|
5874
|
+
} finally {
|
|
5875
|
+
_iterator2.f();
|
|
5876
|
+
}
|
|
5877
|
+
},
|
|
5878
|
+
toggleFilter: function toggleFilter(draft, action) {
|
|
5879
|
+
var filterIds = action.payload.filterIds;
|
|
5880
|
+
filterIds.forEach(function (filterId) {
|
|
5881
|
+
draft.filters.filters.entities[filterId].checked = !draft.filters.filters.entities[filterId].checked;
|
|
5882
|
+
});
|
|
5883
|
+
},
|
|
5884
|
+
enableOnlyOneFilter: function enableOnlyOneFilter(draft, action) {
|
|
5885
|
+
var filterId = action.payload.filterId;
|
|
5886
|
+
draft.filters.filters.ids.forEach(function (filterId) {
|
|
5887
|
+
draft.filters.filters.entities[filterId].checked = false;
|
|
5888
|
+
});
|
|
5889
|
+
draft.filters.filters.entities[filterId].checked = true;
|
|
5890
|
+
},
|
|
5891
|
+
setActiveLayerInfo: function setActiveLayerInfo(draft, action) {
|
|
5892
|
+
var layer = action.payload.layer;
|
|
5893
|
+
draft.activeLayerInfo = layer;
|
|
5894
|
+
}
|
|
5895
|
+
},
|
|
5896
|
+
extraReducers: function extraReducers(builder) {
|
|
5897
|
+
builder.addCase(serviceActions.serviceSetLayers, function (draft, action) {
|
|
5898
|
+
var _a, _b;
|
|
5899
|
+
var _action$payload4 = action.payload,
|
|
5900
|
+
serviceId = _action$payload4.id,
|
|
5901
|
+
serviceUrl = _action$payload4.serviceUrl,
|
|
5902
|
+
serviceName = _action$payload4.name,
|
|
5903
|
+
scope = _action$payload4.scope,
|
|
5904
|
+
_abstract = _action$payload4["abstract"],
|
|
5905
|
+
layers = _action$payload4.layers,
|
|
5906
|
+
isUpdating = _action$payload4.isUpdating;
|
|
5907
|
+
if (isUpdating) {
|
|
5908
|
+
return;
|
|
5909
|
+
}
|
|
5910
|
+
var keywords = layers.reduce(function (keywords, layer) {
|
|
5911
|
+
var _a;
|
|
5912
|
+
if (layer.leaf) {
|
|
5913
|
+
return keywords.concat((_a = layer.keywords) !== null && _a !== void 0 ? _a : []);
|
|
5914
|
+
}
|
|
5915
|
+
return keywords;
|
|
5916
|
+
}, []);
|
|
5917
|
+
var groups = layers.reduce(function (groups, layer) {
|
|
5918
|
+
var _a;
|
|
5919
|
+
if (layer.leaf) {
|
|
5920
|
+
return groups.concat((_a = layer.path) !== null && _a !== void 0 ? _a : []);
|
|
5921
|
+
}
|
|
5922
|
+
return groups;
|
|
5923
|
+
}, []);
|
|
5924
|
+
if (!((_b = (_a = draft.filters.activeServices.entities[serviceId]) === null || _a === void 0 ? void 0 : _a.filterIds) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
5925
|
+
// If the service has no filters yet, add them
|
|
5926
|
+
produceFilters(groups, FilterType.Group, draft, layerSelectFilterAdapter);
|
|
5927
|
+
produceFilters(keywords, FilterType.Keyword, draft, layerSelectFilterAdapter);
|
|
5928
|
+
}
|
|
5929
|
+
var filterIds = groups.map(function (group) {
|
|
5930
|
+
return getFilterId(FilterType.Group, group);
|
|
5931
|
+
}).concat(keywords.map(function (keyword) {
|
|
5932
|
+
return getFilterId(FilterType.Keyword, keyword);
|
|
5933
|
+
}));
|
|
5934
|
+
draft.filters.activeServices.entities[serviceId] = {
|
|
5935
|
+
serviceId: serviceId,
|
|
5936
|
+
enabled: draft.allServicesEnabled,
|
|
5937
|
+
filterIds: filterIds,
|
|
5938
|
+
scope: scope,
|
|
5939
|
+
serviceName: serviceName,
|
|
5940
|
+
serviceUrl: serviceUrl,
|
|
5941
|
+
"abstract": _abstract,
|
|
5942
|
+
isLoading: false
|
|
5943
|
+
};
|
|
5944
|
+
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
5945
|
+
draft.filters.activeServices.ids.push(serviceId);
|
|
5946
|
+
}
|
|
5947
|
+
}).addCase(serviceActions.fetchInitialServices, function (draft, action) {
|
|
5948
|
+
var services = action.payload.services;
|
|
5949
|
+
services.forEach(function (service) {
|
|
5950
|
+
var serviceId = service.id,
|
|
5951
|
+
serviceName = service.name,
|
|
5952
|
+
serviceUrl = service.serviceUrl,
|
|
5953
|
+
_abstract2 = service["abstract"],
|
|
5954
|
+
scope = service.scope;
|
|
5955
|
+
draft.filters.activeServices.entities[serviceId] = {
|
|
5956
|
+
serviceId: serviceId,
|
|
5957
|
+
enabled: draft.allServicesEnabled,
|
|
5958
|
+
filterIds: [],
|
|
5959
|
+
scope: scope,
|
|
5960
|
+
serviceName: serviceName,
|
|
5961
|
+
serviceUrl: serviceUrl,
|
|
5962
|
+
"abstract": _abstract2,
|
|
5963
|
+
isLoading: true
|
|
5964
|
+
};
|
|
5965
|
+
if (!draft.filters.activeServices.ids.includes(serviceId)) {
|
|
5966
|
+
draft.filters.activeServices.ids.push(serviceId);
|
|
5967
|
+
}
|
|
5968
|
+
});
|
|
5969
|
+
});
|
|
5970
|
+
}
|
|
5971
|
+
});
|
|
5972
|
+
var reducer$3 = slice$4.reducer;
|
|
5973
|
+
var layerSelectActions = slice$4.actions;
|
|
5974
|
+
|
|
6226
5975
|
/* *
|
|
6227
5976
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6228
5977
|
* you may not use this file except in compliance with the License.
|
|
@@ -7077,7 +6826,7 @@ var groupTypes = [{
|
|
|
7077
6826
|
- Fill arrays inside initialState with objects containing new values from Redux
|
|
7078
6827
|
*/
|
|
7079
6828
|
var createSyncGroupViewState = function createSyncGroupViewState(groups, sources) {
|
|
7080
|
-
var initialState = produce(emptyState, function (draft) {
|
|
6829
|
+
var initialState = produce$1(emptyState, function (draft) {
|
|
7081
6830
|
/*
|
|
7082
6831
|
_____ 1. Fill groups _____
|
|
7083
6832
|
1. Goes through all groups by ID
|
|
@@ -8871,7 +8620,7 @@ var LegendConnectComponent = function LegendConnectComponent(_ref) {
|
|
|
8871
8620
|
*
|
|
8872
8621
|
* Expects the following props:
|
|
8873
8622
|
* @param {boolean} showMapId (optional) showMapId: boolean - show the id of the map in the dialog title of which the legend is shown in te dialog
|
|
8874
|
-
* @param {Source} source (optional) source: Source - default is 'app', 'module' makes sure it will be shown on top of the module
|
|
8623
|
+
* @param {uiTypes.Source} source (optional) source: uiTypes.Source - default is 'app', 'module' makes sure it will be shown on top of the module
|
|
8875
8624
|
|
|
8876
8625
|
* ``` <LegendConnect legendDialogId={legendDialogId} />```
|
|
8877
8626
|
*/
|
|
@@ -13765,7 +13514,7 @@ var RenderLayers = function RenderLayers(_ref) {
|
|
|
13765
13514
|
_ref$isEnabled = _ref.isEnabled,
|
|
13766
13515
|
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled,
|
|
13767
13516
|
_ref$tooltipPrefix = _ref.tooltipPrefix,
|
|
13768
|
-
tooltipPrefix = _ref$tooltipPrefix === void 0 ? 'Layer: ' : _ref$tooltipPrefix;
|
|
13517
|
+
tooltipPrefix = _ref$tooltipPrefix === void 0 ? 'layerTypes.Layer: ' : _ref$tooltipPrefix;
|
|
13769
13518
|
var _a;
|
|
13770
13519
|
if (!layers || !layers.length) {
|
|
13771
13520
|
return /*#__PURE__*/React.createElement(Box$2, {
|
|
@@ -21102,6 +20851,367 @@ var AutoUpdateButton = function AutoUpdateButton(_ref) {
|
|
|
21102
20851
|
}));
|
|
21103
20852
|
};
|
|
21104
20853
|
|
|
20854
|
+
/* *
|
|
20855
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
20856
|
+
* you may not use this file except in compliance with the License.
|
|
20857
|
+
* You may obtain a copy of the License at
|
|
20858
|
+
*
|
|
20859
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
20860
|
+
*
|
|
20861
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20862
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20863
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20864
|
+
* See the License for the specific language governing permissions and
|
|
20865
|
+
* limitations under the License.
|
|
20866
|
+
*
|
|
20867
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
20868
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
20869
|
+
* */
|
|
20870
|
+
var millisecondsInSecond = 1000;
|
|
20871
|
+
var speedFactors = [0.1, 0.2, 0.5, 1, 2, 4, 8, 16]; // Declares available animation speed multipliers for default delay
|
|
20872
|
+
|
|
20873
|
+
var getSelectedTime = function getSelectedTime(timeDimension) {
|
|
20874
|
+
var currentValueIsValid = timeDimension && timeDimension.currentValue && moment.utc(timeDimension.currentValue).isValid();
|
|
20875
|
+
var selectedTime = currentValueIsValid && timeDimension ? moment.utc(timeDimension.currentValue).unix() : moment.utc().unix();
|
|
20876
|
+
return selectedTime;
|
|
20877
|
+
};
|
|
20878
|
+
/**
|
|
20879
|
+
* Returns time bounds from the given dimension. If no time dimension given, current time is returned as default
|
|
20880
|
+
*/
|
|
20881
|
+
var getTimeBounds = function getTimeBounds(dimensions) {
|
|
20882
|
+
var defaultStartEnd = moment.utc().set({
|
|
20883
|
+
second: 0,
|
|
20884
|
+
millisecond: 0
|
|
20885
|
+
}).unix();
|
|
20886
|
+
var timeDimension = dimensions === null || dimensions === void 0 ? void 0 : dimensions.find(function (dim) {
|
|
20887
|
+
return dim.name === 'time';
|
|
20888
|
+
});
|
|
20889
|
+
var startTime = timeDimension && timeDimension.minValue ? moment.utc(timeDimension.minValue).unix() : defaultStartEnd;
|
|
20890
|
+
var endTime = timeDimension && timeDimension.maxValue ? moment.utc(timeDimension.maxValue).unix() : defaultStartEnd;
|
|
20891
|
+
var selectedTime = getSelectedTime(timeDimension);
|
|
20892
|
+
return {
|
|
20893
|
+
selectedTime: selectedTime,
|
|
20894
|
+
startTime: startTime,
|
|
20895
|
+
endTime: endTime
|
|
20896
|
+
};
|
|
20897
|
+
};
|
|
20898
|
+
/**
|
|
20899
|
+
* Returns time bounds as *Moment* time instances from the given dimension. If no time dimension given, current time is returned as default
|
|
20900
|
+
*/
|
|
20901
|
+
var getMomentTimeBounds = function getMomentTimeBounds(dimensions) {
|
|
20902
|
+
var _getTimeBounds = getTimeBounds(dimensions),
|
|
20903
|
+
selectedTime = _getTimeBounds.selectedTime,
|
|
20904
|
+
startTime = _getTimeBounds.startTime,
|
|
20905
|
+
endTime = _getTimeBounds.endTime;
|
|
20906
|
+
return {
|
|
20907
|
+
selectedTime: moment.unix(selectedTime),
|
|
20908
|
+
startTime: moment.unix(startTime),
|
|
20909
|
+
endTime: moment.unix(endTime)
|
|
20910
|
+
};
|
|
20911
|
+
};
|
|
20912
|
+
var scalingCoefficient = function scalingCoefficient(end, start, width) {
|
|
20913
|
+
return width / (end - start);
|
|
20914
|
+
};
|
|
20915
|
+
var timestampToPixelEdges = function timestampToPixelEdges(timestamp, start, end, width) {
|
|
20916
|
+
return (timestamp - start) * scalingCoefficient(end, start, width);
|
|
20917
|
+
};
|
|
20918
|
+
var timestampToPixel = function timestampToPixel(timestamp, centerTime, widthPx, secondsPerPx) {
|
|
20919
|
+
return widthPx / 2 - (centerTime - timestamp) / secondsPerPx;
|
|
20920
|
+
};
|
|
20921
|
+
var pixelToTimestamp = function pixelToTimestamp(timePx, centerTime, widthPx, secondsPerPx) {
|
|
20922
|
+
return centerTime - (widthPx / 2 - timePx) * secondsPerPx;
|
|
20923
|
+
};
|
|
20924
|
+
var onsetNewDateDebounced = function onsetNewDateDebounced(dateToSet, onSetNewDate) {
|
|
20925
|
+
debounce(function () {
|
|
20926
|
+
onSetNewDate(dateToSet);
|
|
20927
|
+
}, 10, {
|
|
20928
|
+
leading: true
|
|
20929
|
+
})();
|
|
20930
|
+
};
|
|
20931
|
+
var setNewRoundedTime = function setNewRoundedTime(x, centerTime, width, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate) {
|
|
20932
|
+
var unixTime = pixelToTimestamp(x, centerTime, width, secondsPerPx);
|
|
20933
|
+
var roundedTime = roundWithTimeStep(unixTime, timeStep);
|
|
20934
|
+
var maxTime = Math.max(roundedTime, dataStartTime);
|
|
20935
|
+
var newTime = Math.min(maxTime, dataEndTime || roundedTime);
|
|
20936
|
+
var selectedTimeString = moment.unix(newTime).toISOString();
|
|
20937
|
+
onsetNewDateDebounced(selectedTimeString, onSetNewDate);
|
|
20938
|
+
};
|
|
20939
|
+
var getDataLimitsFromLayers = function getDataLimitsFromLayers(layers) {
|
|
20940
|
+
return layers.reduce(function (_ref, layer) {
|
|
20941
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
20942
|
+
start = _ref2[0],
|
|
20943
|
+
end = _ref2[1];
|
|
20944
|
+
var dimension = getWMJSTimeDimensionForLayerId(layer.id);
|
|
20945
|
+
if (dimension) {
|
|
20946
|
+
var lastValue = moment(dimension.getLastValue()).unix();
|
|
20947
|
+
var firstValue = moment(dimension.getFirstValue()).unix();
|
|
20948
|
+
var newLast = lastValue > end ? lastValue : end;
|
|
20949
|
+
var newFirst = firstValue < start ? firstValue : start;
|
|
20950
|
+
return [newFirst, newLast];
|
|
20951
|
+
}
|
|
20952
|
+
return [start, end];
|
|
20953
|
+
},
|
|
20954
|
+
/* Using the maximum 32-bit value and 0 as starting points
|
|
20955
|
+
* bigger values like Number.MAX_VALUE or Number.MAX_SAFE_INTEGER
|
|
20956
|
+
* cause weird behaviour as timestamps break at 32bit limit (year 2038)
|
|
20957
|
+
*/
|
|
20958
|
+
[2147483647, 0]);
|
|
20959
|
+
};
|
|
20960
|
+
var setPreviousTimeStep = function setPreviousTimeStep(timeStep, currentTime, dataStartTime, onSetNewDate) {
|
|
20961
|
+
var nextTime = currentTime - timeStep;
|
|
20962
|
+
var roundedTime = roundWithTimeStep(nextTime, timeStep, 'floor');
|
|
20963
|
+
var newTime = Math.max(roundedTime, dataStartTime || roundedTime);
|
|
20964
|
+
var selectedTimeString = moment.unix(newTime).toISOString();
|
|
20965
|
+
onsetNewDateDebounced(selectedTimeString, onSetNewDate);
|
|
20966
|
+
};
|
|
20967
|
+
var setNextTimeStep = function setNextTimeStep(timeStep, currentTime, dataEndTime, onSetNewDate) {
|
|
20968
|
+
var nextTime = currentTime + timeStep;
|
|
20969
|
+
var roundedTime = roundWithTimeStep(nextTime, timeStep, 'ceil');
|
|
20970
|
+
var newTime = Math.min(roundedTime, dataEndTime || roundedTime);
|
|
20971
|
+
var selectedTimeString = moment.unix(newTime).toISOString();
|
|
20972
|
+
onsetNewDateDebounced(selectedTimeString, onSetNewDate);
|
|
20973
|
+
};
|
|
20974
|
+
/**
|
|
20975
|
+
* updates unfiltered selected time and moves selected time a given distance
|
|
20976
|
+
* in pixels. Unfiltered selected time can be outside data data limits, but
|
|
20977
|
+
* selected time cannot.
|
|
20978
|
+
*/
|
|
20979
|
+
var moveSelectedTimePx = function moveSelectedTimePx(x, canvasWidth, centerTime, dataStartTime, dataEndTime, secondsPerPx, timeStep, unfilteredSelectedTime, setUnfilteredSelectedTime, onSetNewDate) {
|
|
20980
|
+
var _map = [dataStartTime, dataEndTime, unfilteredSelectedTime].map(function (timestamp) {
|
|
20981
|
+
return timestampToPixel(timestamp, centerTime, canvasWidth, secondsPerPx);
|
|
20982
|
+
}),
|
|
20983
|
+
_map2 = _slicedToArray(_map, 3),
|
|
20984
|
+
leftMarkerPx = _map2[0],
|
|
20985
|
+
rightMarkerPx = _map2[1],
|
|
20986
|
+
unfilteredSelectedTimePx = _map2[2];
|
|
20987
|
+
setUnfilteredSelectedTime(pixelToTimestamp(unfilteredSelectedTimePx + x, centerTime, canvasWidth, secondsPerPx));
|
|
20988
|
+
var clickedUnfilteredSelectedTimePx = unfilteredSelectedTimePx + x;
|
|
20989
|
+
var minClickedUnfilteredSelectedTimePx = Math.min(clickedUnfilteredSelectedTimePx, rightMarkerPx);
|
|
20990
|
+
var newUnfilteredSelectedTimePx = Math.max(minClickedUnfilteredSelectedTimePx, leftMarkerPx);
|
|
20991
|
+
setNewRoundedTime(newUnfilteredSelectedTimePx, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
|
|
20992
|
+
};
|
|
20993
|
+
/**
|
|
20994
|
+
* This function gets the length in seconds of the data layers
|
|
20995
|
+
* @param layers
|
|
20996
|
+
* @returns dataSpanSeconds,
|
|
20997
|
+
*/
|
|
20998
|
+
var getDataSpanSeconds = function getDataSpanSeconds(layers) {
|
|
20999
|
+
var _getDataLimitsFromLay = getDataLimitsFromLayers(layers),
|
|
21000
|
+
_getDataLimitsFromLay2 = _slicedToArray(_getDataLimitsFromLay, 2),
|
|
21001
|
+
dataStartTime = _getDataLimitsFromLay2[0],
|
|
21002
|
+
dataEndTime = _getDataLimitsFromLay2[1];
|
|
21003
|
+
var dataRegionInSeconds = dataEndTime - dataStartTime;
|
|
21004
|
+
return Math.floor(dataRegionInSeconds);
|
|
21005
|
+
};
|
|
21006
|
+
/**
|
|
21007
|
+
* This function creates and returns an array where there is secondsPerPx
|
|
21008
|
+
* number of the data set added for a data scale (secondsPerPx)
|
|
21009
|
+
* to secondsPerPxToScale.
|
|
21010
|
+
* @param secondsPerPx
|
|
21011
|
+
* @returns an array containing secondsPerPx numbers.
|
|
21012
|
+
* The secondsPerPx number for a data scale is included
|
|
21013
|
+
* contrary to secondsPerPxToScale.
|
|
21014
|
+
*/
|
|
21015
|
+
var secondsPerPxValues = function secondsPerPxValues(secondsPerPx) {
|
|
21016
|
+
var sortedSecondsPerPx = _toConsumableArray(secondsPerPxToScale).map(function (value) {
|
|
21017
|
+
return Number(value[0]);
|
|
21018
|
+
});
|
|
21019
|
+
var full = [].concat(_toConsumableArray(sortedSecondsPerPx), [secondsPerPx]);
|
|
21020
|
+
return full;
|
|
21021
|
+
};
|
|
21022
|
+
var secondsPerPxFromCanvasWidth = function secondsPerPxFromCanvasWidth(canvasWidth, spanInSeconds) {
|
|
21023
|
+
return spanInSeconds / canvasWidth;
|
|
21024
|
+
};
|
|
21025
|
+
var getNewCenterOfFixedPointZoom = function getNewCenterOfFixedPointZoom(fixedTimePoint, oldSecondsPerPx, newSecondsPerPx, oldCenterTime) {
|
|
21026
|
+
var centerToFixedPointPx = (fixedTimePoint - oldCenterTime) / oldSecondsPerPx;
|
|
21027
|
+
return fixedTimePoint - centerToFixedPointPx * newSecondsPerPx;
|
|
21028
|
+
};
|
|
21029
|
+
/**
|
|
21030
|
+
* Move the time slider such that a given time point (timePoint)
|
|
21031
|
+
* is at a given pixel width (timePointPx).
|
|
21032
|
+
* @returns a new center time for the resulting position
|
|
21033
|
+
*/
|
|
21034
|
+
var moveRelativeToTimePoint = function moveRelativeToTimePoint(timePoint, timePointPx, secondsPerPx, canvasWidth) {
|
|
21035
|
+
return timePoint - secondsPerPx * (timePointPx - canvasWidth / 2);
|
|
21036
|
+
};
|
|
21037
|
+
/** This reusable custom hook tells whether given pointer event targets current canvas node.
|
|
21038
|
+
* Example:
|
|
21039
|
+
*
|
|
21040
|
+
* const [isAllowedCanvasNodePointed, nodeRef] = useCanvasTarget('mousedown', false);
|
|
21041
|
+
* ...
|
|
21042
|
+
* return isAllowedCanvasNodePointed ? (<CanvasComponent ref={nodeRef}>Component with ref</CanvasComponent>) : (<CanvasComponent>Component with NO ref</CanvasComponent>);
|
|
21043
|
+
* ...
|
|
21044
|
+
*/
|
|
21045
|
+
var useCanvasTarget = function useCanvasTarget(eventType) {
|
|
21046
|
+
var nodeRef = React__default.useRef(null);
|
|
21047
|
+
var _React$useState = React__default.useState(false),
|
|
21048
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
21049
|
+
isTargetNode = _React$useState2[0],
|
|
21050
|
+
setTargetNode = _React$useState2[1];
|
|
21051
|
+
// Check if pointer event targets current node element
|
|
21052
|
+
var pointerEventListener = React__default.useCallback(function (event) {
|
|
21053
|
+
setTargetNode(nodeRef.current.canvas ? nodeRef.current.canvas.isEqualNode(event.target) : false);
|
|
21054
|
+
}, [nodeRef]);
|
|
21055
|
+
React__default.useEffect(function () {
|
|
21056
|
+
document.addEventListener(eventType, pointerEventListener);
|
|
21057
|
+
return function () {
|
|
21058
|
+
return document.removeEventListener(eventType, pointerEventListener);
|
|
21059
|
+
};
|
|
21060
|
+
}, [eventType, pointerEventListener]); // Only add/remove event listener when listener really changes, that is, NOT necessarily between every re-render.
|
|
21061
|
+
return [isTargetNode, nodeRef];
|
|
21062
|
+
};
|
|
21063
|
+
var needleGeom = {
|
|
21064
|
+
smallWidth: 126,
|
|
21065
|
+
largeWidth: 167,
|
|
21066
|
+
height: 24,
|
|
21067
|
+
cornerRadius: 5,
|
|
21068
|
+
lineWidth: 1
|
|
21069
|
+
};
|
|
21070
|
+
var AUTO_MOVE_AREA_PADDING = 1;
|
|
21071
|
+
var getAutoMoveAreaWidth = function getAutoMoveAreaWidth(scale) {
|
|
21072
|
+
return (scale === Scale.Year ? needleGeom.largeWidth : needleGeom.smallWidth) / 2 + AUTO_MOVE_AREA_PADDING;
|
|
21073
|
+
};
|
|
21074
|
+
/** Reusable business logic for how to handle events that set time to now (closest).
|
|
21075
|
+
* Used in NowButton and TimeSliderLegend.
|
|
21076
|
+
*/
|
|
21077
|
+
var handleSetNowEvent = function handleSetNowEvent(timeStep, dataStartTime, dataEndTime, currentTime, onSetNewDate, onSetCenterTime) {
|
|
21078
|
+
if (dataStartTime < dataEndTime) {
|
|
21079
|
+
if (dataEndTime < currentTime) {
|
|
21080
|
+
onSetNewDate(moment.utc(dataEndTime * millisecondsInSecond).toISOString());
|
|
21081
|
+
onSetCenterTime(dataEndTime);
|
|
21082
|
+
} else if (dataStartTime > currentTime) {
|
|
21083
|
+
onSetNewDate(moment.utc(dataStartTime * millisecondsInSecond).toISOString());
|
|
21084
|
+
onSetCenterTime(dataStartTime);
|
|
21085
|
+
} else {
|
|
21086
|
+
var closestToCurrent = roundWithTimeStep(currentTime, timeStep);
|
|
21087
|
+
onSetNewDate(moment.utc(closestToCurrent * millisecondsInSecond).toISOString());
|
|
21088
|
+
onSetCenterTime(closestToCurrent);
|
|
21089
|
+
}
|
|
21090
|
+
}
|
|
21091
|
+
};
|
|
21092
|
+
var TimeInMinutes;
|
|
21093
|
+
(function (TimeInMinutes) {
|
|
21094
|
+
TimeInMinutes[TimeInMinutes["YEAR"] = 525600] = "YEAR";
|
|
21095
|
+
TimeInMinutes[TimeInMinutes["MONTH"] = 43800] = "MONTH";
|
|
21096
|
+
TimeInMinutes[TimeInMinutes["DAY"] = 1440] = "DAY";
|
|
21097
|
+
TimeInMinutes[TimeInMinutes["HOUR"] = 60] = "HOUR";
|
|
21098
|
+
TimeInMinutes[TimeInMinutes["MINUTE"] = 1] = "MINUTE";
|
|
21099
|
+
})(TimeInMinutes || (TimeInMinutes = {}));
|
|
21100
|
+
/**
|
|
21101
|
+
*
|
|
21102
|
+
* @param minutes
|
|
21103
|
+
* @returns the two highest values in the format yr(s) mo(s) d h m
|
|
21104
|
+
*/
|
|
21105
|
+
var minutesToDescribedDuration = function minutesToDescribedDuration(minutes) {
|
|
21106
|
+
var units = [{
|
|
21107
|
+
label: 'yr',
|
|
21108
|
+
value: TimeInMinutes.YEAR,
|
|
21109
|
+
plural: 's'
|
|
21110
|
+
}, {
|
|
21111
|
+
label: 'mo',
|
|
21112
|
+
value: TimeInMinutes.MONTH,
|
|
21113
|
+
plural: 's'
|
|
21114
|
+
}, {
|
|
21115
|
+
label: 'd',
|
|
21116
|
+
value: TimeInMinutes.DAY
|
|
21117
|
+
}, {
|
|
21118
|
+
label: 'h',
|
|
21119
|
+
value: TimeInMinutes.HOUR
|
|
21120
|
+
}, {
|
|
21121
|
+
label: 'm',
|
|
21122
|
+
value: TimeInMinutes.MINUTE
|
|
21123
|
+
}];
|
|
21124
|
+
var durations = units.reduce(function (units, duration) {
|
|
21125
|
+
var min = units.min,
|
|
21126
|
+
time = units.time,
|
|
21127
|
+
count = units.count;
|
|
21128
|
+
var label = duration.label,
|
|
21129
|
+
value = duration.value,
|
|
21130
|
+
_duration$plural = duration.plural,
|
|
21131
|
+
plural = _duration$plural === void 0 ? '' : _duration$plural;
|
|
21132
|
+
var unit = Math.floor(min / value);
|
|
21133
|
+
if (unit > 0 && count < 2) {
|
|
21134
|
+
return {
|
|
21135
|
+
time: "".concat(time).concat(unit).concat(label).concat(unit > 1 ? plural : '', " "),
|
|
21136
|
+
min: min - unit * value,
|
|
21137
|
+
count: count + 1
|
|
21138
|
+
};
|
|
21139
|
+
}
|
|
21140
|
+
return {
|
|
21141
|
+
min: min,
|
|
21142
|
+
time: time,
|
|
21143
|
+
count: count
|
|
21144
|
+
};
|
|
21145
|
+
}, {
|
|
21146
|
+
min: minutes,
|
|
21147
|
+
time: '',
|
|
21148
|
+
count: 0
|
|
21149
|
+
});
|
|
21150
|
+
return durations.time.trim();
|
|
21151
|
+
};
|
|
21152
|
+
// For a data scale an appropriate fundamental scale is chosen
|
|
21153
|
+
// depending on secondsPerPx of data. When a time range of
|
|
21154
|
+
// data is for example many months. the fundamental scale mapEnums.Scale.Year
|
|
21155
|
+
// is chosen here and the legend of the time slider is drawn in the
|
|
21156
|
+
// same as if otiginally a year scale would have been chose.
|
|
21157
|
+
//
|
|
21158
|
+
// If a time range of data is a few weeks, mapEnums.Scale.Month is chosen. So, all
|
|
21159
|
+
// the time range of data can be shown in the window.
|
|
21160
|
+
var getFundamentalScale$1 = function getFundamentalScale(secondsPerPx) {
|
|
21161
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Month]) {
|
|
21162
|
+
return Scale.Year;
|
|
21163
|
+
}
|
|
21164
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Week]) {
|
|
21165
|
+
return Scale.Month;
|
|
21166
|
+
}
|
|
21167
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Day]) {
|
|
21168
|
+
return Scale.Week;
|
|
21169
|
+
}
|
|
21170
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Hours6]) {
|
|
21171
|
+
return Scale.Day;
|
|
21172
|
+
}
|
|
21173
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Hours3]) {
|
|
21174
|
+
return Scale.Hours6;
|
|
21175
|
+
}
|
|
21176
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Hour]) {
|
|
21177
|
+
return Scale.Hours3;
|
|
21178
|
+
}
|
|
21179
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Minutes5]) {
|
|
21180
|
+
return Scale.Hour;
|
|
21181
|
+
}
|
|
21182
|
+
return Scale.Minutes5;
|
|
21183
|
+
};
|
|
21184
|
+
|
|
21185
|
+
var timeSliderUtils = /*#__PURE__*/Object.freeze({
|
|
21186
|
+
__proto__: null,
|
|
21187
|
+
getSelectedTime: getSelectedTime,
|
|
21188
|
+
getTimeBounds: getTimeBounds,
|
|
21189
|
+
getMomentTimeBounds: getMomentTimeBounds,
|
|
21190
|
+
scalingCoefficient: scalingCoefficient,
|
|
21191
|
+
timestampToPixelEdges: timestampToPixelEdges,
|
|
21192
|
+
timestampToPixel: timestampToPixel,
|
|
21193
|
+
pixelToTimestamp: pixelToTimestamp,
|
|
21194
|
+
onsetNewDateDebounced: onsetNewDateDebounced,
|
|
21195
|
+
setNewRoundedTime: setNewRoundedTime,
|
|
21196
|
+
getDataLimitsFromLayers: getDataLimitsFromLayers,
|
|
21197
|
+
setPreviousTimeStep: setPreviousTimeStep,
|
|
21198
|
+
setNextTimeStep: setNextTimeStep,
|
|
21199
|
+
moveSelectedTimePx: moveSelectedTimePx,
|
|
21200
|
+
getDataSpanSeconds: getDataSpanSeconds,
|
|
21201
|
+
secondsPerPxValues: secondsPerPxValues,
|
|
21202
|
+
secondsPerPxFromCanvasWidth: secondsPerPxFromCanvasWidth,
|
|
21203
|
+
getNewCenterOfFixedPointZoom: getNewCenterOfFixedPointZoom,
|
|
21204
|
+
moveRelativeToTimePoint: moveRelativeToTimePoint,
|
|
21205
|
+
useCanvasTarget: useCanvasTarget,
|
|
21206
|
+
needleGeom: needleGeom,
|
|
21207
|
+
AUTO_MOVE_AREA_PADDING: AUTO_MOVE_AREA_PADDING,
|
|
21208
|
+
getAutoMoveAreaWidth: getAutoMoveAreaWidth,
|
|
21209
|
+
handleSetNowEvent: handleSetNowEvent,
|
|
21210
|
+
get TimeInMinutes () { return TimeInMinutes; },
|
|
21211
|
+
minutesToDescribedDuration: minutesToDescribedDuration,
|
|
21212
|
+
getFundamentalScale: getFundamentalScale$1
|
|
21213
|
+
});
|
|
21214
|
+
|
|
21105
21215
|
var THROTTLE_WAIT_TIME = 300; // [ms]
|
|
21106
21216
|
var THROTTLE_OPTIONS = {
|
|
21107
21217
|
trailing: false // Invoke function when called, but not more than once every <THROTTLE_WAIT_TIME>.
|
|
@@ -21429,69 +21539,86 @@ var TimeStepButton = function TimeStepButton(_ref) {
|
|
|
21429
21539
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
21430
21540
|
* */
|
|
21431
21541
|
var marks$1 = [{
|
|
21432
|
-
label: '5 min',
|
|
21433
|
-
value: Scale.Minutes5,
|
|
21434
|
-
text: '5m'
|
|
21435
|
-
}, {
|
|
21436
21542
|
label: '1 h',
|
|
21437
|
-
value:
|
|
21543
|
+
value: Span.Hour,
|
|
21438
21544
|
text: '1h'
|
|
21439
21545
|
}, {
|
|
21440
21546
|
label: '3 h',
|
|
21441
|
-
value:
|
|
21547
|
+
value: Span.Hours3,
|
|
21442
21548
|
text: '3h'
|
|
21443
21549
|
}, {
|
|
21444
21550
|
label: '6 h',
|
|
21445
|
-
value:
|
|
21551
|
+
value: Span.Hours6,
|
|
21446
21552
|
text: '6h'
|
|
21553
|
+
}, {
|
|
21554
|
+
label: '12 h',
|
|
21555
|
+
value: Span.Hours12,
|
|
21556
|
+
text: '12h'
|
|
21447
21557
|
}, {
|
|
21448
21558
|
label: 'day',
|
|
21449
|
-
value:
|
|
21559
|
+
value: Span.Day,
|
|
21450
21560
|
text: 'd'
|
|
21561
|
+
}, {
|
|
21562
|
+
label: '2 days',
|
|
21563
|
+
value: Span.Days2,
|
|
21564
|
+
text: '2d'
|
|
21451
21565
|
}, {
|
|
21452
21566
|
label: 'week',
|
|
21453
|
-
value:
|
|
21567
|
+
value: Span.Week,
|
|
21454
21568
|
text: 'w'
|
|
21569
|
+
}, {
|
|
21570
|
+
label: '2 weeks',
|
|
21571
|
+
value: Span.Weeks2,
|
|
21572
|
+
text: '2w'
|
|
21455
21573
|
}, {
|
|
21456
21574
|
label: 'month',
|
|
21457
|
-
value:
|
|
21575
|
+
value: Span.Month,
|
|
21576
|
+
text: 'm'
|
|
21577
|
+
}, {
|
|
21578
|
+
label: '3 months',
|
|
21579
|
+
value: Span.Months3,
|
|
21458
21580
|
text: 'm'
|
|
21459
21581
|
}, {
|
|
21460
21582
|
label: 'year',
|
|
21461
|
-
value:
|
|
21583
|
+
value: Span.Year,
|
|
21462
21584
|
text: 'y'
|
|
21463
21585
|
}, {
|
|
21464
21586
|
label: 'data',
|
|
21465
|
-
value:
|
|
21587
|
+
value: Span.DataSpan,
|
|
21466
21588
|
text: 'data'
|
|
21467
21589
|
}].sort(function (a, b) {
|
|
21468
21590
|
return b.value - a.value;
|
|
21469
21591
|
});
|
|
21470
|
-
var
|
|
21592
|
+
var TimeSpanButton = function TimeSpanButton(_ref) {
|
|
21471
21593
|
var layers = _ref.layers,
|
|
21472
|
-
_ref$
|
|
21473
|
-
|
|
21594
|
+
_ref$timeSliderSpan = _ref.timeSliderSpan,
|
|
21595
|
+
timeSliderSpan = _ref$timeSliderSpan === void 0 ? Span.Day : _ref$timeSliderSpan,
|
|
21474
21596
|
centerTime = _ref.centerTime,
|
|
21475
21597
|
secondsPerPx = _ref.secondsPerPx,
|
|
21476
21598
|
selectedTime = _ref.selectedTime,
|
|
21477
|
-
|
|
21599
|
+
timeSliderWidth = _ref.timeSliderWidth,
|
|
21600
|
+
onChangeTimeSliderSpan = _ref.onChangeTimeSliderSpan,
|
|
21601
|
+
_ref$isOpenByDefault = _ref.isOpenByDefault,
|
|
21602
|
+
isOpenByDefault = _ref$isOpenByDefault === void 0 ? false : _ref$isOpenByDefault;
|
|
21478
21603
|
var onChangeSliderValue = function onChangeSliderValue(mark) {
|
|
21479
21604
|
var newSliderValue = mark.value;
|
|
21480
21605
|
var newValue = newSliderValue ? Math.round(newSliderValue) : 0;
|
|
21481
|
-
var
|
|
21606
|
+
var newSpan = marks$1.find(function (el) {
|
|
21482
21607
|
return el.value === newValue;
|
|
21483
21608
|
}).value;
|
|
21484
|
-
var
|
|
21485
|
-
var
|
|
21486
|
-
|
|
21609
|
+
var spanInSeconds = newSpan === Span.DataSpan ? getDataSpanSeconds(layers) : spanToSeconds[newSpan];
|
|
21610
|
+
var newSecondsPerPx = secondsPerPxFromCanvasWidth(timeSliderWidth, spanInSeconds);
|
|
21611
|
+
var newCenterTime = getNewCenterOfFixedPointZoom(selectedTime, secondsPerPx, newSecondsPerPx, centerTime);
|
|
21612
|
+
onChangeTimeSliderSpan(newSpan, newCenterTime, newSecondsPerPx);
|
|
21487
21613
|
};
|
|
21488
21614
|
return /*#__PURE__*/React.createElement(TimeSliderMenu, {
|
|
21489
21615
|
handleMenuItemClick: onChangeSliderValue,
|
|
21490
21616
|
icon: /*#__PURE__*/React.createElement(Clock, null),
|
|
21491
21617
|
marks: marks$1,
|
|
21492
|
-
title: "Time
|
|
21493
|
-
value:
|
|
21494
|
-
onChangeMouseWheel: onChangeSliderValue
|
|
21618
|
+
title: "Time span",
|
|
21619
|
+
value: timeSliderSpan,
|
|
21620
|
+
onChangeMouseWheel: onChangeSliderValue,
|
|
21621
|
+
isOpenByDefault: isOpenByDefault
|
|
21495
21622
|
});
|
|
21496
21623
|
};
|
|
21497
21624
|
|
|
@@ -21629,7 +21756,7 @@ var OptionsMenu = function OptionsMenu(_ref) {
|
|
|
21629
21756
|
var autoUpdateBtn = _ref.autoUpdateBtn,
|
|
21630
21757
|
nowBtn = _ref.nowBtn,
|
|
21631
21758
|
speedBtn = _ref.speedBtn,
|
|
21632
|
-
|
|
21759
|
+
timeSpanBtn = _ref.timeSpanBtn,
|
|
21633
21760
|
timeStepBtn = _ref.timeStepBtn,
|
|
21634
21761
|
animationLengthBtn = _ref.animationLengthBtn;
|
|
21635
21762
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -21638,12 +21765,13 @@ var OptionsMenu = function OptionsMenu(_ref) {
|
|
|
21638
21765
|
}, nowBtn || /*#__PURE__*/React__default.createElement(NowButton, null)), /*#__PURE__*/React__default.createElement(Grid, {
|
|
21639
21766
|
item: true,
|
|
21640
21767
|
xs: "auto"
|
|
21641
|
-
},
|
|
21768
|
+
}, timeSpanBtn || /*#__PURE__*/React__default.createElement(TimeSpanButton, {
|
|
21642
21769
|
centerTime: 0,
|
|
21643
|
-
|
|
21770
|
+
onChangeTimeSliderSpan: function onChangeTimeSliderSpan() {},
|
|
21644
21771
|
secondsPerPx: 0,
|
|
21645
21772
|
selectedTime: 0,
|
|
21646
|
-
|
|
21773
|
+
timeSliderSpan: 0,
|
|
21774
|
+
timeSliderWidth: 0
|
|
21647
21775
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
21648
21776
|
item: true,
|
|
21649
21777
|
xs: "auto"
|
|
@@ -21672,7 +21800,7 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
|
|
|
21672
21800
|
autoUpdateBtn = _ref.autoUpdateBtn,
|
|
21673
21801
|
speedBtn = _ref.speedBtn,
|
|
21674
21802
|
timeStepBtn = _ref.timeStepBtn,
|
|
21675
|
-
|
|
21803
|
+
timeSpanBtn = _ref.timeSpanBtn,
|
|
21676
21804
|
animationLengthBtn = _ref.animationLengthBtn,
|
|
21677
21805
|
_ref$isOpenByDefault = _ref.isOpenByDefault,
|
|
21678
21806
|
isOpenByDefault = _ref$isOpenByDefault === void 0 ? false : _ref$isOpenByDefault;
|
|
@@ -21726,7 +21854,7 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
|
|
|
21726
21854
|
spacing: 1
|
|
21727
21855
|
}, /*#__PURE__*/React__default.createElement(OptionsMenu, {
|
|
21728
21856
|
nowBtn: nowBtn,
|
|
21729
|
-
|
|
21857
|
+
timeSpanBtn: timeSpanBtn,
|
|
21730
21858
|
timeStepBtn: timeStepBtn,
|
|
21731
21859
|
speedBtn: speedBtn,
|
|
21732
21860
|
animationLengthBtn: animationLengthBtn,
|
|
@@ -21884,90 +22012,6 @@ var TICK_MARK_HEIGHT_PRIMARY = 40;
|
|
|
21884
22012
|
var TICK_MARK_HEIGHT_SECONDARY = 10;
|
|
21885
22013
|
var TICK_MARK_HEIGHT_TERTIARY = 5;
|
|
21886
22014
|
var getStepPxLineHeight = function getStepPxLineHeight(scale, timestep) {
|
|
21887
|
-
if ([Scale.Hour, Scale.Hours3, Scale.Hours6, Scale.Day].includes(scale)) {
|
|
21888
|
-
var scaleUnitSeconds = scaleToUnitSeconds[scale];
|
|
21889
|
-
var rem = timestep % scaleUnitSeconds;
|
|
21890
|
-
switch (scale) {
|
|
21891
|
-
case Scale.Hour:
|
|
21892
|
-
{
|
|
21893
|
-
if (rem === 0) {
|
|
21894
|
-
return TICK_MARK_HEIGHT_PRIMARY;
|
|
21895
|
-
}
|
|
21896
|
-
// 15 min subdivisions
|
|
21897
|
-
if (rem % (15 * 60) === 0) {
|
|
21898
|
-
return TICK_MARK_HEIGHT_SECONDARY;
|
|
21899
|
-
}
|
|
21900
|
-
return TICK_MARK_HEIGHT_TERTIARY;
|
|
21901
|
-
}
|
|
21902
|
-
case Scale.Hours3:
|
|
21903
|
-
{
|
|
21904
|
-
if (rem === 0) {
|
|
21905
|
-
return TICK_MARK_HEIGHT_PRIMARY;
|
|
21906
|
-
}
|
|
21907
|
-
return TICK_MARK_HEIGHT_TERTIARY;
|
|
21908
|
-
}
|
|
21909
|
-
case Scale.Hours6:
|
|
21910
|
-
{
|
|
21911
|
-
if (rem === 0) {
|
|
21912
|
-
return TICK_MARK_HEIGHT_PRIMARY;
|
|
21913
|
-
}
|
|
21914
|
-
// 3 hour subdivisions
|
|
21915
|
-
if (rem % (3 * 60 * 60) === 0) {
|
|
21916
|
-
return TICK_MARK_HEIGHT_SECONDARY;
|
|
21917
|
-
}
|
|
21918
|
-
return TICK_MARK_HEIGHT_TERTIARY;
|
|
21919
|
-
}
|
|
21920
|
-
default:
|
|
21921
|
-
{
|
|
21922
|
-
// Scale.Day
|
|
21923
|
-
if (rem === 0) {
|
|
21924
|
-
return TICK_MARK_HEIGHT_PRIMARY;
|
|
21925
|
-
}
|
|
21926
|
-
// 6 hour subdivisions
|
|
21927
|
-
if (rem % (6 * 60 * 60) === 0) {
|
|
21928
|
-
return TICK_MARK_HEIGHT_SECONDARY;
|
|
21929
|
-
}
|
|
21930
|
-
return TICK_MARK_HEIGHT_TERTIARY;
|
|
21931
|
-
}
|
|
21932
|
-
}
|
|
21933
|
-
} else {
|
|
21934
|
-
switch (scale) {
|
|
21935
|
-
case Scale.Week:
|
|
21936
|
-
{
|
|
21937
|
-
var weekday = moment.unix(timestep).utc().isoWeekday();
|
|
21938
|
-
// momentjs isoWeekdays range from 1(Monday) to 7(Sunday)
|
|
21939
|
-
if (weekday === 1) {
|
|
21940
|
-
return TICK_MARK_HEIGHT_PRIMARY;
|
|
21941
|
-
}
|
|
21942
|
-
return TICK_MARK_HEIGHT_TERTIARY;
|
|
21943
|
-
}
|
|
21944
|
-
case Scale.Year:
|
|
21945
|
-
{
|
|
21946
|
-
var month = moment.unix(timestep).utc().month();
|
|
21947
|
-
// momentjs months are zero indexed
|
|
21948
|
-
if (month === 0) {
|
|
21949
|
-
return TICK_MARK_HEIGHT_PRIMARY;
|
|
21950
|
-
}
|
|
21951
|
-
if (month % 3 === 0) {
|
|
21952
|
-
return TICK_MARK_HEIGHT_SECONDARY;
|
|
21953
|
-
}
|
|
21954
|
-
return TICK_MARK_HEIGHT_TERTIARY;
|
|
21955
|
-
}
|
|
21956
|
-
case Scale.Minutes5:
|
|
21957
|
-
{
|
|
21958
|
-
// add primary line on day change
|
|
21959
|
-
if (timestep % (60 * 60 * 24) === 0) {
|
|
21960
|
-
return TICK_MARK_HEIGHT_PRIMARY;
|
|
21961
|
-
}
|
|
21962
|
-
return TICK_MARK_HEIGHT_TERTIARY;
|
|
21963
|
-
}
|
|
21964
|
-
default:
|
|
21965
|
-
// Scale.Month
|
|
21966
|
-
return TICK_MARK_HEIGHT_TERTIARY;
|
|
21967
|
-
}
|
|
21968
|
-
}
|
|
21969
|
-
};
|
|
21970
|
-
var getStepPxLineHeightForDataScale = function getStepPxLineHeightForDataScale(scale, timestep) {
|
|
21971
22015
|
var scaleUnitSeconds = scaleToUnitSeconds[scale];
|
|
21972
22016
|
var rem = timestep % scaleUnitSeconds;
|
|
21973
22017
|
switch (scale) {
|
|
@@ -22027,6 +22071,9 @@ var getStepPxLineHeightForDataScale = function getStepPxLineHeightForDataScale(s
|
|
|
22027
22071
|
if (month === 0) {
|
|
22028
22072
|
return TICK_MARK_HEIGHT_PRIMARY;
|
|
22029
22073
|
}
|
|
22074
|
+
if (month % 3 === 0) {
|
|
22075
|
+
return TICK_MARK_HEIGHT_SECONDARY;
|
|
22076
|
+
}
|
|
22030
22077
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
22031
22078
|
}
|
|
22032
22079
|
case Scale.Minutes5:
|
|
@@ -22038,15 +22085,15 @@ var getStepPxLineHeightForDataScale = function getStepPxLineHeightForDataScale(s
|
|
|
22038
22085
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
22039
22086
|
}
|
|
22040
22087
|
default:
|
|
22041
|
-
// Scale.Month
|
|
22088
|
+
// mapEnums.Scale.Month
|
|
22042
22089
|
return TICK_MARK_HEIGHT_TERTIARY;
|
|
22043
22090
|
}
|
|
22044
22091
|
};
|
|
22045
|
-
var drawStepPxLine = function drawStepPxLine(ctx, theme, stepPx, height,
|
|
22092
|
+
var drawStepPxLine = function drawStepPxLine(ctx, theme, stepPx, height, fundamentalScale, timestep) {
|
|
22046
22093
|
var ctx2 = ctx;
|
|
22047
22094
|
ctx2.strokeStyle = theme.palette.geowebColors.timeSlider.timelineTimeScale.fill;
|
|
22048
22095
|
ctx2.lineWidth = 1;
|
|
22049
|
-
var stepPxLineHeight =
|
|
22096
|
+
var stepPxLineHeight = getStepPxLineHeight(fundamentalScale, timestep);
|
|
22050
22097
|
ctx2.beginPath();
|
|
22051
22098
|
ctx2.moveTo(stepPx, height - stepPxLineHeight);
|
|
22052
22099
|
ctx2.lineTo(stepPx, height);
|
|
@@ -22068,10 +22115,7 @@ var drawTimeText = function drawTimeText(ctx, theme, stepPx, height, timeText, s
|
|
|
22068
22115
|
ctx2.fillText(timeText, stepPx - 15, height - 12);
|
|
22069
22116
|
}
|
|
22070
22117
|
};
|
|
22071
|
-
var
|
|
22072
|
-
if (stepPx <= 0) {
|
|
22073
|
-
return;
|
|
22074
|
-
}
|
|
22118
|
+
var drawYearScaleText = function drawYearScaleText(ctx, theme, newDate, stepPx, height) {
|
|
22075
22119
|
var ctx2 = ctx;
|
|
22076
22120
|
var _theme$palette$geoweb2 = theme.palette.geowebColors.timeSlider.timelineText,
|
|
22077
22121
|
fontSize = _theme$palette$geoweb2.fontSize,
|
|
@@ -22080,9 +22124,9 @@ var drawUpperText = function drawUpperText(ctx, theme, newDate, stepPx, height,
|
|
|
22080
22124
|
ctx2.fillStyle = color;
|
|
22081
22125
|
ctx2.font = "".concat(fontSize, "px ").concat(fontFamily);
|
|
22082
22126
|
ctx2.textAlign = 'left';
|
|
22083
|
-
ctx2.fillText(newDate,
|
|
22127
|
+
ctx2.fillText(newDate, stepPx + 2, height - 10);
|
|
22084
22128
|
};
|
|
22085
|
-
var
|
|
22129
|
+
var drawLeftSideDateText = function drawLeftSideDateText(ctx, theme, newDate, height) {
|
|
22086
22130
|
var ctx2 = ctx;
|
|
22087
22131
|
var _theme$palette$geoweb3 = theme.palette.geowebColors.timeSlider.timelineText,
|
|
22088
22132
|
fontSize = _theme$palette$geoweb3.fontSize,
|
|
@@ -22091,17 +22135,6 @@ var drawYearScaleText = function drawYearScaleText(ctx, theme, newDate, stepPx,
|
|
|
22091
22135
|
ctx2.fillStyle = color;
|
|
22092
22136
|
ctx2.font = "".concat(fontSize, "px ").concat(fontFamily);
|
|
22093
22137
|
ctx2.textAlign = 'left';
|
|
22094
|
-
ctx2.fillText(newDate, stepPx + 2, height - 10);
|
|
22095
|
-
};
|
|
22096
|
-
var drawLeftSideDateText = function drawLeftSideDateText(ctx, theme, newDate, height) {
|
|
22097
|
-
var ctx2 = ctx;
|
|
22098
|
-
var _theme$palette$geoweb4 = theme.palette.geowebColors.timeSlider.timelineText,
|
|
22099
|
-
fontSize = _theme$palette$geoweb4.fontSize,
|
|
22100
|
-
fontFamily = _theme$palette$geoweb4.fontFamily,
|
|
22101
|
-
color = _theme$palette$geoweb4.color;
|
|
22102
|
-
ctx2.fillStyle = color;
|
|
22103
|
-
ctx2.font = "".concat(fontSize, "px ").concat(fontFamily);
|
|
22104
|
-
ctx2.textAlign = 'left';
|
|
22105
22138
|
ctx2.fillText(newDate, 2, height - 30);
|
|
22106
22139
|
};
|
|
22107
22140
|
var getTimeFormat = function getTimeFormat(scale) {
|
|
@@ -22111,7 +22144,7 @@ var getTimeFormat = function getTimeFormat(scale) {
|
|
|
22111
22144
|
case Scale.Month:
|
|
22112
22145
|
return 'MMM';
|
|
22113
22146
|
case Scale.Week:
|
|
22114
|
-
return 'DD';
|
|
22147
|
+
return 'DD MMM';
|
|
22115
22148
|
case Scale.Day:
|
|
22116
22149
|
return 'ddd DD';
|
|
22117
22150
|
default:
|
|
@@ -22165,7 +22198,7 @@ var roundToNearestMultiple = function roundToNearestMultiple(timeUnix, scale) {
|
|
|
22165
22198
|
* done for each scale.
|
|
22166
22199
|
* @returns an object where there are rounding units of each scale
|
|
22167
22200
|
*/
|
|
22168
|
-
var scaleToRoundableUnit = (_scaleToRoundableUnit = {}, _defineProperty$1(_scaleToRoundableUnit, Scale.Hour, 'hour'), _defineProperty$1(_scaleToRoundableUnit, Scale.Day, 'day'), _defineProperty$1(_scaleToRoundableUnit, Scale.Week, 'isoWeek'), _defineProperty$1(_scaleToRoundableUnit, Scale.Month, 'isoWeek'), _defineProperty$1(_scaleToRoundableUnit, Scale.Year, 'year'),
|
|
22201
|
+
var scaleToRoundableUnit = (_scaleToRoundableUnit = {}, _defineProperty$1(_scaleToRoundableUnit, Scale.Hour, 'hour'), _defineProperty$1(_scaleToRoundableUnit, Scale.Day, 'day'), _defineProperty$1(_scaleToRoundableUnit, Scale.Week, 'isoWeek'), _defineProperty$1(_scaleToRoundableUnit, Scale.Month, 'isoWeek'), _defineProperty$1(_scaleToRoundableUnit, Scale.Year, 'year'), _scaleToRoundableUnit);
|
|
22169
22202
|
var getRoundedStartAndEnd = function getRoundedStartAndEnd(visibleTimeStart, visibleTimeEnd, scale) {
|
|
22170
22203
|
if (scale === Scale.Minutes5 || scale === Scale.Hours3 || scale === Scale.Hours6) {
|
|
22171
22204
|
return [roundToNearestMultiple(visibleTimeStart, scale, false), roundToNearestMultiple(visibleTimeEnd, scale, true)];
|
|
@@ -22207,30 +22240,6 @@ var getTimesteps = function getTimesteps(roundedStart, roundedEnd, fundamentalSc
|
|
|
22207
22240
|
}
|
|
22208
22241
|
return timesteps;
|
|
22209
22242
|
};
|
|
22210
|
-
var getDateChangeTimestepUnit = function getDateChangeTimestepUnit(scale) {
|
|
22211
|
-
switch (scale) {
|
|
22212
|
-
case Scale.DataScale:
|
|
22213
|
-
return 'year';
|
|
22214
|
-
case Scale.Month:
|
|
22215
|
-
return 'year';
|
|
22216
|
-
case Scale.Week:
|
|
22217
|
-
case Scale.Day:
|
|
22218
|
-
return 'month';
|
|
22219
|
-
default:
|
|
22220
|
-
return 'day';
|
|
22221
|
-
}
|
|
22222
|
-
};
|
|
22223
|
-
var getMinOffset = function getMinOffset(scale) {
|
|
22224
|
-
switch (scale) {
|
|
22225
|
-
case Scale.Month:
|
|
22226
|
-
return 42;
|
|
22227
|
-
case Scale.Week:
|
|
22228
|
-
case Scale.Day:
|
|
22229
|
-
return 70;
|
|
22230
|
-
default:
|
|
22231
|
-
return 115;
|
|
22232
|
-
}
|
|
22233
|
-
};
|
|
22234
22243
|
var getCustomTimesteps = function getCustomTimesteps(roundedStart, roundedEnd, increment) {
|
|
22235
22244
|
var nightTime = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
22236
22245
|
var momentIncrement = increment;
|
|
@@ -22250,24 +22259,7 @@ var getCustomTimesteps = function getCustomTimesteps(roundedStart, roundedEnd, i
|
|
|
22250
22259
|
}
|
|
22251
22260
|
return timesteps;
|
|
22252
22261
|
};
|
|
22253
|
-
var getLeftSideDateText = function getLeftSideDateText(timestamp,
|
|
22254
|
-
var timeMoment = moment.unix(timestamp).utc();
|
|
22255
|
-
switch (scale) {
|
|
22256
|
-
case Scale.Minutes5:
|
|
22257
|
-
case Scale.Hour:
|
|
22258
|
-
case Scale.Hours3:
|
|
22259
|
-
case Scale.Hours6:
|
|
22260
|
-
return timeMoment.format('Y MMM ddd DD');
|
|
22261
|
-
case Scale.Day:
|
|
22262
|
-
case Scale.Week:
|
|
22263
|
-
return timeMoment.format('Y MMM');
|
|
22264
|
-
case Scale.Month:
|
|
22265
|
-
return timeMoment.format('Y');
|
|
22266
|
-
default:
|
|
22267
|
-
return '';
|
|
22268
|
-
}
|
|
22269
|
-
};
|
|
22270
|
-
var getLeftSideDateTextForDataScale = function getLeftSideDateTextForDataScale(timestamp, fundamentalScale) {
|
|
22262
|
+
var getLeftSideDateText = function getLeftSideDateText(timestamp, fundamentalScale) {
|
|
22271
22263
|
var timeMoment = moment.unix(timestamp).utc();
|
|
22272
22264
|
switch (fundamentalScale) {
|
|
22273
22265
|
case Scale.Minutes5:
|
|
@@ -22286,50 +22278,40 @@ var getLeftSideDateTextForDataScale = function getLeftSideDateTextForDataScale(t
|
|
|
22286
22278
|
return '';
|
|
22287
22279
|
}
|
|
22288
22280
|
};
|
|
22289
|
-
var getDateChangeFormat = function getDateChangeFormat(timestamp, timestepUnit) {
|
|
22290
|
-
var momentTime = moment.unix(timestamp).utc();
|
|
22291
|
-
if (timestepUnit === 'year') {
|
|
22292
|
-
return momentTime.format('Y');
|
|
22293
|
-
}
|
|
22294
|
-
if (timestepUnit === 'month') {
|
|
22295
|
-
if (momentTime.month() === 0) {
|
|
22296
|
-
return momentTime.format('Y MMM');
|
|
22297
|
-
}
|
|
22298
|
-
return momentTime.format('MMM');
|
|
22299
|
-
}
|
|
22300
|
-
if (momentTime.month() === 0 && momentTime.date() === 1) {
|
|
22301
|
-
return momentTime.format('Y MMM ddd DD');
|
|
22302
|
-
}
|
|
22303
|
-
if (momentTime.date() === 1) {
|
|
22304
|
-
return momentTime.format('MMM ddd DD');
|
|
22305
|
-
}
|
|
22306
|
-
return momentTime.format('ddd DD');
|
|
22307
|
-
};
|
|
22308
22281
|
// For a data scale an appropriate fundamental scale is chosen
|
|
22309
|
-
// depending on
|
|
22310
|
-
// data is for example many months. the fundamental scale Scale.Year
|
|
22282
|
+
// depending on secondsPerPx of data. When a time range of
|
|
22283
|
+
// data is for example many months. the fundamental scale mapEnums.Scale.Year
|
|
22311
22284
|
// is chosen here and the legend of the time slider is drawn in the
|
|
22312
22285
|
// same as if otiginally a year scale would have been chose.
|
|
22313
22286
|
//
|
|
22314
|
-
// If a time range of data is a few weeks, Scale.Month is chosen. So, all
|
|
22287
|
+
// If a time range of data is a few weeks, mapEnums.Scale.Month is chosen. So, all
|
|
22315
22288
|
// the time range of data can be shown in the window.
|
|
22316
|
-
var
|
|
22317
|
-
if (
|
|
22289
|
+
var getFundamentalScale = function getFundamentalScale(secondsPerPx) {
|
|
22290
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Month]) {
|
|
22318
22291
|
return Scale.Year;
|
|
22319
22292
|
}
|
|
22320
|
-
if (
|
|
22293
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Week]) {
|
|
22321
22294
|
return Scale.Month;
|
|
22322
22295
|
}
|
|
22323
|
-
if (
|
|
22296
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Day]) {
|
|
22324
22297
|
return Scale.Week;
|
|
22325
22298
|
}
|
|
22326
|
-
if (
|
|
22299
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Hours6]) {
|
|
22327
22300
|
return Scale.Day;
|
|
22328
22301
|
}
|
|
22329
|
-
|
|
22302
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Hours3]) {
|
|
22303
|
+
return Scale.Hours6;
|
|
22304
|
+
}
|
|
22305
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Hour]) {
|
|
22306
|
+
return Scale.Hours3;
|
|
22307
|
+
}
|
|
22308
|
+
if (secondsPerPx >= scaleToSecondsPerPx[Scale.Minutes5]) {
|
|
22309
|
+
return Scale.Hour;
|
|
22310
|
+
}
|
|
22311
|
+
return Scale.Minutes5;
|
|
22330
22312
|
};
|
|
22331
|
-
var drawTimeScale = function drawTimeScale(context, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height,
|
|
22332
|
-
var fundamentalScale =
|
|
22313
|
+
var drawTimeScale = function drawTimeScale(context, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, secondsPerPx) {
|
|
22314
|
+
var fundamentalScale = getFundamentalScale(secondsPerPx);
|
|
22333
22315
|
var _getRoundedStartAndEn = getRoundedStartAndEnd(visibleTimeStart, visibleTimeEnd, fundamentalScale),
|
|
22334
22316
|
_getRoundedStartAndEn2 = _slicedToArray(_getRoundedStartAndEn, 2),
|
|
22335
22317
|
roundedStart = _getRoundedStartAndEn2[0],
|
|
@@ -22339,7 +22321,7 @@ var drawTimeScale = function drawTimeScale(context, theme, visibleTimeStart, vis
|
|
|
22339
22321
|
getTimesteps(roundedStart, roundedEnd, fundamentalScale).forEach(function (timestep) {
|
|
22340
22322
|
var stepPx = timestampToPixelEdges(timestep, visibleTimeStart, visibleTimeEnd, canvasWidth);
|
|
22341
22323
|
// Move 1 pixel line by 0.5 pixels to prevent it from being shown as blurry: https://usefulangle.com/post/17/html5-canvas-drawing-1px-crisp-straight-lines
|
|
22342
|
-
drawStepPxLine(ctx, theme, Math.floor(stepPx) + 0.5, height,
|
|
22324
|
+
drawStepPxLine(ctx, theme, Math.floor(stepPx) + 0.5, height, fundamentalScale, timestep);
|
|
22343
22325
|
// Draw the time step time as text
|
|
22344
22326
|
var timeFormat = getTimeFormat(fundamentalScale);
|
|
22345
22327
|
var timeText = moment.unix(timestep).utc().format(timeFormat).toString();
|
|
@@ -22351,7 +22333,7 @@ var drawTimeScale = function drawTimeScale(context, theme, visibleTimeStart, vis
|
|
|
22351
22333
|
}
|
|
22352
22334
|
});
|
|
22353
22335
|
// draw month overlay lines
|
|
22354
|
-
if (fundamentalScale === Scale.Week || fundamentalScale === Scale.Month
|
|
22336
|
+
if (fundamentalScale === Scale.Week || fundamentalScale === Scale.Month) {
|
|
22355
22337
|
var _getCustomRoundedStar = getCustomRoundedStartAndEnd(visibleTimeStart, visibleTimeEnd, 'month'),
|
|
22356
22338
|
_getCustomRoundedStar2 = _slicedToArray(_getCustomRoundedStar, 2),
|
|
22357
22339
|
_roundedStart = _getCustomRoundedStar2[0],
|
|
@@ -22359,7 +22341,7 @@ var drawTimeScale = function drawTimeScale(context, theme, visibleTimeStart, vis
|
|
|
22359
22341
|
var monthTimesteps = getCustomTimesteps(_roundedStart, _roundedEnd, 'month');
|
|
22360
22342
|
monthTimesteps.forEach(function (timestep) {
|
|
22361
22343
|
var stepPx = timestampToPixelEdges(timestep, visibleTimeStart, visibleTimeEnd, canvasWidth);
|
|
22362
|
-
if (fundamentalScale === Scale.Month
|
|
22344
|
+
if (fundamentalScale === Scale.Month) {
|
|
22363
22345
|
var momentTime = moment.unix(timestep).utc();
|
|
22364
22346
|
// Move 1 pixel line by 0.5 pixels to prevent it from being shown as blurry: https://usefulangle.com/post/17/html5-canvas-drawing-1px-crisp-straight-lines
|
|
22365
22347
|
drawDateChangeLine(ctx, theme, Math.floor(stepPx) + 0.5, height);
|
|
@@ -22371,24 +22353,10 @@ var drawTimeScale = function drawTimeScale(context, theme, visibleTimeStart, vis
|
|
|
22371
22353
|
});
|
|
22372
22354
|
}
|
|
22373
22355
|
// draw date change texts
|
|
22374
|
-
if (
|
|
22356
|
+
if (fundamentalScale === Scale.Year) {
|
|
22375
22357
|
return;
|
|
22376
22358
|
}
|
|
22377
|
-
var
|
|
22378
|
-
var _getCustomRoundedStar3 = getCustomRoundedStartAndEnd(visibleTimeStart, visibleTimeEnd, timestepUnit),
|
|
22379
|
-
_getCustomRoundedStar4 = _slicedToArray(_getCustomRoundedStar3, 2),
|
|
22380
|
-
dateChangeStart = _getCustomRoundedStar4[0],
|
|
22381
|
-
dateChangeEnd = _getCustomRoundedStar4[1];
|
|
22382
|
-
var dateChangeTimesteps = getCustomTimesteps(dateChangeStart, dateChangeEnd, timestepUnit);
|
|
22383
|
-
dateChangeTimesteps.forEach(function (timestep) {
|
|
22384
|
-
var stepPx = timestampToPixelEdges(timestep, visibleTimeStart, visibleTimeEnd, canvasWidth);
|
|
22385
|
-
var textFormat = getDateChangeFormat(timestep, timestepUnit);
|
|
22386
|
-
var minOffset = getMinOffset(fundamentalScale);
|
|
22387
|
-
if (scale !== Scale.DataScale) {
|
|
22388
|
-
drawUpperText(ctx, theme, textFormat, stepPx, height, minOffset);
|
|
22389
|
-
}
|
|
22390
|
-
});
|
|
22391
|
-
var dateText = scale === Scale.DataScale ? getLeftSideDateTextForDataScale(visibleTimeStart, fundamentalScale) : getLeftSideDateText(visibleTimeStart, scale);
|
|
22359
|
+
var dateText = getLeftSideDateText(visibleTimeStart, fundamentalScale);
|
|
22392
22360
|
drawLeftSideDateText(ctx, theme, dateText, height);
|
|
22393
22361
|
};
|
|
22394
22362
|
|
|
@@ -22475,7 +22443,7 @@ var drawCurrentTime = function drawCurrentTime(context, theme, width, height, st
|
|
|
22475
22443
|
ctx.stroke();
|
|
22476
22444
|
};
|
|
22477
22445
|
|
|
22478
|
-
var drawBackground = function drawBackground(context, theme, visibleTimeStart, visibleTimeEnd, animationStartPx, animationEndPx, canvasWidth, height,
|
|
22446
|
+
var drawBackground = function drawBackground(context, theme, visibleTimeStart, visibleTimeEnd, animationStartPx, animationEndPx, canvasWidth, height, secondsPerPx, dataStartPx, dataEndPx, currentTimePx) {
|
|
22479
22447
|
var ctx = context;
|
|
22480
22448
|
var _theme$palette$geoweb = theme.palette.geowebColors.timeSlider,
|
|
22481
22449
|
timelineNightTime = _theme$palette$geoweb.timelineNightTime,
|
|
@@ -22484,6 +22452,7 @@ var drawBackground = function drawBackground(context, theme, visibleTimeStart, v
|
|
|
22484
22452
|
legendNoDataBackground = _theme$palette$geoweb.legendNoDataBackground;
|
|
22485
22453
|
// top spacing
|
|
22486
22454
|
var y = 0;
|
|
22455
|
+
var fundamentalScale = getFundamentalScale$1(secondsPerPx);
|
|
22487
22456
|
drawDefaultBackground();
|
|
22488
22457
|
drawObservedData();
|
|
22489
22458
|
drawForecastData();
|
|
@@ -22528,7 +22497,7 @@ var drawBackground = function drawBackground(context, theme, visibleTimeStart, v
|
|
|
22528
22497
|
ctx.restore();
|
|
22529
22498
|
}
|
|
22530
22499
|
function drawNightOrAlternateTime() {
|
|
22531
|
-
var colorChangeTimesteps = getColorChangeTimesteps(
|
|
22500
|
+
var colorChangeTimesteps = getColorChangeTimesteps(fundamentalScale, visibleTimeStart, visibleTimeEnd);
|
|
22532
22501
|
colorChangeTimesteps.forEach(function (timestep, i, arr) {
|
|
22533
22502
|
if (i === 0) {
|
|
22534
22503
|
return;
|
|
@@ -22539,7 +22508,7 @@ var drawBackground = function drawBackground(context, theme, visibleTimeStart, v
|
|
|
22539
22508
|
_map2 = _slicedToArray(_map, 2),
|
|
22540
22509
|
prevPx = _map2[0],
|
|
22541
22510
|
currPx = _map2[1];
|
|
22542
|
-
if (!isColorIntervalEven(
|
|
22511
|
+
if (!isColorIntervalEven(fundamentalScale, timestep)) {
|
|
22543
22512
|
ctx.fillStyle = timelineNightTime.rgba;
|
|
22544
22513
|
var TOP_OFFSET = 16;
|
|
22545
22514
|
ctx.fillRect(prevPx, TOP_OFFSET, currPx - prevPx, height);
|
|
@@ -22585,7 +22554,7 @@ function getColorChangeTimesteps(scale, visibleTimeStart, visibleTimeEnd) {
|
|
|
22585
22554
|
return colorChangeTimesteps;
|
|
22586
22555
|
}
|
|
22587
22556
|
|
|
22588
|
-
var drawTimeSliderLegend = function drawTimeSliderLegend(context, theme, canvasWidth, height, centerTime, secondsPerPx,
|
|
22557
|
+
var drawTimeSliderLegend = function drawTimeSliderLegend(context, theme, canvasWidth, height, centerTime, secondsPerPx, selectedTimeUnix, span, currentTimeUnix, animationStartTime, animationEndTime, dataStartTime, dataEndTime) {
|
|
22589
22558
|
var ctx = context;
|
|
22590
22559
|
var _map = [0, canvasWidth].map(function (px) {
|
|
22591
22560
|
return pixelToTimestamp(px, centerTime, canvasWidth, secondsPerPx);
|
|
@@ -22603,8 +22572,8 @@ var drawTimeSliderLegend = function drawTimeSliderLegend(context, theme, canvasW
|
|
|
22603
22572
|
dataEndPx = _map4[3],
|
|
22604
22573
|
currentTimePx = _map4[4];
|
|
22605
22574
|
ctx.clearRect(0, 0, canvasWidth, height);
|
|
22606
|
-
drawBackground(ctx, theme, visibleTimeStart, visibleTimeEnd, animationStartPx, animationEndPx, canvasWidth, height,
|
|
22607
|
-
drawTimeScale(ctx, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height,
|
|
22575
|
+
drawBackground(ctx, theme, visibleTimeStart, visibleTimeEnd, animationStartPx, animationEndPx, canvasWidth, height, secondsPerPx, dataStartPx, dataEndPx, currentTimePx);
|
|
22576
|
+
drawTimeScale(ctx, theme, visibleTimeStart, visibleTimeEnd, canvasWidth, height, secondsPerPx);
|
|
22608
22577
|
drawCurrentTime(ctx, theme, canvasWidth, height, visibleTimeStart, visibleTimeEnd, currentTimeUnix);
|
|
22609
22578
|
drawNeedle(ctx, theme, canvasWidth, height, visibleTimeStart, visibleTimeEnd, selectedTimeUnix);
|
|
22610
22579
|
};
|
|
@@ -22769,12 +22738,12 @@ function convertStringTimeToUnix(time) {
|
|
|
22769
22738
|
var TimeSliderLegend = function TimeSliderLegend(_ref) {
|
|
22770
22739
|
var mapId = _ref.mapId,
|
|
22771
22740
|
centerTime = _ref.centerTime,
|
|
22772
|
-
|
|
22773
|
-
_ref$
|
|
22774
|
-
|
|
22741
|
+
canvasWidth = _ref.timeSliderWidth,
|
|
22742
|
+
_ref$secondsPerPx = _ref.secondsPerPx,
|
|
22743
|
+
secondsPerPx = _ref$secondsPerPx === void 0 ? defaultSecondsPerPx : _ref$secondsPerPx,
|
|
22775
22744
|
selectedTime = _ref.selectedTime,
|
|
22776
|
-
_ref$
|
|
22777
|
-
|
|
22745
|
+
_ref$span = _ref.span,
|
|
22746
|
+
span = _ref$span === void 0 ? Span.Day : _ref$span,
|
|
22778
22747
|
currentTime = _ref.currentTime,
|
|
22779
22748
|
dataStartTime = _ref.dataStartTime,
|
|
22780
22749
|
dataEndTime = _ref.dataEndTime,
|
|
@@ -22790,42 +22759,40 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
|
|
|
22790
22759
|
_ref$onSetAnimationSt = _ref.onSetAnimationStartTime,
|
|
22791
22760
|
onSetAnimationStartTime = _ref$onSetAnimationSt === void 0 ? function () {} : _ref$onSetAnimationSt,
|
|
22792
22761
|
_ref$onSetAnimationEn = _ref.onSetAnimationEndTime,
|
|
22793
|
-
onSetAnimationEndTime = _ref$onSetAnimationEn === void 0 ? function () {} : _ref$onSetAnimationEn
|
|
22762
|
+
onSetAnimationEndTime = _ref$onSetAnimationEn === void 0 ? function () {} : _ref$onSetAnimationEn,
|
|
22763
|
+
_ref$updateCanvasWidt = _ref.updateCanvasWidth,
|
|
22764
|
+
updateCanvasWidth = _ref$updateCanvasWidt === void 0 ? function () {} : _ref$updateCanvasWidt;
|
|
22794
22765
|
var _useCanvasTarget = useCanvasTarget('mousedown'),
|
|
22795
22766
|
_useCanvasTarget2 = _slicedToArray(_useCanvasTarget, 2),
|
|
22796
22767
|
node = _useCanvasTarget2[1];
|
|
22797
|
-
var _React$useState5 = React.useState(
|
|
22768
|
+
var _React$useState5 = React.useState(false),
|
|
22798
22769
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
22799
|
-
|
|
22800
|
-
|
|
22770
|
+
selectedTimeDragging = _React$useState6[0],
|
|
22771
|
+
setSelectedTimeDragging = _React$useState6[1];
|
|
22801
22772
|
var _React$useState7 = React.useState(false),
|
|
22802
22773
|
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
22803
|
-
|
|
22804
|
-
|
|
22774
|
+
leftMarkerDragging = _React$useState8[0],
|
|
22775
|
+
setLeftMarkerDragging = _React$useState8[1];
|
|
22805
22776
|
var _React$useState9 = React.useState(false),
|
|
22806
22777
|
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
22807
|
-
|
|
22808
|
-
|
|
22778
|
+
rightMarkerDragging = _React$useState10[0],
|
|
22779
|
+
setRightMarkerDragging = _React$useState10[1];
|
|
22809
22780
|
var _React$useState11 = React.useState(false),
|
|
22810
22781
|
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
22811
|
-
|
|
22812
|
-
|
|
22782
|
+
dragTooltipOpen = _React$useState12[0],
|
|
22783
|
+
setDragTooltipOpen = _React$useState12[1];
|
|
22813
22784
|
var _React$useState13 = React.useState(false),
|
|
22814
22785
|
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
22815
|
-
|
|
22816
|
-
|
|
22786
|
+
mouseDownInLegend = _React$useState14[0],
|
|
22787
|
+
setMouseDownInLegend = _React$useState14[1];
|
|
22817
22788
|
var _React$useState15 = React.useState(false),
|
|
22818
22789
|
_React$useState16 = _slicedToArray(_React$useState15, 2),
|
|
22819
|
-
|
|
22820
|
-
|
|
22821
|
-
var _React$useState17 = React.useState(
|
|
22790
|
+
animationAreaDragging = _React$useState16[0],
|
|
22791
|
+
setAnimationAreaDragging = _React$useState16[1];
|
|
22792
|
+
var _React$useState17 = React.useState('auto'),
|
|
22822
22793
|
_React$useState18 = _slicedToArray(_React$useState17, 2),
|
|
22823
|
-
|
|
22824
|
-
|
|
22825
|
-
var _React$useState19 = React.useState('auto'),
|
|
22826
|
-
_React$useState20 = _slicedToArray(_React$useState19, 2),
|
|
22827
|
-
cursorStyle = _React$useState20[0],
|
|
22828
|
-
setCursorStyle = _React$useState20[1];
|
|
22794
|
+
cursorStyle = _React$useState18[0],
|
|
22795
|
+
setCursorStyle = _React$useState18[1];
|
|
22829
22796
|
/**
|
|
22830
22797
|
* remove active drag. can happen outside canvas.
|
|
22831
22798
|
*/
|
|
@@ -22850,10 +22817,10 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
|
|
|
22850
22817
|
var timeSliderLegendId = "timeSliderLegend_".concat(mapId);
|
|
22851
22818
|
var timeSliderLegendElement = document.querySelector(".".concat(timeSliderLegendId));
|
|
22852
22819
|
var pixelsToLeft = timeSliderLegendElement === null || timeSliderLegendElement === void 0 ? void 0 : timeSliderLegendElement.getBoundingClientRect()['left'];
|
|
22853
|
-
var _React$
|
|
22854
|
-
_React$
|
|
22855
|
-
tooltipTime = _React$
|
|
22856
|
-
setTooltipTime = _React$
|
|
22820
|
+
var _React$useState19 = React.useState(moment.utc(0)),
|
|
22821
|
+
_React$useState20 = _slicedToArray(_React$useState19, 2),
|
|
22822
|
+
tooltipTime = _React$useState20[0],
|
|
22823
|
+
setTooltipTime = _React$useState20[1];
|
|
22857
22824
|
var _useAnimationTime = useAnimationTime(animationStartTime, animationEndTime, onSetAnimationStartTime, onSetAnimationEndTime, leftMarkerDragging, rightMarkerDragging, animationAreaDragging, centerTime, canvasWidth, secondsPerPx, dragTooltipPosition, pixelsToLeft, setTooltipTime, startDraggingPosition),
|
|
22858
22825
|
handleAnimationDragging = _useAnimationTime.handleAnimationDragging,
|
|
22859
22826
|
localAnimationEndTime = _useAnimationTime.localAnimationEndTime,
|
|
@@ -22996,8 +22963,8 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
|
|
|
22996
22963
|
onMouseDown: onMouseDown,
|
|
22997
22964
|
onMouseUp: onMouseUp,
|
|
22998
22965
|
onRenderCanvas: function onRenderCanvas(ctx, width, height) {
|
|
22999
|
-
|
|
23000
|
-
drawTimeSliderLegend(ctx, theme, width, height, centerTime, secondsPerPx,
|
|
22966
|
+
updateCanvasWidth(canvasWidth, width);
|
|
22967
|
+
drawTimeSliderLegend(ctx, theme, width, height, centerTime, secondsPerPx, selectedTime, span, currentTime, localAnimationStartTime, localAnimationEndTime, dataStartTime, dataEndTime);
|
|
23001
22968
|
}
|
|
23002
22969
|
})));
|
|
23003
22970
|
};
|
|
@@ -27759,21 +27726,21 @@ var drawTextAnnotation = function drawTextAnnotation(ctx, x, y, text, theme) {
|
|
|
27759
27726
|
ctx.fillText(text, -actualTextWidth / 2, actualTextHeight / 2);
|
|
27760
27727
|
ctx.restore();
|
|
27761
27728
|
};
|
|
27762
|
-
var drawNewCurrentTimeBox = function drawNewCurrentTimeBox(ctx, selectedTime, selectedPx,
|
|
27729
|
+
var drawNewCurrentTimeBox = function drawNewCurrentTimeBox(ctx, selectedTime, selectedPx, span, theme, isAutoUpdating) {
|
|
27763
27730
|
var iconWidth = 25;
|
|
27764
27731
|
var smallWidth = needleGeom.smallWidth,
|
|
27765
27732
|
largeWidth = needleGeom.largeWidth,
|
|
27766
27733
|
height = needleGeom.height;
|
|
27767
|
-
var boxWidth =
|
|
27734
|
+
var boxWidth = span === Span.Year ? largeWidth : smallWidth;
|
|
27768
27735
|
var needleX = selectedPx - boxWidth / 2;
|
|
27769
27736
|
var needleY = needleGeom.lineWidth;
|
|
27770
27737
|
drawRoundedRectangle(ctx, needleX - iconWidth, needleY, boxWidth + iconWidth, height, needleGeom.cornerRadius, theme);
|
|
27771
|
-
var timeFormat =
|
|
27738
|
+
var timeFormat = span === Span.Year ? 'Y ddd DD MMM HH:mm' : 'ddd DD MMM HH:mm';
|
|
27772
27739
|
var timeText = moment.utc(selectedTime * 1000).format(timeFormat).toString();
|
|
27773
27740
|
drawTextAnnotation(ctx, needleX + boxWidth / 2 - iconWidth, needleY + height / 2, timeText, theme);
|
|
27774
27741
|
drawAutoUpdateIcon(ctx, needleX + boxWidth - iconWidth, needleY, theme, isAutoUpdating);
|
|
27775
27742
|
};
|
|
27776
|
-
var renderTimeSliderCurrentTimeBox = function renderTimeSliderCurrentTimeBox(ctx, theme, width, height, centerTime, selected, secondsPerPx,
|
|
27743
|
+
var renderTimeSliderCurrentTimeBox = function renderTimeSliderCurrentTimeBox(ctx, theme, width, height, centerTime, selected, secondsPerPx, span, isAutoUpdating) {
|
|
27777
27744
|
// map unix timestamps to pixel values
|
|
27778
27745
|
var _map = [selected].map(function (t) {
|
|
27779
27746
|
return timestampToPixel(t, centerTime, width, secondsPerPx);
|
|
@@ -27781,7 +27748,7 @@ var renderTimeSliderCurrentTimeBox = function renderTimeSliderCurrentTimeBox(ctx
|
|
|
27781
27748
|
_map2 = _slicedToArray(_map, 1),
|
|
27782
27749
|
selectedPx = _map2[0];
|
|
27783
27750
|
ctx.clearRect(0, 0, width, height);
|
|
27784
|
-
drawNewCurrentTimeBox(ctx, selected, selectedPx,
|
|
27751
|
+
drawNewCurrentTimeBox(ctx, selected, selectedPx, span, theme, isAutoUpdating);
|
|
27785
27752
|
};
|
|
27786
27753
|
|
|
27787
27754
|
var TimeSliderCurrentTimeBox = function TimeSliderCurrentTimeBox(_ref) {
|
|
@@ -27790,8 +27757,8 @@ var TimeSliderCurrentTimeBox = function TimeSliderCurrentTimeBox(_ref) {
|
|
|
27790
27757
|
_ref$secondsPerPx = _ref.secondsPerPx,
|
|
27791
27758
|
secondsPerPx = _ref$secondsPerPx === void 0 ? 50 : _ref$secondsPerPx,
|
|
27792
27759
|
selectedTime = _ref.selectedTime,
|
|
27793
|
-
_ref$
|
|
27794
|
-
|
|
27760
|
+
_ref$span = _ref.span,
|
|
27761
|
+
span = _ref$span === void 0 ? Span.Day : _ref$span,
|
|
27795
27762
|
timeStep = _ref.timeStep,
|
|
27796
27763
|
dataStartTime = _ref.dataStartTime,
|
|
27797
27764
|
dataEndTime = _ref.dataEndTime,
|
|
@@ -27872,7 +27839,7 @@ var TimeSliderCurrentTimeBox = function TimeSliderCurrentTimeBox(_ref) {
|
|
|
27872
27839
|
},
|
|
27873
27840
|
onRenderCanvas: function onRenderCanvas(ctx, width, height) {
|
|
27874
27841
|
setCanvasWidth(width);
|
|
27875
|
-
renderTimeSliderCurrentTimeBox(ctx, theme, width, height, centerTime, selectedTime, secondsPerPx,
|
|
27842
|
+
renderTimeSliderCurrentTimeBox(ctx, theme, width, height, centerTime, selectedTime, secondsPerPx, span, isAutoUpdating);
|
|
27876
27843
|
}
|
|
27877
27844
|
}));
|
|
27878
27845
|
};
|
|
@@ -27915,10 +27882,10 @@ var useMoveTimeWithKeyboard = function useMoveTimeWithKeyboard(mapIsActive, time
|
|
|
27915
27882
|
}, [currentTime, dataEndTime, dataStartTime, mapIsActive, onSetCenterTime, onSetNewDate, selectedTime, timeStep]);
|
|
27916
27883
|
};
|
|
27917
27884
|
var defaultProps = {
|
|
27885
|
+
timeSliderWidth: 100,
|
|
27918
27886
|
centerTime: moment.utc().startOf('day').hours(12).unix(),
|
|
27919
|
-
secondsPerPx:
|
|
27920
|
-
selectedTime: moment.utc().startOf('day').hours(12).unix()
|
|
27921
|
-
dataScaleToSecondsPerPx: defaultDataScaleToSecondsPerPx
|
|
27887
|
+
secondsPerPx: defaultSecondsPerPx,
|
|
27888
|
+
selectedTime: moment.utc().startOf('day').hours(12).unix()
|
|
27922
27889
|
};
|
|
27923
27890
|
var TimeSlider = function TimeSlider(_ref) {
|
|
27924
27891
|
var mapId = _ref.mapId,
|
|
@@ -28138,68 +28105,6 @@ var TimeStepButtonComponent = function TimeStepButtonComponent(_ref) {
|
|
|
28138
28105
|
});
|
|
28139
28106
|
};
|
|
28140
28107
|
|
|
28141
|
-
/* *
|
|
28142
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
28143
|
-
* you may not use this file except in compliance with the License.
|
|
28144
|
-
* You may obtain a copy of the License at
|
|
28145
|
-
*
|
|
28146
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
28147
|
-
*
|
|
28148
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
28149
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28150
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
28151
|
-
* See the License for the specific language governing permissions and
|
|
28152
|
-
* limitations under the License.
|
|
28153
|
-
*
|
|
28154
|
-
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
28155
|
-
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
28156
|
-
* */
|
|
28157
|
-
var TimeScaleButtonConnect = function TimeScaleButtonConnect(_ref) {
|
|
28158
|
-
var mapId = _ref.mapId;
|
|
28159
|
-
var layers = useSelector(function (store) {
|
|
28160
|
-
return getMapLayers(store, mapId);
|
|
28161
|
-
});
|
|
28162
|
-
var timeSliderScale = useSelector(function (store) {
|
|
28163
|
-
return getMapTimeSliderScale(store, mapId);
|
|
28164
|
-
});
|
|
28165
|
-
var centerTime = useSelector(function (store) {
|
|
28166
|
-
return getMapTimeSliderCenterTime(store, mapId);
|
|
28167
|
-
});
|
|
28168
|
-
var secondsPerPx = useSelector(function (store) {
|
|
28169
|
-
return getMapTimeSliderSecondsPerPx(store, mapId);
|
|
28170
|
-
});
|
|
28171
|
-
var dimensions = useSelector(function (store) {
|
|
28172
|
-
return getMapDimensions(store, mapId);
|
|
28173
|
-
});
|
|
28174
|
-
var dispatch = useDispatch();
|
|
28175
|
-
var onSetTimeSliderScale = function onSetTimeSliderScale(scale, newCenterTime, scaleToSecPerPx) {
|
|
28176
|
-
if (scale === Scale.DataScale) {
|
|
28177
|
-
dispatch(mapActions$1.setTimeSliderDataScaleToSecondsPerPx({
|
|
28178
|
-
mapId: mapId,
|
|
28179
|
-
timeSliderDataScaleToSecondsPerPx: scaleToSecPerPx
|
|
28180
|
-
}));
|
|
28181
|
-
}
|
|
28182
|
-
dispatch(mapActions$1.setTimeSliderScale({
|
|
28183
|
-
mapId: mapId,
|
|
28184
|
-
timeSliderScale: scale
|
|
28185
|
-
}));
|
|
28186
|
-
dispatch(mapActions$1.setTimeSliderCenterTime({
|
|
28187
|
-
mapId: mapId,
|
|
28188
|
-
timeSliderCenterTime: newCenterTime
|
|
28189
|
-
}));
|
|
28190
|
-
};
|
|
28191
|
-
var _getTimeBounds = getTimeBounds(dimensions),
|
|
28192
|
-
selectedTime = _getTimeBounds.selectedTime;
|
|
28193
|
-
return /*#__PURE__*/React.createElement(TimeScaleButton, {
|
|
28194
|
-
layers: layers,
|
|
28195
|
-
timeSliderScale: timeSliderScale,
|
|
28196
|
-
onChangeTimeSliderScale: onSetTimeSliderScale,
|
|
28197
|
-
secondsPerPx: secondsPerPx,
|
|
28198
|
-
centerTime: centerTime,
|
|
28199
|
-
selectedTime: selectedTime
|
|
28200
|
-
});
|
|
28201
|
-
};
|
|
28202
|
-
|
|
28203
28108
|
var NowButtonConnect = function NowButtonConnect(_ref) {
|
|
28204
28109
|
var sourceId = _ref.sourceId,
|
|
28205
28110
|
mapId = _ref.mapId,
|
|
@@ -28287,6 +28192,70 @@ var AnimationLengthButtonConnect = function AnimationLengthButtonConnect(_ref) {
|
|
|
28287
28192
|
});
|
|
28288
28193
|
};
|
|
28289
28194
|
|
|
28195
|
+
/* *
|
|
28196
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
28197
|
+
* you may not use this file except in compliance with the License.
|
|
28198
|
+
* You may obtain a copy of the License at
|
|
28199
|
+
*
|
|
28200
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
28201
|
+
*
|
|
28202
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
28203
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28204
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
28205
|
+
* See the License for the specific language governing permissions and
|
|
28206
|
+
* limitations under the License.
|
|
28207
|
+
*
|
|
28208
|
+
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
28209
|
+
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
28210
|
+
* */
|
|
28211
|
+
var TimeSpanButtonConnect = function TimeSpanButtonConnect(_ref) {
|
|
28212
|
+
var mapId = _ref.mapId;
|
|
28213
|
+
var layers = useSelector(function (store) {
|
|
28214
|
+
return getMapLayers(store, mapId);
|
|
28215
|
+
});
|
|
28216
|
+
var timeSliderSpan = useSelector(function (store) {
|
|
28217
|
+
return getMapTimeSliderSpan(store, mapId);
|
|
28218
|
+
});
|
|
28219
|
+
var centerTime = useSelector(function (store) {
|
|
28220
|
+
return getMapTimeSliderCenterTime(store, mapId);
|
|
28221
|
+
});
|
|
28222
|
+
var timeSliderWidth = useSelector(function (store) {
|
|
28223
|
+
return getMapTimeSliderWidth(store, mapId);
|
|
28224
|
+
});
|
|
28225
|
+
var secondsPerPx = useSelector(function (store) {
|
|
28226
|
+
return getMapTimeSliderSecondsPerPx(store, mapId);
|
|
28227
|
+
});
|
|
28228
|
+
var dimensions = useSelector(function (store) {
|
|
28229
|
+
return getMapDimensions(store, mapId);
|
|
28230
|
+
});
|
|
28231
|
+
var dispatch = useDispatch();
|
|
28232
|
+
var onSetTimeSliderSpan = function onSetTimeSliderSpan(newSpan, newCenterTime, newSecondsPerPx) {
|
|
28233
|
+
dispatch(mapActions$1.setTimeSliderSecondsPerPx({
|
|
28234
|
+
mapId: mapId,
|
|
28235
|
+
timeSliderSecondsPerPx: newSecondsPerPx
|
|
28236
|
+
}));
|
|
28237
|
+
dispatch(mapActions$1.setTimeSliderSpan({
|
|
28238
|
+
mapId: mapId,
|
|
28239
|
+
timeSliderSpan: newSpan
|
|
28240
|
+
}));
|
|
28241
|
+
dispatch(mapActions$1.setTimeSliderCenterTime({
|
|
28242
|
+
mapId: mapId,
|
|
28243
|
+
timeSliderCenterTime: newCenterTime
|
|
28244
|
+
}));
|
|
28245
|
+
};
|
|
28246
|
+
var _getTimeBounds = getTimeBounds(dimensions),
|
|
28247
|
+
selectedTime = _getTimeBounds.selectedTime;
|
|
28248
|
+
return /*#__PURE__*/React.createElement(TimeSpanButton, {
|
|
28249
|
+
layers: layers,
|
|
28250
|
+
timeSliderSpan: timeSliderSpan,
|
|
28251
|
+
onChangeTimeSliderSpan: onSetTimeSliderSpan,
|
|
28252
|
+
secondsPerPx: secondsPerPx,
|
|
28253
|
+
centerTime: centerTime,
|
|
28254
|
+
selectedTime: selectedTime,
|
|
28255
|
+
timeSliderWidth: timeSliderWidth
|
|
28256
|
+
});
|
|
28257
|
+
};
|
|
28258
|
+
|
|
28290
28259
|
/* *
|
|
28291
28260
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
28292
28261
|
* you may not use this file except in compliance with the License.
|
|
@@ -28331,7 +28300,7 @@ var OptionsMenuButtonConnect = function OptionsMenuButtonConnect(_ref) {
|
|
|
28331
28300
|
timeStepBtn: /*#__PURE__*/React.createElement(TimeStepButtonComponent, {
|
|
28332
28301
|
mapId: mapId
|
|
28333
28302
|
}),
|
|
28334
|
-
|
|
28303
|
+
timeSpanBtn: /*#__PURE__*/React.createElement(TimeSpanButtonConnect, {
|
|
28335
28304
|
mapId: mapId
|
|
28336
28305
|
})
|
|
28337
28306
|
});
|
|
@@ -28503,18 +28472,18 @@ var TimeSliderLegendConnect = function TimeSliderLegendConnect(_ref) {
|
|
|
28503
28472
|
var dimensions = useSelector(function (store) {
|
|
28504
28473
|
return getMapDimensions(store, mapId);
|
|
28505
28474
|
});
|
|
28506
|
-
var
|
|
28507
|
-
return
|
|
28475
|
+
var span = useSelector(function (store) {
|
|
28476
|
+
return getMapTimeSliderSpan(store, mapId);
|
|
28508
28477
|
});
|
|
28509
28478
|
var centerTime = useSelector(function (store) {
|
|
28510
28479
|
return getMapTimeSliderCenterTime(store, mapId);
|
|
28511
28480
|
});
|
|
28481
|
+
var timeSliderWidth = useSelector(function (store) {
|
|
28482
|
+
return getMapTimeSliderWidth(store, mapId);
|
|
28483
|
+
});
|
|
28512
28484
|
var secondsPerPx = useSelector(function (store) {
|
|
28513
28485
|
return getMapTimeSliderSecondsPerPx(store, mapId);
|
|
28514
28486
|
});
|
|
28515
|
-
var dataScaleToSecondsPerPx = useSelector(function (store) {
|
|
28516
|
-
return getMapTimeSliderDataScaleToSecondsPerPx(store, mapId);
|
|
28517
|
-
});
|
|
28518
28487
|
var isAnimating$1 = useSelector(function (store) {
|
|
28519
28488
|
return isAnimating(store, mapId);
|
|
28520
28489
|
});
|
|
@@ -28544,10 +28513,10 @@ var TimeSliderLegendConnect = function TimeSliderLegendConnect(_ref) {
|
|
|
28544
28513
|
return /*#__PURE__*/React.createElement(TimeSliderLegend, {
|
|
28545
28514
|
mapId: mapId,
|
|
28546
28515
|
centerTime: centerTime,
|
|
28516
|
+
timeSliderWidth: timeSliderWidth,
|
|
28547
28517
|
secondsPerPx: secondsPerPx,
|
|
28548
|
-
dataScaleToSecondsPerPx: dataScaleToSecondsPerPx,
|
|
28549
28518
|
selectedTime: selectedTime,
|
|
28550
|
-
|
|
28519
|
+
span: span,
|
|
28551
28520
|
currentTime: currentTime,
|
|
28552
28521
|
isTimeSliderHoverOn: isTimeSliderHoverOn$1,
|
|
28553
28522
|
dataStartTime: dataStartTime,
|
|
@@ -28601,6 +28570,20 @@ var TimeSliderLegendConnect = function TimeSliderLegendConnect(_ref) {
|
|
|
28601
28570
|
mapId: mapId,
|
|
28602
28571
|
animationEndTime: animationEndTime
|
|
28603
28572
|
}));
|
|
28573
|
+
},
|
|
28574
|
+
updateCanvasWidth: function updateCanvasWidth(storeWidth, newWidth) {
|
|
28575
|
+
if (storeWidth !== newWidth) {
|
|
28576
|
+
dispatch(mapActions$1.setTimeSliderWidth({
|
|
28577
|
+
mapId: mapId,
|
|
28578
|
+
timeSliderWidth: newWidth
|
|
28579
|
+
}));
|
|
28580
|
+
var spanInSeconds = span === Span.DataSpan ? getDataSpanSeconds(layers) : spanToSeconds[span];
|
|
28581
|
+
var newSecondsPerPx = secondsPerPxFromCanvasWidth(newWidth, spanInSeconds);
|
|
28582
|
+
dispatch(mapActions$1.setTimeSliderSecondsPerPx({
|
|
28583
|
+
mapId: mapId,
|
|
28584
|
+
timeSliderSecondsPerPx: newSecondsPerPx
|
|
28585
|
+
}));
|
|
28586
|
+
}
|
|
28604
28587
|
}
|
|
28605
28588
|
});
|
|
28606
28589
|
};
|
|
@@ -28611,7 +28594,7 @@ var connectRedux = connect(function (store, props) {
|
|
|
28611
28594
|
dimensions: getMapDimensions(store, props.mapId),
|
|
28612
28595
|
centerTime: getMapTimeSliderCenterTime(store, props.mapId),
|
|
28613
28596
|
secondsPerPx: getMapTimeSliderSecondsPerPx(store, props.mapId),
|
|
28614
|
-
|
|
28597
|
+
span: getMapTimeSliderSpan(store, props.mapId),
|
|
28615
28598
|
timeStep: getMapTimeStep(store, props.mapId),
|
|
28616
28599
|
isAnimating: isAnimating(store, props.mapId),
|
|
28617
28600
|
isAutoUpdating: isAutoUpdating(store, props.mapId),
|
|
@@ -28628,7 +28611,7 @@ var TimeSliderCurrentTimeBoxConnectComponent = function TimeSliderCurrentTimeBox
|
|
|
28628
28611
|
dimensions = _ref.dimensions,
|
|
28629
28612
|
centerTime = _ref.centerTime,
|
|
28630
28613
|
secondsPerPx = _ref.secondsPerPx,
|
|
28631
|
-
|
|
28614
|
+
span = _ref.span,
|
|
28632
28615
|
layers = _ref.layers,
|
|
28633
28616
|
timeStep = _ref.timeStep,
|
|
28634
28617
|
isAnimating = _ref.isAnimating,
|
|
@@ -28647,7 +28630,7 @@ var TimeSliderCurrentTimeBoxConnectComponent = function TimeSliderCurrentTimeBox
|
|
|
28647
28630
|
centerTime: centerTime,
|
|
28648
28631
|
secondsPerPx: secondsPerPx,
|
|
28649
28632
|
selectedTime: selectedTime,
|
|
28650
|
-
|
|
28633
|
+
span: span,
|
|
28651
28634
|
dataStartTime: dataStartTime,
|
|
28652
28635
|
dataEndTime: dataEndTime,
|
|
28653
28636
|
timeStep: timeStep,
|
|
@@ -29210,8 +29193,8 @@ var ReactMapViewLayer = function ReactMapViewLayer(props) {
|
|
|
29210
29193
|
* See the License for the specific language governing permissions and
|
|
29211
29194
|
* limitations under the License.
|
|
29212
29195
|
*
|
|
29213
|
-
* Copyright
|
|
29214
|
-
* Copyright
|
|
29196
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
29197
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
29215
29198
|
* */
|
|
29216
29199
|
var tileRenderSettings = {
|
|
29217
29200
|
WorldMap_Light_Grey_Canvas: {
|
|
@@ -29643,14 +29626,14 @@ var getFeatureLayers = function getFeatureLayers(children) {
|
|
|
29643
29626
|
};
|
|
29644
29627
|
/**
|
|
29645
29628
|
* Returns true if this is a maplayer and not a baselayer or overlayer
|
|
29646
|
-
* @param layer The Layer object, or the props from the ReactWMJSLayer
|
|
29629
|
+
* @param layer The layerTypes.Layer object, or the props from the ReactWMJSLayer
|
|
29647
29630
|
*/
|
|
29648
29631
|
var isAMapLayer = function isAMapLayer(layer) {
|
|
29649
29632
|
return layer.layerType === LayerType$1.mapLayer;
|
|
29650
29633
|
};
|
|
29651
29634
|
/**
|
|
29652
29635
|
* Returns true if this is a geojsonlayer (layer containing geojson field)
|
|
29653
|
-
* @param layer The Layer object, or the props from the ReactWMJSLayer
|
|
29636
|
+
* @param layer The layerTypes.Layer object, or the props from the ReactWMJSLayer
|
|
29654
29637
|
*/
|
|
29655
29638
|
var isAGeoJSONLayer = function isAGeoJSONLayer(layer) {
|
|
29656
29639
|
return layer.geojson !== undefined;
|
|
@@ -32425,7 +32408,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
32425
32408
|
myChildren.push(child);
|
|
32426
32409
|
takenIds.add(childProps.id);
|
|
32427
32410
|
} else {
|
|
32428
|
-
childProps.onLayerError(childProps, new Error("Duplicate layer id \"".concat(childProps.id, "\" encountered within this WebMap")), wmjsMap);
|
|
32411
|
+
childProps.onLayerError(childProps, new Error("Duplicate layer id \"".concat(childProps.id, "\" encountered within this mapTypes.WebMap")), wmjsMap);
|
|
32429
32412
|
console.warn('ReactWMJSLayer has a duplicate id', child);
|
|
32430
32413
|
}
|
|
32431
32414
|
} else {
|
|
@@ -32642,7 +32625,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
|
|
|
32642
32625
|
/* Check if webmapjs was not already initialized */
|
|
32643
32626
|
var existingWMJSMap = getWMJSMapById(mapId);
|
|
32644
32627
|
if (existingWMJSMap) {
|
|
32645
|
-
console.warn("Somehow ".concat(mapId, "unRegisterWMJSMap already exists"));
|
|
32628
|
+
console.warn("Somehow ".concat(mapId, "mapStoreUtils.unRegisterWMJSMap already exists"));
|
|
32646
32629
|
unRegisterWMJSMap(mapId);
|
|
32647
32630
|
}
|
|
32648
32631
|
var wmjsMap = new WMJSMap(this.adagucWebMapJSRef.current);
|
|
@@ -33493,7 +33476,7 @@ var OptionsMenuConnect = function OptionsMenuConnect(_ref) {
|
|
|
33493
33476
|
timeStepBtn: /*#__PURE__*/React__default.createElement(TimeStepButtonComponent, {
|
|
33494
33477
|
mapId: mapId
|
|
33495
33478
|
}),
|
|
33496
|
-
|
|
33479
|
+
timeSpanBtn: /*#__PURE__*/React__default.createElement(TimeSpanButtonConnect, {
|
|
33497
33480
|
mapId: mapId
|
|
33498
33481
|
})
|
|
33499
33482
|
});
|
|
@@ -57302,4 +57285,4 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
|
57302
57285
|
* */
|
|
57303
57286
|
var mapActions = Object.assign(Object.assign(Object.assign({}, layerActions), mapActions$1), serviceActions);
|
|
57304
57287
|
|
|
57305
|
-
export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, DockedLayerManagerConnect, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, index$1 as SyncGroups, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnect, TimeSliderConnect, TimeSliderLite, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, ZoomControls, appActions, componentsLookUp, coreModuleConfig, dateFormat, defaultBbox, defaultConfigurations, filterLayers, filterMapPresets, filterNonTimeDimensions, filterServices, generateLayerId, generateMapId, generateTimesliderId, selectors$1 as genericSelectors, getDrawFunctionFromStore, getFirstTimeStepForLayerId, getInitialAppPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, layerActions, reducer$7 as layerReducer, selectors$4 as layerSelectors, types$3 as layerTypes, mapActions, moduleConfig as mapModuleConfig, selectors as mapSelectors, types$2 as mapTypes, utils$1 as mapUtils, parseBoolean, parseLayer, publicLayers, publicServices, registerDrawFunction, registerWMJSMap, registerWMLayer, routerActions, selectors$5 as serviceSelectors, snackbarActions, store, genericActions as syncGroupActions, selectors$2 as syncGroupsSelectors, synchronizationGroupConfig as synchronizationGroupModuleConfig, synchronizationGroupConfig as synchronizationGroupsConfig, testLayers, timeSliderUtils, uiActions, uiModuleConfig, reducer$6 as uiReducer, selectors$3 as uiSelectors, types as uiTypes, unRegisterAllWMJSLayersAndMaps, unRegisterWMJSLayer, unRegisterWMJSMap, useFetchServices, useSetupDialog, reducer$5 as webmapReducer };
|
|
57288
|
+
export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, DockedLayerManagerConnect, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, index$1 as SyncGroups, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnect, TimeSliderConnect, TimeSliderLite, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, ZoomControls, appActions, componentsLookUp, coreModuleConfig, dateFormat, defaultBbox, defaultConfigurations, filterLayers, filterMapPresets, filterNonTimeDimensions, filterServices, generateLayerId, generateMapId, generateTimesliderId, selectors$1 as genericSelectors, getDrawFunctionFromStore, getFirstTimeStepForLayerId, getInitialAppPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, layerActions, reducer$7 as layerReducer, selectors$4 as layerSelectors, types$3 as layerTypes, mapActions, enums as mapEnums, moduleConfig as mapModuleConfig, selectors as mapSelectors, types$2 as mapTypes, utils$1 as mapUtils, parseBoolean, parseLayer, publicLayers, publicServices, registerDrawFunction, registerWMJSMap, registerWMLayer, routerActions, selectors$5 as serviceSelectors, snackbarActions, store, genericActions as syncGroupActions, selectors$2 as syncGroupsSelectors, synchronizationGroupConfig as synchronizationGroupModuleConfig, synchronizationGroupConfig as synchronizationGroupsConfig, testLayers, timeSliderUtils, uiActions, uiModuleConfig, reducer$6 as uiReducer, selectors$3 as uiSelectors, types$1 as uiTypes, unRegisterAllWMJSLayersAndMaps, unRegisterWMJSLayer, unRegisterWMJSMap, useFetchServices, useSetupDialog, reducer$5 as webmapReducer };
|