@opengeoweb/time-series 19.1.0 → 19.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/README.md +38 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +8909 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/lib/components/ComponentsLookUp/componentsLookUp.d.ts +24 -0
- package/dist/src/lib/components/ComponentsLookUp/index.d.ts +1 -0
- package/dist/src/lib/components/Providers/Providers.d.ts +32 -0
- package/dist/src/lib/components/Providers/index.d.ts +1 -0
- package/dist/src/lib/components/TimeSeries/LocationDropdown/LocationDropdown.d.ts +13 -0
- package/dist/src/lib/components/TimeSeries/LocationDropdown/LocationDropdownHeader.d.ts +7 -0
- package/dist/src/lib/components/TimeSeries/LocationDropdown/LocationListItem.d.ts +8 -0
- package/dist/src/lib/components/TimeSeries/LocationDropdown/OverflowTooltip.d.ts +9 -0
- package/dist/src/lib/components/TimeSeries/LocationDropdown/testData.d.ts +2 -0
- package/dist/src/lib/components/TimeSeries/LocationInfo/LocationInfo.d.ts +30 -0
- package/dist/src/lib/components/TimeSeries/LocationInfo/LocationInfoButtonConnect.d.ts +7 -0
- package/dist/src/lib/components/TimeSeries/LocationInfo/LocationInfoConnect.d.ts +2 -0
- package/dist/src/lib/components/TimeSeries/LocationSelect/LocationSelectButtonConnect.d.ts +6 -0
- package/dist/src/lib/components/TimeSeries/LocationSelect/LocationSelectDialogConnect.d.ts +2 -0
- package/dist/src/lib/components/TimeSeries/LocationSelect/index.d.ts +1 -0
- package/dist/src/lib/components/TimeSeries/TimeSeriesChart.d.ts +34 -0
- package/dist/src/lib/components/TimeSeries/TimeSeriesConnect.d.ts +9 -0
- package/dist/src/lib/components/TimeSeries/TimeSeriesConnectWrapper.d.ts +9 -0
- package/dist/src/lib/components/TimeSeries/TimeSeriesMarkersSwitch.d.ts +6 -0
- package/dist/src/lib/components/TimeSeries/TimeSeriesTopRowButton.d.ts +9 -0
- package/dist/src/lib/components/TimeSeries/TimeSeriesView.d.ts +16 -0
- package/dist/src/lib/components/TimeSeries/chartUtils.d.ts +43 -0
- package/dist/src/lib/components/TimeSeries/types.d.ts +251 -0
- package/dist/src/lib/components/TimeSeries/utils.d.ts +25 -0
- package/dist/src/lib/components/TimeSeriesAddPlot/TimeSeriesAddPlot.d.ts +10 -0
- package/dist/src/lib/components/TimeSeriesManager/ParameterInfo/ParameterInfoButton.d.ts +8 -0
- package/dist/src/lib/components/TimeSeriesManager/ParameterInfo/ParameterInfoButtonConnect.d.ts +8 -0
- package/dist/src/lib/components/TimeSeriesManager/ParameterInfo/ParameterInfoDialog.d.ts +43 -0
- package/dist/src/lib/components/TimeSeriesManager/ParameterInfo/ParameterInfoDialogConnect.d.ts +2 -0
- package/dist/src/lib/components/TimeSeriesManager/ParameterList.d.ts +15 -0
- package/dist/src/lib/components/TimeSeriesManager/PlotRows.d.ts +21 -0
- package/dist/src/lib/components/TimeSeriesManager/RowLayout.d.ts +10 -0
- package/dist/src/lib/components/TimeSeriesManager/TimeSeriesManager.d.ts +40 -0
- package/dist/src/lib/components/TimeSeriesManager/TimeSeriesManagerConnect.d.ts +9 -0
- package/dist/src/lib/components/TimeSeriesManager/TimeSeriesManagerMapButtonConnect.d.ts +7 -0
- package/dist/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterColorSelect.d.ts +11 -0
- package/dist/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterDimensionIdSelect.d.ts +12 -0
- package/dist/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterDimensionSelect.d.ts +10 -0
- package/dist/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterDimensionValueSelect.d.ts +11 -0
- package/dist/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterNameSelect.d.ts +10 -0
- package/dist/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterOpacitySelect.d.ts +10 -0
- package/dist/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterReferenceTimeSelect.d.ts +10 -0
- package/dist/src/lib/components/TimeSeriesManager/TimeSeriesManagerParameterComponents/ParameterTypeSelect.d.ts +10 -0
- package/dist/src/lib/components/TimeSeriesManager/TimeSeriesManagerRowAccordion.d.ts +16 -0
- package/dist/src/lib/components/TimeSeriesManager/index.d.ts +1 -0
- package/dist/src/lib/components/TimeSeriesSelect/ServiceChips/ServiceChip.d.ts +11 -0
- package/dist/src/lib/components/TimeSeriesSelect/ServiceChips/ServiceChipConnect.d.ts +12 -0
- package/dist/src/lib/components/TimeSeriesSelect/ServiceOptionsConnect.d.ts +6 -0
- package/dist/src/lib/components/TimeSeriesSelect/ServiceOptionsDialog.d.ts +13 -0
- package/dist/src/lib/components/TimeSeriesSelect/ServicePopup/ServicePopup.d.ts +18 -0
- package/dist/src/lib/components/TimeSeriesSelect/ServicePopup/ServicePopupConnect.d.ts +6 -0
- package/dist/src/lib/components/TimeSeriesSelect/ServicePopup/ServicePopupDialogConnect.d.ts +12 -0
- package/dist/src/lib/components/TimeSeriesSelect/ServicePopup/utils.d.ts +4 -0
- package/dist/src/lib/components/TimeSeriesSelect/TimeSeriesSearchConnect.d.ts +6 -0
- package/dist/src/lib/components/TimeSeriesSelect/TimeSeriesSelect.d.ts +15 -0
- package/dist/src/lib/components/TimeSeriesSelect/TimeSeriesSelectButtonConnect.d.ts +11 -0
- package/dist/src/lib/components/TimeSeriesSelect/TimeSeriesSelectConnect.d.ts +7 -0
- package/dist/src/lib/components/TimeSeriesSelect/TimeSeriesSelectList.d.ts +19 -0
- package/dist/src/lib/components/TimeSeriesSelect/TimeSeriesSelectListConnect.d.ts +12 -0
- package/dist/src/lib/components/TimeSeriesSelect/TimeSeriesServiceList.d.ts +9 -0
- package/dist/src/lib/components/TimeSeriesSelect/TimeSeriesServiceListConnect.d.ts +8 -0
- package/dist/src/lib/components/TimeSeriesSelect/utils.d.ts +16 -0
- package/dist/src/lib/constants.d.ts +66 -0
- package/dist/src/lib/index.d.ts +10 -0
- package/dist/src/lib/store/index.d.ts +4 -0
- package/dist/src/lib/store/listeners.d.ts +2 -0
- package/dist/src/lib/store/reducer.d.ts +54 -0
- package/dist/src/lib/store/selectors.d.ts +433 -0
- package/dist/src/lib/store/store.d.ts +7 -0
- package/dist/src/lib/store/types.d.ts +152 -0
- package/dist/src/lib/storybookUtils/SimpleLinkMenu.d.ts +6 -0
- package/dist/src/lib/storybookUtils/ToggleThemeButton.d.ts +2 -0
- package/dist/src/lib/storybookUtils/chartSeriesExampleData.d.ts +4 -0
- package/dist/src/lib/storybookUtils/defaultStorySettings.d.ts +18 -0
- package/dist/src/lib/utils/edrUtils.d.ts +62 -0
- package/dist/src/lib/utils/fakeData/mockDimensions.d.ts +2 -0
- package/dist/src/lib/utils/fakeData/mockGeoJSON.d.ts +2 -0
- package/dist/src/lib/utils/fakeData/mockTimeSeriesServices.d.ts +2 -0
- package/dist/src/lib/utils/i18n.d.ts +6 -0
- package/dist/src/lib/utils/localStorage.d.ts +3 -0
- package/dist/src/lib/utils/mocks/handlers.d.ts +189 -0
- package/dist/src/lib/utils/mocks/index.d.ts +2 -0
- package/dist/src/lib/utils/mocks/server.d.ts +1 -0
- package/dist/src/lib/utils/timeseries-api/api.d.ts +41 -0
- package/dist/src/lib/utils/timeseries-api/fakeApi.d.ts +1 -0
- package/dist/src/lib/utils/timeseries-api/hooks.d.ts +70 -0
- package/dist/src/lib/utils/utils.d.ts +3 -0
- package/package.json +4 -3
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TimeSeriesService } from '@opengeoweb/shared';
|
|
3
|
+
import type { PlotPreset } from '../TimeSeries/types';
|
|
4
|
+
interface InitialTimeseriesProps {
|
|
5
|
+
plotPreset: PlotPreset;
|
|
6
|
+
services: TimeSeriesService[];
|
|
7
|
+
hideLocationMarkers?: boolean;
|
|
8
|
+
syncGroupsIds: string[];
|
|
9
|
+
}
|
|
10
|
+
export type SupportedComponentTypes = 'TimeSeries';
|
|
11
|
+
export type InitialProps = InitialTimeseriesProps;
|
|
12
|
+
export interface ComponentsLookUpPayload {
|
|
13
|
+
componentType: SupportedComponentTypes;
|
|
14
|
+
id: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
initialProps: InitialProps;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The lookup table is for registering your own components with the workspace.
|
|
20
|
+
* @param payload
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare const componentsLookUp: ({ id: panelId, componentType, initialProps, }: ComponentsLookUpPayload) => React.ReactElement;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './componentsLookUp';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Theme } from '@mui/material';
|
|
2
|
+
import type { Store } from '@reduxjs/toolkit';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import type { ThemeProviderProps } from '@opengeoweb/theme';
|
|
5
|
+
export declare const TimeSeriesThemeWrapper: React.FC<ThemeProviderProps>;
|
|
6
|
+
interface TimeSeriesApiProviderProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
interface TimeSeriesThemeStoreProviderProps {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
theme?: Theme;
|
|
12
|
+
store: Store;
|
|
13
|
+
}
|
|
14
|
+
interface TimeseriesTranslationWrapperProps {
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A Provider component which returns the Api Provider for the TimeSeries library
|
|
19
|
+
* @param children
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare const TimeSeriesApiProvider: React.FC<TimeSeriesApiProviderProps>;
|
|
23
|
+
export interface TimeSeriesStoreProviderProps extends ThemeProviderProps {
|
|
24
|
+
store: Store;
|
|
25
|
+
}
|
|
26
|
+
export declare const TimeSerieStoreProvider: React.FC<{
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
store: Store;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const TimeSeriesThemeStoreProvider: React.FC<TimeSeriesThemeStoreProviderProps>;
|
|
31
|
+
export declare const TimeseriesI18nProvider: React.FC<TimeseriesTranslationWrapperProps>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Providers';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FeatureCollection, GeometryObject } from 'geojson';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { GeoJsonWithService } from '../types';
|
|
4
|
+
interface LocationDropdownProps {
|
|
5
|
+
splitGeoJson?: GeoJsonWithService[];
|
|
6
|
+
handleChange: (newSelectedLocation: string) => void;
|
|
7
|
+
selectedLocation: string;
|
|
8
|
+
geoJson?: FeatureCollection<GeometryObject>;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
defaultExpanded?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const LocationDropdown: React.FC<LocationDropdownProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface LocationListItemProps {
|
|
3
|
+
location: string;
|
|
4
|
+
handleChange: (newSelectedLocation: string) => void;
|
|
5
|
+
selectedLocation: string;
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const LocationListItem: React.FC<LocationListItemProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Feature, GeometryObject } from 'geojson';
|
|
2
|
+
import type { TimeSeriesService } from '@opengeoweb/shared';
|
|
3
|
+
import type { MapLocation } from '@opengeoweb/webmap-react';
|
|
4
|
+
export interface ParameterInfo {
|
|
5
|
+
loading: boolean;
|
|
6
|
+
parameters: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface CalculatedLocationCollectionInfo {
|
|
9
|
+
properties: Record<string, string>;
|
|
10
|
+
parameterIndex: number;
|
|
11
|
+
}
|
|
12
|
+
export interface CalculatedLocationInfo {
|
|
13
|
+
geometry: GeometryObject;
|
|
14
|
+
properties: Record<string, string>;
|
|
15
|
+
collections: CalculatedLocationCollectionInfo[];
|
|
16
|
+
}
|
|
17
|
+
export interface LocationInfoProps {
|
|
18
|
+
feature?: Feature<GeometryObject> | null;
|
|
19
|
+
mapPinLocation?: MapLocation;
|
|
20
|
+
services?: TimeSeriesService[];
|
|
21
|
+
isOpen: boolean;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
onMouseDown: () => void;
|
|
24
|
+
order: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const LocationInfo: React.FC<LocationInfoProps>;
|
|
27
|
+
export interface ParameterInfoTextProps {
|
|
28
|
+
label: string;
|
|
29
|
+
value: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LocationSelectDialogConnect';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { EChartsInstance, EChartsOption } from 'echarts-for-react';
|
|
2
|
+
import ReactECharts from 'echarts-for-react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import type { PlotWithData } from './types';
|
|
5
|
+
export declare const useChartHeight: ({ plotsWithData, shouldShowLegend, option, onLegendHeightChange, }: {
|
|
6
|
+
plotsWithData: PlotWithData[];
|
|
7
|
+
shouldShowLegend: boolean;
|
|
8
|
+
option: EChartsOption;
|
|
9
|
+
onLegendHeightChange?: (height: number) => void;
|
|
10
|
+
}) => {
|
|
11
|
+
chartHeight: number;
|
|
12
|
+
chartRef: React.RefObject<ReactECharts | null>;
|
|
13
|
+
updateHeight: (echartsInstance: EChartsInstance) => void;
|
|
14
|
+
};
|
|
15
|
+
export interface DataZoomState {
|
|
16
|
+
start: number;
|
|
17
|
+
end: number;
|
|
18
|
+
}
|
|
19
|
+
export declare const applyDataZoomState: (option: EChartsOption, dataZoomState: DataZoomState | null) => EChartsOption;
|
|
20
|
+
export declare const extractDataZoomState: (params: {
|
|
21
|
+
start?: number;
|
|
22
|
+
end?: number;
|
|
23
|
+
batch?: {
|
|
24
|
+
start: number;
|
|
25
|
+
end: number;
|
|
26
|
+
}[];
|
|
27
|
+
}) => DataZoomState | null;
|
|
28
|
+
export declare const TimeSeriesChart: React.FC<{
|
|
29
|
+
plotsWithData: PlotWithData[];
|
|
30
|
+
animation?: boolean;
|
|
31
|
+
shouldShowLegend?: boolean;
|
|
32
|
+
onToggleLegendParam?: (legendId: string) => void;
|
|
33
|
+
onLegendHeightChange?: (height: number) => void;
|
|
34
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TimeSeriesService } from '@opengeoweb/shared';
|
|
3
|
+
import type { Parameter } from './types';
|
|
4
|
+
import type { GetLocationsOption } from '../../utils/timeseries-api/hooks';
|
|
5
|
+
export declare const getUniqueServicesFromPreset: (parameters: Parameter[], services: TimeSeriesService[]) => GetLocationsOption[];
|
|
6
|
+
export interface TimeSeriesConnectProps {
|
|
7
|
+
panelId: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const TimeSeriesConnect: React.FC<TimeSeriesConnectProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TimeSeriesPreset } from '../../store/types';
|
|
3
|
+
interface Props {
|
|
4
|
+
panelId: string;
|
|
5
|
+
timeSeriesPreset: TimeSeriesPreset;
|
|
6
|
+
hideLocationMarkers?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const TimeSeriesConnectWrapper: React.FC<Props>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CustomToggleButtonProps } from '@opengeoweb/shared';
|
|
3
|
+
interface TimeSeriesButtonProps extends CustomToggleButtonProps {
|
|
4
|
+
icon: React.ReactNode;
|
|
5
|
+
shortText?: string;
|
|
6
|
+
longText: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const TimeSeriesTopRowButton: import("@emotion/styled").StyledComponent<Omit<TimeSeriesButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PlotPreset, TimeSeriesService } from '@opengeoweb/shared';
|
|
3
|
+
import type { TimeSliderStartEndStep } from '@opengeoweb/store';
|
|
4
|
+
import type { PointerLocation, GeoJsonWithService } from './types';
|
|
5
|
+
interface TimeSeriesViewProps {
|
|
6
|
+
plotPreset: PlotPreset;
|
|
7
|
+
selectedLocation: PointerLocation;
|
|
8
|
+
services: TimeSeriesService[];
|
|
9
|
+
splitGeoJsonByCollection: GeoJsonWithService[];
|
|
10
|
+
isLoading?: (startOrFinish: boolean) => void;
|
|
11
|
+
shouldShowLegend?: boolean;
|
|
12
|
+
onToggleLegendParam?: (legendId: string) => void;
|
|
13
|
+
syncgroupTimeState?: TimeSliderStartEndStep;
|
|
14
|
+
}
|
|
15
|
+
export declare const TimeSeriesView: React.FC<TimeSeriesViewProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { EChartsOption, XAXisComponentOption, YAXisComponentOption, GridComponentOption, LineSeriesOption, BarSeriesOption, ScatterSeriesOption } from 'echarts';
|
|
2
|
+
import type { ParameterWithData, Plot, PlotWithData } from './types';
|
|
3
|
+
export declare const MIN_GRAPH_WIDTH = 300;
|
|
4
|
+
export declare const dateFormatter: (date: string) => string;
|
|
5
|
+
export declare const getTooltipTimeLabel: (date: string) => string;
|
|
6
|
+
export declare const createParameterNames: (plotsWithData: PlotWithData[]) => {
|
|
7
|
+
name: string;
|
|
8
|
+
id: string;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
}[];
|
|
11
|
+
interface ParamIntervalType {
|
|
12
|
+
unit?: string;
|
|
13
|
+
propertyName?: string;
|
|
14
|
+
presentation?: string;
|
|
15
|
+
interval: number;
|
|
16
|
+
minNumberOfIntervals?: number;
|
|
17
|
+
maxNumberOfIntervals?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare const paramIntervals: ParamIntervalType[];
|
|
20
|
+
export declare const getYAxis: (plotCharts: PlotChart[]) => YAXisComponentOption[];
|
|
21
|
+
export declare const getXAxis: (plotCharts: PlotChart[]) => XAXisComponentOption[];
|
|
22
|
+
export declare const getParameterDisplayName: (parameter: ParameterWithData) => string;
|
|
23
|
+
export declare const roundDecimalValues: (value: number) => string;
|
|
24
|
+
export declare const getOption: (plotsWithData: PlotWithData[], shouldShowLegend?: boolean) => EChartsOption;
|
|
25
|
+
export declare const getEChartsSeriesDataByTimestep: (timesteps: Date[], parameter: ParameterWithData) => (number | string)[][];
|
|
26
|
+
export declare const getSeries: (plotCharts: PlotChart[], parameterNames: {
|
|
27
|
+
name: string;
|
|
28
|
+
id: string;
|
|
29
|
+
}[]) => (LineSeriesOption | BarSeriesOption | ScatterSeriesOption)[];
|
|
30
|
+
export declare const getGrid: (plotCharts: PlotChart[]) => GridComponentOption[];
|
|
31
|
+
export declare const Y_AXIS_OFFSET = 80;
|
|
32
|
+
export declare const PLOT_HEIGHT = 150;
|
|
33
|
+
export interface PlotChart extends Plot {
|
|
34
|
+
parametersByUnit: Record<string, ParameterWithData[]>;
|
|
35
|
+
countPreviousUnits: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* This function iterates over all added plots and paramters, finds the min and max values from all datasets to determine how to set the timespan
|
|
39
|
+
* @param PlotsWithData Plots that contain fetched parameter data
|
|
40
|
+
* @returns left and right values for the timespan
|
|
41
|
+
*/
|
|
42
|
+
export declare const CalculateTimeSpan: (plotsWithData: PlotWithData[]) => Record<string, Date>;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import type { FeatureCollection, GeometryObject } from 'geojson';
|
|
2
|
+
import type { syncGroupsTypes } from '@opengeoweb/store';
|
|
3
|
+
import type { MapFeatureClass } from '@opengeoweb/webmap-react';
|
|
4
|
+
export interface Geometry {
|
|
5
|
+
type: string;
|
|
6
|
+
coordinates: number[];
|
|
7
|
+
}
|
|
8
|
+
export interface Properties {
|
|
9
|
+
timestep: Date[];
|
|
10
|
+
propertyName: string;
|
|
11
|
+
values: number[];
|
|
12
|
+
}
|
|
13
|
+
export interface FailedParameterInfo {
|
|
14
|
+
propertyName: string;
|
|
15
|
+
serviceId: string;
|
|
16
|
+
collectionId: string;
|
|
17
|
+
}
|
|
18
|
+
export interface UseGetLocationReturnTypeProperties {
|
|
19
|
+
name?: string;
|
|
20
|
+
detail?: string;
|
|
21
|
+
serviceId: string;
|
|
22
|
+
collectionId: string;
|
|
23
|
+
parameterName?: string[];
|
|
24
|
+
mapFeatureClass: MapFeatureClass;
|
|
25
|
+
}
|
|
26
|
+
export interface ObservationProperties {
|
|
27
|
+
timestep: string[];
|
|
28
|
+
observedPropertyName: string;
|
|
29
|
+
result: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface Feature {
|
|
32
|
+
type: string;
|
|
33
|
+
geometry: Geometry;
|
|
34
|
+
properties: ObservationProperties;
|
|
35
|
+
}
|
|
36
|
+
export interface ParameterApiData {
|
|
37
|
+
type: string;
|
|
38
|
+
features: Feature[];
|
|
39
|
+
timeStamp: string;
|
|
40
|
+
numberReturned: number;
|
|
41
|
+
}
|
|
42
|
+
export interface PlotPreset {
|
|
43
|
+
mapId: string;
|
|
44
|
+
plots: Plot[];
|
|
45
|
+
parameters: Parameter[];
|
|
46
|
+
}
|
|
47
|
+
export interface Plot {
|
|
48
|
+
title: string;
|
|
49
|
+
plotId: string;
|
|
50
|
+
enabled?: boolean;
|
|
51
|
+
parameters?: Parameter[];
|
|
52
|
+
}
|
|
53
|
+
export interface PlotWithData extends Plot {
|
|
54
|
+
parametersWithData: ParameterWithData[];
|
|
55
|
+
errors?: string[];
|
|
56
|
+
failedParameters?: FailedParameterInfo[];
|
|
57
|
+
}
|
|
58
|
+
export type PlotType = 'bar' | 'line' | 'scatter';
|
|
59
|
+
export interface Parameter {
|
|
60
|
+
id?: string;
|
|
61
|
+
plotId: string;
|
|
62
|
+
unit?: string;
|
|
63
|
+
propertyName: string;
|
|
64
|
+
propertyLabel?: string;
|
|
65
|
+
plotType: PlotType | 'area';
|
|
66
|
+
enabled?: boolean;
|
|
67
|
+
color?: string;
|
|
68
|
+
opacity?: number;
|
|
69
|
+
serviceId: string;
|
|
70
|
+
collectionId: string;
|
|
71
|
+
instanceId?: string;
|
|
72
|
+
instances?: EDRInstance[];
|
|
73
|
+
dimension?: {
|
|
74
|
+
id: string;
|
|
75
|
+
value: string;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export type ParameterForFetching = Pick<Parameter, 'propertyName' | 'serviceId' | 'collectionId' | 'instanceId' | 'dimension'>;
|
|
79
|
+
export interface ParameterWithData extends Parameter {
|
|
80
|
+
timestep: Date[];
|
|
81
|
+
value: number[];
|
|
82
|
+
unit: string;
|
|
83
|
+
}
|
|
84
|
+
export interface PointerLocation {
|
|
85
|
+
lon: number;
|
|
86
|
+
lat: number;
|
|
87
|
+
}
|
|
88
|
+
export interface TimeSeriesLocation extends PointerLocation {
|
|
89
|
+
id?: string;
|
|
90
|
+
occurrences?: syncGroupsTypes.Occurrence[];
|
|
91
|
+
}
|
|
92
|
+
export declare const isTimeSeriesLocation: (obj: PointerLocation | TimeSeriesLocation) => obj is TimeSeriesLocation;
|
|
93
|
+
export interface EDRAxes {
|
|
94
|
+
t: {
|
|
95
|
+
values: string[];
|
|
96
|
+
};
|
|
97
|
+
x: {
|
|
98
|
+
values: number[];
|
|
99
|
+
};
|
|
100
|
+
y: {
|
|
101
|
+
values: number[];
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export interface EDRDomain {
|
|
105
|
+
axes: EDRAxes;
|
|
106
|
+
}
|
|
107
|
+
export interface EDRObservedProperty {
|
|
108
|
+
id: string;
|
|
109
|
+
label: EDRI18nString;
|
|
110
|
+
}
|
|
111
|
+
export type EDRI18nString = string | Record<string, string>;
|
|
112
|
+
export interface EDRParameter {
|
|
113
|
+
id: string;
|
|
114
|
+
label?: string;
|
|
115
|
+
observedProperty?: EDRObservedProperty;
|
|
116
|
+
unit?: {
|
|
117
|
+
label?: EDRI18nString;
|
|
118
|
+
symbol?: string | {
|
|
119
|
+
type: string;
|
|
120
|
+
value: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
export type EDRParameters = Record<string, EDRParameter>;
|
|
125
|
+
export interface EDRRangeParameter {
|
|
126
|
+
axisNames: string[];
|
|
127
|
+
dataType: string;
|
|
128
|
+
shape: number[];
|
|
129
|
+
type: string;
|
|
130
|
+
values: number[];
|
|
131
|
+
}
|
|
132
|
+
export type EDRRange = Record<string, EDRRangeParameter>;
|
|
133
|
+
export interface EDRPositionResponse {
|
|
134
|
+
type: string;
|
|
135
|
+
domain: EDRDomain;
|
|
136
|
+
parameters: EDRParameters;
|
|
137
|
+
ranges?: EDRRange;
|
|
138
|
+
}
|
|
139
|
+
export interface EDRPositionResponseCoverageCollection {
|
|
140
|
+
coverages: EDRPositionResponse[];
|
|
141
|
+
parameters: EDRParameters;
|
|
142
|
+
type: string;
|
|
143
|
+
}
|
|
144
|
+
export interface EDRDataQueriesObject {
|
|
145
|
+
cube?: object;
|
|
146
|
+
locations?: object;
|
|
147
|
+
position?: object;
|
|
148
|
+
instances?: object;
|
|
149
|
+
}
|
|
150
|
+
export interface EDRExtentObject {
|
|
151
|
+
temporal?: {
|
|
152
|
+
interval: string[][];
|
|
153
|
+
trs: string;
|
|
154
|
+
values: string[];
|
|
155
|
+
};
|
|
156
|
+
spatial?: {
|
|
157
|
+
crs: string;
|
|
158
|
+
bbox: [[number, number, number, number]];
|
|
159
|
+
};
|
|
160
|
+
custom?: CustomDimension[];
|
|
161
|
+
}
|
|
162
|
+
export interface EDRCollection {
|
|
163
|
+
parameter_names?: object;
|
|
164
|
+
parameters?: object;
|
|
165
|
+
data_queries?: EDRDataQueriesObject;
|
|
166
|
+
extent?: EDRExtentObject;
|
|
167
|
+
id: string;
|
|
168
|
+
title: string;
|
|
169
|
+
description: string;
|
|
170
|
+
}
|
|
171
|
+
export interface EDRInstance {
|
|
172
|
+
id: string;
|
|
173
|
+
data_queries?: {
|
|
174
|
+
position?: {
|
|
175
|
+
link: {
|
|
176
|
+
variables: {
|
|
177
|
+
output_formats: string[];
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
locations?: {
|
|
182
|
+
link: {
|
|
183
|
+
variables: {
|
|
184
|
+
output_formats: string[];
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
instances?: {
|
|
189
|
+
link: string;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
extent?: {
|
|
193
|
+
temporal?: {
|
|
194
|
+
interval: string[][];
|
|
195
|
+
trs: string;
|
|
196
|
+
values: string[];
|
|
197
|
+
};
|
|
198
|
+
spatial: {
|
|
199
|
+
crs: string;
|
|
200
|
+
bbox: [[number, number, number, number]];
|
|
201
|
+
};
|
|
202
|
+
custom?: CustomDimension[];
|
|
203
|
+
};
|
|
204
|
+
parameter_names?: object;
|
|
205
|
+
parameters?: object;
|
|
206
|
+
}
|
|
207
|
+
export interface ParameterApiDataRequest {
|
|
208
|
+
urlDomain: string;
|
|
209
|
+
lon: number;
|
|
210
|
+
lat: number;
|
|
211
|
+
parameterName: string;
|
|
212
|
+
}
|
|
213
|
+
export interface EdrCollection {
|
|
214
|
+
id: string;
|
|
215
|
+
description: string;
|
|
216
|
+
parameters: SelectParameter[];
|
|
217
|
+
customDimensions?: CustomDimension[];
|
|
218
|
+
}
|
|
219
|
+
export type EdrCollections = Record<string, {
|
|
220
|
+
id: string;
|
|
221
|
+
title: string;
|
|
222
|
+
description: string;
|
|
223
|
+
parameters: SelectParameter[];
|
|
224
|
+
}>;
|
|
225
|
+
export interface SelectParameter {
|
|
226
|
+
propertyName: string;
|
|
227
|
+
propertyLabel?: string;
|
|
228
|
+
unit: string;
|
|
229
|
+
plotType: PlotType;
|
|
230
|
+
serviceId: string;
|
|
231
|
+
collectionId: string;
|
|
232
|
+
color: string;
|
|
233
|
+
instanceId?: string;
|
|
234
|
+
instances?: EDRInstance[];
|
|
235
|
+
}
|
|
236
|
+
export interface ParameterListStyles {
|
|
237
|
+
plot: React.CSSProperties;
|
|
238
|
+
row: React.CSSProperties;
|
|
239
|
+
rowText: React.CSSProperties;
|
|
240
|
+
}
|
|
241
|
+
export interface GeoJsonWithService {
|
|
242
|
+
collectionName: string;
|
|
243
|
+
serviceName: string;
|
|
244
|
+
geoJson: FeatureCollection<GeometryObject>;
|
|
245
|
+
}
|
|
246
|
+
export interface CustomDimension {
|
|
247
|
+
id: string;
|
|
248
|
+
interval: [number, number] | [string, string];
|
|
249
|
+
reference: string;
|
|
250
|
+
values: number[] | string[];
|
|
251
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { FeatureCollection, GeometryObject } from 'geojson';
|
|
2
|
+
import type { Plot, PlotParameter, PlotPreset, TimeSeriesService } from '@opengeoweb/shared';
|
|
3
|
+
import type { syncGroupsTypes } from '@opengeoweb/store';
|
|
4
|
+
import type { EDRPositionResponse, EDRPositionResponseCoverageCollection, FailedParameterInfo, GeoJsonWithService, Parameter, ParameterWithData, PlotWithData, PointerLocation, TimeSeriesLocation, UseGetLocationReturnTypeProperties } from './types';
|
|
5
|
+
/** Maps plot ID to array of error message strings */
|
|
6
|
+
export type PlotErrorsMap = Record<Plot['plotId'], string[]>;
|
|
7
|
+
/** Maps plot ID to array of failed parameter information */
|
|
8
|
+
export type FailedParametersMap = Record<Plot['plotId'], FailedParameterInfo[]>;
|
|
9
|
+
export declare const createGeoJsonArrays: (locations: (FeatureCollection<GeometryObject, UseGetLocationReturnTypeProperties> | undefined)[], services: TimeSeriesService[] | undefined, hideFeatures: boolean, memoizedSelectedFeature: TimeSeriesLocation | null) => {
|
|
10
|
+
combinedGeoJson: FeatureCollection<GeometryObject, syncGroupsTypes.PotentialDataProperties>;
|
|
11
|
+
};
|
|
12
|
+
export declare const getNearbyLocation: (parameter: Parameter, service: TimeSeriesService, selectedLocation: PointerLocation, geojsonMap: Map<string, GeoJsonWithService>) => TimeSeriesLocation | null;
|
|
13
|
+
export declare const getPlotsWithParameters: (plots: Plot[], parameters: ParameterWithData[], plotErrors?: PlotErrorsMap, failedParameters?: FailedParametersMap) => PlotWithData[];
|
|
14
|
+
export declare function consolidateFeatures<P>(features: {
|
|
15
|
+
id: string;
|
|
16
|
+
geoJSON: FeatureCollection<GeometryObject, P>;
|
|
17
|
+
}[]): FeatureCollection<GeometryObject, P>;
|
|
18
|
+
export declare const combineParametersWithData: (parameters: Parameter[], data: ParameterWithData[]) => ParameterWithData[];
|
|
19
|
+
export interface ParameterCollectionQueryData {
|
|
20
|
+
serviceId: string;
|
|
21
|
+
service: TimeSeriesService;
|
|
22
|
+
collectionId: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const extractUsedCollections: (plotsWithoutData: PlotPreset, services: TimeSeriesService[]) => Record<string, ParameterCollectionQueryData>;
|
|
25
|
+
export declare const extractDataFromfetchEdrParameterResponse: (edrResponse: EDRPositionResponse | EDRPositionResponseCoverageCollection | null, parameter: PlotParameter) => ParameterWithData | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { PlotPreset } from '../TimeSeries/types';
|
|
4
|
+
interface AddPlotButtonProps {
|
|
5
|
+
handleClick: (title: string) => void;
|
|
6
|
+
plotState: PlotPreset;
|
|
7
|
+
t: TFunction;
|
|
8
|
+
}
|
|
9
|
+
export declare const AddPlotButton: React.FC<AddPlotButtonProps>;
|
|
10
|
+
export {};
|
package/dist/src/lib/components/TimeSeriesManager/ParameterInfo/ParameterInfoButtonConnect.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Parameter } from '../../TimeSeries/types';
|
|
3
|
+
interface ParameterInfoButtonProps {
|
|
4
|
+
parameter: Parameter;
|
|
5
|
+
panelId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ParameterInfoButtonConnect: React.FC<ParameterInfoButtonProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TimeSeriesService } from '@opengeoweb/shared';
|
|
3
|
+
import type { uiTypes } from '@opengeoweb/store';
|
|
4
|
+
import type { EDRInstance, Parameter } from '../../TimeSeries/types';
|
|
5
|
+
import type { TimeseriesCollectionDetail } from '../../TimeSeriesSelect/utils';
|
|
6
|
+
export interface ParameterInfoDialogProps {
|
|
7
|
+
currentParameterInfo: Parameter;
|
|
8
|
+
relatedService: TimeSeriesService | undefined;
|
|
9
|
+
collectionInformation: TimeseriesCollectionDetail | undefined;
|
|
10
|
+
isLoadingCollectionInformation: boolean;
|
|
11
|
+
instanceInformation: EDRInstance[] | undefined;
|
|
12
|
+
isLoadingInstanceInformation: boolean;
|
|
13
|
+
supportsInstances: boolean;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
onMouseDown?: () => void;
|
|
17
|
+
order?: number;
|
|
18
|
+
source?: uiTypes.Source;
|
|
19
|
+
dialogHeight?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare const ParameterInfoDialog: React.FC<ParameterInfoDialogProps>;
|
|
22
|
+
export declare const QueryInfoElement: React.FC<{
|
|
23
|
+
queryInformation: TimeseriesCollectionDetail | undefined;
|
|
24
|
+
isLoadingCollectionInformation: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const DimensionInfoElement: React.FC<{
|
|
27
|
+
instanceInformation: EDRInstance[] | undefined;
|
|
28
|
+
isLoading: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
export interface ParameterInfoTextProps {
|
|
31
|
+
label: string;
|
|
32
|
+
value: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ListItem {
|
|
35
|
+
label: string;
|
|
36
|
+
value: string;
|
|
37
|
+
icon: React.ReactElement;
|
|
38
|
+
}
|
|
39
|
+
export interface ParameterInfoListProps {
|
|
40
|
+
label: string;
|
|
41
|
+
list: ListItem[];
|
|
42
|
+
}
|
|
43
|
+
export declare const ParameterInfoList: React.FC<ParameterInfoListProps>;
|