@opengeoweb/soundings 14.5.2 → 15.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/soundings",
3
- "version": "14.5.2",
3
+ "version": "15.1.0",
4
4
  "description": "GeoWeb soundings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,24 +8,24 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/api": "14.5.2",
11
+ "@opengeoweb/api": "15.1.0",
12
12
  "@tanstack/react-query": "^5.85.5",
13
13
  "react": "^18.3.1",
14
14
  "d3": "^7.9.0",
15
15
  "react-i18next": "^15.1.1",
16
16
  "i18next": "^25.0.1",
17
- "@opengeoweb/shared": "14.5.2",
17
+ "@opengeoweb/shared": "15.1.0",
18
18
  "@mui/material": "^7.0.1",
19
- "@opengeoweb/store": "14.5.2",
19
+ "@opengeoweb/store": "15.1.0",
20
20
  "react-redux": "^9.2.0",
21
- "@opengeoweb/theme": "14.5.2",
21
+ "@opengeoweb/theme": "15.1.0",
22
22
  "@reduxjs/toolkit": "^2.6.1",
23
- "@opengeoweb/time-slider": "14.5.2",
23
+ "@opengeoweb/time-slider": "15.1.0",
24
24
  "react-window": "^1.8.10",
25
- "@opengeoweb/webmap": "14.5.2",
25
+ "@opengeoweb/webmap": "15.1.0",
26
26
  "lodash": "^4.17.21",
27
27
  "@types/geojson": "^7946.0.14",
28
- "@opengeoweb/webmap-react": "14.5.2",
28
+ "@opengeoweb/webmap-react": "15.1.0",
29
29
  "react-resizable-layout": "^0.7.3",
30
30
  "react-sortablejs": "^6.1.4"
31
31
  },
package/src/index.d.ts CHANGED
@@ -5,3 +5,5 @@ export * from './lib/utils/soundingsLookUp';
5
5
  export * from './lib/api/edr-api/types';
6
6
  export * from './lib/store/store';
7
7
  export * from './lib/utils/i18n';
8
+ export * as SoundingsTypes from './lib/store/types';
9
+ export { SoundingsActionOrigin } from './lib/store/types';
@@ -1,8 +1,8 @@
1
- import type { SoundingsCollection } from '@opengeoweb/shared';
1
+ import type { Coordinates, SoundingsCollection } from '@opengeoweb/shared';
2
2
  import type { SoundingFeature } from './types';
3
3
  import type { ServiceWithLocations } from '../../components/MenuBar/LocationsMenu';
4
4
  import type { SoundingsCollectionsWithInstances } from '../../components/Soundings/types';
5
- import type { Coordinates, SourceType } from '../../store/types';
5
+ import type { SourceType } from '../../store/types';
6
6
  export declare const sortSoundingFeatures: (data: SoundingFeature[]) => SoundingFeature[];
7
7
  export declare const defaultParameterMappings: {
8
8
  temperature: string;
@@ -1,5 +1,5 @@
1
+ import type { Coordinates } from '@opengeoweb/shared';
1
2
  import type { LocationsResponseFromBE } from '../../api/edr-api/types';
2
- import type { Coordinates } from '../../store/types';
3
3
  export type ServiceWithLocations = LocationsResponseFromBE & {
4
4
  id: string;
5
5
  name: string;
@@ -8,6 +8,8 @@ interface SoundingsMenuBarProps {
8
8
  handleClick: (menuType: MenuOptions) => void;
9
9
  isOpen: Record<MenuOptions, boolean>;
10
10
  selectedSourcesAmount?: number;
11
+ shouldHideMarkers: boolean;
12
+ toggleMarkers: (shouldHideMarkers: boolean) => void;
11
13
  }
12
- export declare const SoundingsMenuBar: ({ handleClick, isOpen, selectedSourcesAmount, }: SoundingsMenuBarProps) => React.ReactElement;
14
+ export declare const SoundingsMenuBar: ({ handleClick, isOpen, selectedSourcesAmount, shouldHideMarkers, toggleMarkers, }: SoundingsMenuBarProps) => React.ReactElement;
13
15
  export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export interface SoundingsMarkersSwitchProps {
3
+ shouldHideMarkers: boolean;
4
+ toggleMarkers: (shouldHideMarkers: boolean) => void;
5
+ }
6
+ export declare const SoundingsMarkersSwitch: React.FC<SoundingsMarkersSwitchProps>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { SourceSelection } from '../../store/types';
2
+ import type { SourceSelection } from '@opengeoweb/shared';
3
3
  import type { SoundingsCollectionsWithInstances } from '../Soundings/types';
4
4
  interface SoundingsSourceMenuProps {
5
5
  soundingsCollections: SoundingsCollectionsWithInstances[] | undefined;
@@ -1,11 +1,18 @@
1
1
  import React from 'react';
2
2
  import type { SoundingFeature } from '../../api/edr-api/types';
3
+ import type { SoundingPanel } from '../../store/types';
3
4
  interface SortableAccordionsProps {
5
+ soundingPanelsInOrder: SoundingPanel[];
4
6
  data: SoundingFeature[][];
5
7
  size: number;
6
8
  chosenDiagramType: 'SKEWT' | 'BIJVOET' | 'EMAGRAM';
7
9
  setChosenDiagramType: (data: 'SKEWT' | 'BIJVOET' | 'EMAGRAM') => void;
8
10
  viewRef: React.RefObject<HTMLDivElement>;
11
+ onOrderChange: (newOrder: {
12
+ id: string;
13
+ name: string;
14
+ isDisplayed: boolean;
15
+ }[]) => void;
9
16
  }
10
- export declare const SortableAccordions: ({ data, size, chosenDiagramType, setChosenDiagramType, viewRef, }: SortableAccordionsProps) => React.ReactElement;
17
+ export declare const SortableAccordions: ({ soundingPanelsInOrder, data, size, chosenDiagramType, setChosenDiagramType, viewRef, onOrderChange, }: SortableAccordionsProps) => React.ReactElement;
11
18
  export {};
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import type { SoundingDiagramType } from '../../api/edr-api/types';
2
+ import type { SoundingsStore } from '../../store/types';
3
3
  interface SoundingsConnectProps {
4
4
  viewId: string;
5
- diagramType?: SoundingDiagramType;
5
+ soundingsPreset?: SoundingsStore;
6
6
  }
7
- export declare const SoundingsConnect: ({ viewId, diagramType, }: SoundingsConnectProps) => React.ReactElement;
7
+ export declare const SoundingsConnect: ({ viewId, soundingsPreset, }: SoundingsConnectProps) => React.ReactElement;
8
8
  export {};
@@ -0,0 +1,4 @@
1
+ export declare const SoundingManagerListItem: ({ name, isDisplayed, }: {
2
+ name: string;
3
+ isDisplayed: boolean;
4
+ }) => React.ReactElement;
@@ -1,8 +1,16 @@
1
+ import React from 'react';
2
+ import type { SoundingPanel } from '../../store/types';
1
3
  interface SoundingsManagerProps {
2
4
  isOpen: boolean;
3
5
  onClose: () => void;
4
6
  onMouseDown: () => void;
5
7
  order: number;
8
+ soundingPanelsInOrder: SoundingPanel[];
9
+ onOrderChange: (newOrder: {
10
+ id: string;
11
+ name: string;
12
+ isDisplayed: boolean;
13
+ }[]) => void;
6
14
  }
7
- export declare const SoundingsManager: ({ isOpen, onClose, onMouseDown, order, }: SoundingsManagerProps) => React.ReactElement;
15
+ export declare const SoundingsManager: ({ isOpen, onClose, onMouseDown, order, soundingPanelsInOrder, onOrderChange, }: SoundingsManagerProps) => React.ReactElement;
8
16
  export {};
@@ -1 +1,2 @@
1
+ import React from 'react';
1
2
  export declare const SoundingsManagerConnect: () => React.ReactElement;
@@ -1,2 +1,6 @@
1
1
  import React from 'react';
2
- export declare const SoundingsTimeSliderConnect: () => React.ReactElement;
2
+ interface SoundingsTimeSliderConnectProps {
3
+ viewId: string;
4
+ }
5
+ export declare const SoundingsTimeSliderConnect: ({ viewId, }: SoundingsTimeSliderConnectProps) => React.ReactElement;
6
+ export {};
@@ -1,8 +1,15 @@
1
1
  import type { Draft, PayloadAction } from '@reduxjs/toolkit';
2
- import type { SoundingsStore, UpdateLocationPayload, UpdateSourcePayload, UpdateTimePayload } from './types';
2
+ import type { SoundingPanels, SoundingsStore, UpdateLocationPayload, UpdateSourcePayload, UpdateTimePayload, UpdateDiagramTypePayload, ToggleLocationMarkersPayload } from './types';
3
3
  export declare const initialSoundingsState: SoundingsStore;
4
4
  export declare const soundingsReducer: import("redux").Reducer<SoundingsStore>, soundingsActions: import("@reduxjs/toolkit").CaseReducerActions<{
5
+ registerSoundingsPreset: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<SoundingsStore>) => void;
5
6
  updateSelectedSource: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<UpdateSourcePayload>) => void;
6
7
  updateSelectedLocation: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<UpdateLocationPayload>) => void;
7
8
  updateSelectedTime: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<UpdateTimePayload>) => void;
9
+ updateDiagramType: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<UpdateDiagramTypePayload>) => void;
10
+ toggleLocationMarkers: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<ToggleLocationMarkersPayload>) => void;
11
+ addSoundingPanelsFromPreset: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<SoundingPanels>) => void;
12
+ changeSoundingPanelOrder: (draft: Draft<SoundingsStore>, payloadAction: PayloadAction<{
13
+ newOrderOfIds: string[];
14
+ }>) => void;
8
15
  }, "soundings">;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
- import type { SoundingsModuleState, SoundingsStore, SourceSelection, SourceType } from './types';
1
+ import type { SourceSelection } from '@opengeoweb/shared';
2
+ import type { SoundingsModuleState, SoundingsStore, SourceType } from './types';
2
3
  export declare const getSourceSelections: ((state: SoundingsModuleState) => Record<string, SourceSelection>) & {
3
4
  clearCache: () => void;
4
5
  resultsCount: () => number;
@@ -20,18 +21,18 @@ export declare const getSourceSelections: ((state: SoundingsModuleState) => Reco
20
21
  memoize: typeof import("reselect").weakMapMemoize;
21
22
  argsMemoize: typeof import("reselect").weakMapMemoize;
22
23
  };
23
- export declare const getLocationSelections: ((state: SoundingsModuleState) => Record<string, string | import("./types").Coordinates | undefined>) & {
24
+ export declare const getLocationSelections: ((state: SoundingsModuleState) => Record<string, string | import("@opengeoweb/shared").Coordinates | undefined>) & {
24
25
  clearCache: () => void;
25
26
  resultsCount: () => number;
26
27
  resetResultsCount: () => void;
27
28
  } & {
28
- resultFunc: (resultFuncArgs_0: SoundingsStore) => Record<string, string | import("./types").Coordinates | undefined>;
29
- memoizedResultFunc: ((resultFuncArgs_0: SoundingsStore) => Record<string, string | import("./types").Coordinates | undefined>) & {
29
+ resultFunc: (resultFuncArgs_0: SoundingsStore) => Record<string, string | import("@opengeoweb/shared").Coordinates | undefined>;
30
+ memoizedResultFunc: ((resultFuncArgs_0: SoundingsStore) => Record<string, string | import("@opengeoweb/shared").Coordinates | undefined>) & {
30
31
  clearCache: () => void;
31
32
  resultsCount: () => number;
32
33
  resetResultsCount: () => void;
33
34
  };
34
- lastResult: () => Record<string, string | import("./types").Coordinates | undefined>;
35
+ lastResult: () => Record<string, string | import("@opengeoweb/shared").Coordinates | undefined>;
35
36
  dependencies: [(store: SoundingsModuleState) => SoundingsStore];
36
37
  recomputations: () => number;
37
38
  resetRecomputations: () => void;
@@ -62,6 +63,48 @@ export declare const getSelectedTime: ((state: SoundingsModuleState) => string)
62
63
  memoize: typeof import("reselect").weakMapMemoize;
63
64
  argsMemoize: typeof import("reselect").weakMapMemoize;
64
65
  };
66
+ export declare const getDiagramType: ((state: SoundingsModuleState) => "SKEWT" | "BIJVOET" | "EMAGRAM") & {
67
+ clearCache: () => void;
68
+ resultsCount: () => number;
69
+ resetResultsCount: () => void;
70
+ } & {
71
+ resultFunc: (resultFuncArgs_0: SoundingsStore) => "SKEWT" | "BIJVOET" | "EMAGRAM";
72
+ memoizedResultFunc: ((resultFuncArgs_0: SoundingsStore) => "SKEWT" | "BIJVOET" | "EMAGRAM") & {
73
+ clearCache: () => void;
74
+ resultsCount: () => number;
75
+ resetResultsCount: () => void;
76
+ };
77
+ lastResult: () => "SKEWT" | "BIJVOET" | "EMAGRAM";
78
+ dependencies: [(store: SoundingsModuleState) => SoundingsStore];
79
+ recomputations: () => number;
80
+ resetRecomputations: () => void;
81
+ dependencyRecomputations: () => number;
82
+ resetDependencyRecomputations: () => void;
83
+ } & {
84
+ memoize: typeof import("reselect").weakMapMemoize;
85
+ argsMemoize: typeof import("reselect").weakMapMemoize;
86
+ };
87
+ export declare const getShouldHideLocationMarkers: ((state: SoundingsModuleState) => boolean) & {
88
+ clearCache: () => void;
89
+ resultsCount: () => number;
90
+ resetResultsCount: () => void;
91
+ } & {
92
+ resultFunc: (resultFuncArgs_0: SoundingsStore) => boolean;
93
+ memoizedResultFunc: ((resultFuncArgs_0: SoundingsStore) => boolean) & {
94
+ clearCache: () => void;
95
+ resultsCount: () => number;
96
+ resetResultsCount: () => void;
97
+ };
98
+ lastResult: () => boolean;
99
+ dependencies: [(store: SoundingsModuleState) => SoundingsStore];
100
+ recomputations: () => number;
101
+ resetRecomputations: () => void;
102
+ dependencyRecomputations: () => number;
103
+ resetDependencyRecomputations: () => void;
104
+ } & {
105
+ memoize: typeof import("reselect").weakMapMemoize;
106
+ argsMemoize: typeof import("reselect").weakMapMemoize;
107
+ };
65
108
  export declare const getSelectedSources: ((state: SoundingsModuleState) => SourceType[]) & {
66
109
  clearCache: () => void;
67
110
  resultsCount: () => number;
@@ -165,3 +208,45 @@ export declare const getSelectedSourcesIds: ((state: SoundingsModuleState) => st
165
208
  memoize: typeof import("reselect").weakMapMemoize;
166
209
  argsMemoize: typeof import("reselect").weakMapMemoize;
167
210
  };
211
+ export declare const getSoundingsPreset: ((state: SoundingsModuleState) => SoundingsStore) & {
212
+ clearCache: () => void;
213
+ resultsCount: () => number;
214
+ resetResultsCount: () => void;
215
+ } & {
216
+ resultFunc: (resultFuncArgs_0: SoundingsStore) => SoundingsStore;
217
+ memoizedResultFunc: ((resultFuncArgs_0: SoundingsStore) => SoundingsStore) & {
218
+ clearCache: () => void;
219
+ resultsCount: () => number;
220
+ resetResultsCount: () => void;
221
+ };
222
+ lastResult: () => SoundingsStore;
223
+ dependencies: [(store: SoundingsModuleState) => SoundingsStore];
224
+ recomputations: () => number;
225
+ resetRecomputations: () => void;
226
+ dependencyRecomputations: () => number;
227
+ resetDependencyRecomputations: () => void;
228
+ } & {
229
+ memoize: typeof import("reselect").weakMapMemoize;
230
+ argsMemoize: typeof import("reselect").weakMapMemoize;
231
+ };
232
+ export declare const getSoundingPanelsInOrder: ((state: SoundingsModuleState) => import("./types").SoundingPanel[]) & {
233
+ clearCache: () => void;
234
+ resultsCount: () => number;
235
+ resetResultsCount: () => void;
236
+ } & {
237
+ resultFunc: (resultFuncArgs_0: SoundingsStore) => import("./types").SoundingPanel[];
238
+ memoizedResultFunc: ((resultFuncArgs_0: SoundingsStore) => import("./types").SoundingPanel[]) & {
239
+ clearCache: () => void;
240
+ resultsCount: () => number;
241
+ resetResultsCount: () => void;
242
+ };
243
+ lastResult: () => import("./types").SoundingPanel[];
244
+ dependencies: [(store: SoundingsModuleState) => SoundingsStore];
245
+ recomputations: () => number;
246
+ resetRecomputations: () => void;
247
+ dependencyRecomputations: () => number;
248
+ resetDependencyRecomputations: () => void;
249
+ } & {
250
+ memoize: typeof import("reselect").weakMapMemoize;
251
+ argsMemoize: typeof import("reselect").weakMapMemoize;
252
+ };
@@ -1,6 +1,9 @@
1
1
  import type { Store } from '@reduxjs/toolkit';
2
2
  import type { UIModuleState, WebMapStateModuleState } from '@opengeoweb/store';
3
3
  import type { SoundingsModuleState } from './types';
4
+ export * as soundingsSelectors from './selectors';
5
+ export { soundingsReducer, soundingsActions } from './reducer';
6
+ export type { SoundingsModuleState, SoundingsStore } from './types';
4
7
  export declare const soundingsReducersMap: {
5
8
  webmap: import("redux").Reducer<import("dist/libs/store/src/store/map/types").WebMapState>;
6
9
  services: import("redux").Reducer<import("dist/libs/store/src/store/map/types").ServiceState>;
@@ -1,3 +1,8 @@
1
+ import type { Coordinates, SourceSelection } from '@opengeoweb/shared';
2
+ export declare enum SoundingsActionOrigin {
3
+ soundingsManager = "soundingsManager",
4
+ soundingsComponent = "soundingsComponent"
5
+ }
1
6
  export interface SourceType {
2
7
  collectionId: string;
3
8
  url: string;
@@ -6,35 +11,49 @@ export interface SourceType {
6
11
  parameterMappings?: Record<string, string>;
7
12
  name?: string;
8
13
  }
9
- export interface UpdateSourcePayload {
14
+ export interface SoundingsPayload {
15
+ panelId?: string;
16
+ origin?: string;
17
+ }
18
+ export interface UpdateSourcePayload extends SoundingsPayload {
10
19
  sourceId: string;
11
20
  value: SourceSelection;
12
21
  }
13
- export interface SourceSelection {
14
- url: string;
15
- instanceId?: string;
16
- isChecked?: boolean;
17
- verticalRange?: string;
18
- parameterMappings?: Record<string, string>;
19
- name?: string;
20
- }
21
- export interface UpdateLocationPayload {
22
+ export interface UpdateLocationPayload extends SoundingsPayload {
22
23
  sourceId: string;
23
24
  location: string | Coordinates | undefined;
24
25
  }
25
- export interface UpdateTimePayload {
26
+ export interface UpdateTimePayload extends SoundingsPayload {
26
27
  selectedTime: string;
27
28
  }
28
- /** [lon, lat] */
29
- export type Coordinates = [number, number];
29
+ export interface UpdateDiagramTypePayload extends SoundingsPayload {
30
+ diagramType: 'SKEWT' | 'BIJVOET' | 'EMAGRAM';
31
+ }
32
+ export interface ToggleLocationMarkersPayload extends SoundingsPayload {
33
+ shouldHideLocationMarkers: boolean;
34
+ }
35
+ export interface SoundingPanel {
36
+ id: string;
37
+ name: string;
38
+ isDisplayed: boolean;
39
+ }
40
+ export interface SoundingPanels {
41
+ order: string[];
42
+ entities: Record<string, SoundingPanel>;
43
+ }
30
44
  export interface SoundingsStore {
31
45
  /** key: sourceId */
32
46
  selectedSources: Record<string, SourceSelection>;
33
47
  /** key: sourceId, value: locationId or position coordinates */
34
48
  selectedLocations: Record<string, string | Coordinates | undefined>;
35
49
  /** ISO date, e.g., 2025-01-02T12:00:00.000Z */
36
- selectedTime: string;
50
+ selectedTime?: string;
51
+ /** Diagram type: SKEWT, BIJVOET, or EMAGRAM */
52
+ diagramType?: 'SKEWT' | 'BIJVOET' | 'EMAGRAM';
53
+ soundingPanels: SoundingPanels;
54
+ /** Whether to hide location markers on the map */
55
+ shouldHideLocationMarkers?: boolean;
37
56
  }
38
57
  export interface SoundingsModuleState {
39
- soundings: SoundingsStore;
58
+ soundings?: SoundingsStore;
40
59
  }
@@ -1,10 +1,9 @@
1
- import type { SoundingDiagramType } from '../api/edr-api/types';
1
+ import type { SoundingsStore } from '../store/types';
2
2
  export type SoundingsComponentType = 'Soundings';
3
3
  export interface SoundingsLookUpPayload {
4
4
  componentType: SoundingsComponentType;
5
5
  id: string;
6
6
  title?: string;
7
- diagramType?: SoundingDiagramType;
8
- initialProps: Record<string, unknown>;
7
+ initialProps: SoundingsStore;
9
8
  }
10
9
  export declare const soundingsLookUp: (payload: SoundingsLookUpPayload) => React.JSX.Element | null;