@opengeoweb/soundings 12.5.0 → 12.7.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": "12.5.0",
3
+ "version": "12.7.0",
4
4
  "description": "GeoWeb soundings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,20 +8,22 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/api": "12.5.0",
11
+ "@opengeoweb/api": "12.7.0",
12
12
  "@tanstack/react-query": "^5.69.2",
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": "12.5.0",
17
+ "@opengeoweb/shared": "12.7.0",
18
18
  "@mui/material": "^7.0.1",
19
- "@opengeoweb/store": "12.5.0",
19
+ "@opengeoweb/store": "12.7.0",
20
20
  "react-redux": "^9.2.0",
21
- "@opengeoweb/theme": "12.5.0",
21
+ "@opengeoweb/theme": "12.7.0",
22
22
  "@reduxjs/toolkit": "^2.6.1",
23
- "@opengeoweb/timeslider": "12.5.0",
24
- "react-window": "^1.8.10"
23
+ "@opengeoweb/timeslider": "12.7.0",
24
+ "react-window": "^1.8.10",
25
+ "@opengeoweb/webmap": "12.7.0",
26
+ "lodash": "^4.17.21"
25
27
  },
26
28
  "module": "./index.esm.js",
27
29
  "type": "module",
@@ -1,5 +1,6 @@
1
- import { LocationsResponseFromBE, SoundingsInstances, CoverageCollection } from './types';
1
+ import { CoverageCollection } from '@opengeoweb/shared';
2
+ import { LocationsResponseFromBE, SoundingsInstances } from './types';
2
3
  export declare const getCollectionLocations: (collectionId: string, baseUrl: string) => Promise<LocationsResponseFromBE>;
3
- export declare const getCollectionInstance: (collectionId: string, baseUrl: string) => Promise<SoundingsInstances>;
4
+ export declare const getCollectionInstances: (collectionId: string, baseUrl: string) => Promise<SoundingsInstances>;
4
5
  export declare const getEdrCollectionForLocation: (collectionId: string, baseUrl: string, instanceId: string | undefined, locationId: string, parameters: string[], datetime: string) => Promise<CoverageCollection>;
5
6
  export declare const getEdrCollectionForPosition: (collectionId: string, baseUrl: string, instanceId: string | undefined, coordinates: [number, number], parameters: string[], datetime: string) => Promise<CoverageCollection>;
@@ -22,6 +22,11 @@ export declare const useMultipleSources: (sources: SourceType[], locations: Reco
22
22
  isPending: boolean;
23
23
  error: Error | null | undefined;
24
24
  };
25
+ export declare const useTimesteps: (sourceSelections: SourceType[]) => {
26
+ data: string[][];
27
+ error: Error | null;
28
+ isPending: boolean;
29
+ };
25
30
  export declare const useGetCollectionsInstances: (collections?: SoundingsCollection[], isDialogOpen?: boolean) => {
26
31
  data: SoundingsCollectionsWithInstances[] | undefined;
27
32
  isPending: boolean;
@@ -1,5 +1,5 @@
1
1
  import { Geometry } from 'geojson';
2
- import { Referencing } from './crss-types';
2
+ import { EDRInstance } from '@opengeoweb/shared';
3
3
  export interface FeaturesFromBE {
4
4
  id: string;
5
5
  type: string;
@@ -14,65 +14,6 @@ export interface LocationsResponseFromBE {
14
14
  features: FeaturesFromBE[];
15
15
  type: string;
16
16
  }
17
- interface AxisValues {
18
- values: number[] | string[];
19
- }
20
- interface SingleValueAxis {
21
- values: [number];
22
- }
23
- interface SingleTimeValueAxis {
24
- values: [string];
25
- }
26
- interface VerticalProfileAxes {
27
- x: SingleValueAxis;
28
- y: SingleValueAxis;
29
- z: AxisValues;
30
- t?: SingleTimeValueAxis;
31
- }
32
- export interface VerticalProfileDomain {
33
- type: 'Domain';
34
- domainType: 'VerticalProfile';
35
- axes: VerticalProfileAxes;
36
- referencing?: Referencing[];
37
- }
38
- interface NdArray {
39
- type: 'NdArray';
40
- dataType: 'float' | 'integer' | 'string';
41
- axisNames?: string[];
42
- shape?: number[];
43
- values: number[] | string[];
44
- }
45
- type Ranges = Record<string, NdArray>;
46
- type Description = Record<string, string>;
47
- type Label = Record<string, string>;
48
- interface Parameter {
49
- type: 'Parameter';
50
- id?: string;
51
- label?: Label;
52
- description?: Description;
53
- unit?: {
54
- label?: Label;
55
- symbol?: Record<string, string>;
56
- };
57
- observedProperty: {
58
- id?: string;
59
- label: Label;
60
- description?: Description;
61
- };
62
- }
63
- export interface Coverage {
64
- type: 'Coverage';
65
- domain: VerticalProfileDomain;
66
- ranges: Ranges;
67
- }
68
- export interface CoverageCollection {
69
- type: 'CoverageCollection';
70
- domainType: VerticalProfileDomain;
71
- parameters: Record<string, Parameter>;
72
- ranges: Record<string, NdArray>;
73
- coverages: Coverage[];
74
- referencing: Referencing[];
75
- }
76
17
  export interface SoundingFeatureProperties {
77
18
  time: string;
78
19
  temp: number;
@@ -86,11 +27,9 @@ export interface SoundingFeature {
86
27
  geometry: Geometry;
87
28
  properties: SoundingFeatureProperties;
88
29
  }
89
- export interface SoundingsInstance {
90
- id: string;
91
- }
30
+ export type SoundingsInstance = EDRInstance;
92
31
  export interface SoundingsInstances {
93
32
  instances: SoundingsInstance[];
94
33
  }
95
- export type SoundingDiagramType = 'SKEWT' | 'BIJVOET';
96
- export {};
34
+ export declare const soundingDiagrams: readonly ["SKEWT", "BIJVOET", "EMAGRAM"];
35
+ export type SoundingDiagramType = (typeof soundingDiagrams)[number];
@@ -1,2 +1,10 @@
1
- import { CoverageCollection, SoundingFeature } from './types';
1
+ import { CoverageCollection } from '@opengeoweb/shared';
2
+ import { SoundingFeature, SoundingsInstance } from './types';
2
3
  export declare function parseCoverageCollection(response: CoverageCollection, parameterMappings: Record<string, string>): SoundingFeature[];
4
+ /**
5
+ * Parse duration with repeats
6
+ * @param dateString e.g. 'R67/2025-04-22T09:00:00Z/PT60M'
7
+ * @returns Array of ISO datetime strings, e.g., ['2025-04-22T09:00:00.000Z', ...]
8
+ */
9
+ export declare const parseDurationWithRepeats: (dateString: string) => string[];
10
+ export declare const getTimestepsFromInstance: (instance?: SoundingsInstance) => string[];
@@ -9,4 +9,5 @@ interface SoundingsStoreWrapperProps {
9
9
  store?: Store;
10
10
  }
11
11
  export declare const SoundingsStoreProvider: React.FC<SoundingsStoreWrapperProps>;
12
+ export declare const SoundingsStoryStoreProvider: React.FC<SoundingsStoreWrapperProps>;
12
13
  export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { SoundingDiagramType } from '../../api/edr-api/types';
3
+ interface DiagramTypeButtonProps {
4
+ diagramType: SoundingDiagramType;
5
+ setDiagramType: (diagramType: SoundingDiagramType) => void;
6
+ }
7
+ export declare const DiagramTypeButton: ({ diagramType, setDiagramType, }: DiagramTypeButtonProps) => React.ReactElement;
8
+ export {};
@@ -3,7 +3,9 @@ import { Soundings } from './Soundings';
3
3
  declare const meta: Meta<typeof Soundings>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Soundings>;
6
- export declare const SoundingsExample: Story;
7
- export declare const SoundingsExampleDark: Story;
6
+ export declare const SoundingsSkewTExample: Story;
7
+ export declare const SoundingsSkewTExampleDark: Story;
8
+ export declare const SoundingsEmagramExample: Story;
9
+ export declare const SoundingsEmagramExampleDark: Story;
8
10
  export declare const SoundingsBijvoetExample: Story;
9
11
  export declare const SoundingsBijvoetExampleDark: Story;
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
+ import { SoundingDiagramType } from '../../api/edr-api/types';
2
3
  interface SoundingsConnectProps {
3
4
  viewId: string;
5
+ diagramType?: SoundingDiagramType;
4
6
  }
5
- export declare const SoundingsConnect: ({ viewId, }: SoundingsConnectProps) => React.ReactElement;
7
+ export declare const SoundingsConnect: ({ viewId, diagramType, }: SoundingsConnectProps) => React.ReactElement;
6
8
  export {};
@@ -1,8 +1,13 @@
1
+ import { StoryObj } from '@storybook/react/*';
2
+ import { SoundingsConnect } from '..';
1
3
  declare const _default: {
2
4
  title: string;
3
5
  tags: string[];
4
6
  };
5
7
  export default _default;
8
+ type Story = StoryObj<typeof SoundingsConnect>;
9
+ export declare const SoundingsConnectStory: Story;
10
+ export declare const SoundingsConnectStoryDark: Story;
6
11
  export declare const SoundingsConnectLoading: {
7
12
  (): React.ReactElement;
8
13
  parameters: {
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import * as d3 from 'd3';
3
+ import { i18n, TFunction } from 'i18next';
3
4
  import { SoundingDiagramType } from '../../api/edr-api/types';
4
5
  import { ScalesType } from './types';
5
6
  export declare const SOUNDING_COLORS: string[];
@@ -38,6 +39,7 @@ interface PlotSounding {
38
39
  svg: d3.Selection<SVGElement, unknown, HTMLElement, undefined>;
39
40
  diagramType: SoundingDiagramType;
40
41
  }
42
+ export declare const getDiagramName: (t: TFunction<'soundings', i18n>, diagramType: SoundingDiagramType) => string;
41
43
  export declare const initializeSvg: ({ svgRef, width, height, margin, diagramType, }: InitializeSvg) => d3.Selection<SVGGElement, unknown, null, undefined>;
42
44
  export declare const createScales: (diagramType: SoundingDiagramType, width: number, height: number, minPressure: number, maxPressure: number, minTemperature: number, maxTemperature: number) => [ScalesType, ScalesType];
43
45
  export declare const drawAxes: ({ svg, xScale, yScale, height, diagramType, }: DrawAxis) => void;
@@ -6,3 +6,4 @@ type Story = StoryObj<typeof SoundingsTimeSlider>;
6
6
  export declare const ComponentLight: Story;
7
7
  export declare const ComponentDark: Story;
8
8
  export declare const NoTimesteps: Story;
9
+ export declare const ManyTimesteps: Story;
@@ -1,6 +1,2 @@
1
1
  import React from 'react';
2
- interface SoundingsTimeSliderConnectProps {
3
- timesteps: string[];
4
- }
5
- export declare const SoundingsTimeSliderConnect: ({ timesteps, }: SoundingsTimeSliderConnectProps) => React.ReactElement;
6
- export {};
2
+ export declare const SoundingsTimeSliderConnect: () => React.ReactElement;
@@ -1,5 +1,6 @@
1
1
  import * as d3 from 'd3';
2
2
  import { ScalesType } from '../Soundings/types';
3
+ import { SoundingDiagramType } from '../../api/edr-api/types';
3
4
  interface DrawDryAdiabatsProps {
4
5
  staticPressureArray: number[];
5
6
  height: number;
@@ -7,8 +8,9 @@ interface DrawDryAdiabatsProps {
7
8
  yScale: ScalesType;
8
9
  dp: number;
9
10
  svg: d3.Selection<SVGElement, unknown, HTMLElement, unknown>;
11
+ diagramType: SoundingDiagramType;
10
12
  }
11
- export declare const drawDryAdiabats: ({ staticPressureArray, height, xScale, yScale, svg, dp, }: DrawDryAdiabatsProps) => void;
13
+ export declare const drawDryAdiabats: ({ staticPressureArray, height, xScale, yScale, svg, dp, diagramType, }: DrawDryAdiabatsProps) => void;
12
14
  interface DrawDryAdiabatsBijvoetProps {
13
15
  staticPressureArray: number[];
14
16
  xScale: ScalesType;
@@ -1,13 +1,15 @@
1
1
  import * as d3 from 'd3';
2
2
  import { ScalesType } from '../Soundings/types';
3
+ import { SoundingDiagramType } from '../../api/edr-api/types';
3
4
  interface DrawIsohumesProps {
4
5
  staticPressureArray: number[];
5
6
  height: number;
6
7
  xScale: ScalesType;
7
8
  yScale: ScalesType;
8
9
  svg: d3.Selection<SVGElement, unknown, HTMLElement, unknown>;
10
+ diagramType: SoundingDiagramType;
9
11
  }
10
- export declare const drawIsohumes: ({ staticPressureArray, height, xScale, yScale, svg, }: DrawIsohumesProps) => void;
12
+ export declare const drawIsohumes: ({ staticPressureArray, height, xScale, yScale, svg, diagramType, }: DrawIsohumesProps) => void;
11
13
  interface DrawIsohumesBijvoetProps {
12
14
  staticPressureArray: number[];
13
15
  height: number;
@@ -1,13 +1,15 @@
1
1
  import * as d3 from 'd3';
2
2
  import { ScalesType } from '../Soundings/types';
3
+ import { SoundingDiagramType } from '../../api/edr-api/types';
3
4
  interface DrawIsothermsProps {
4
5
  staticPressureArray: number[];
5
6
  height: number;
6
7
  xScale: ScalesType;
7
8
  yScale: ScalesType;
8
9
  svg: d3.Selection<SVGElement, unknown, HTMLElement, unknown>;
10
+ diagramType: SoundingDiagramType;
9
11
  }
10
- export declare const drawIsotherms: ({ staticPressureArray, height, xScale, yScale, svg, }: DrawIsothermsProps) => void;
12
+ export declare const drawIsotherms: ({ staticPressureArray, height, xScale, yScale, svg, diagramType, }: DrawIsothermsProps) => void;
11
13
  interface DrawIsothermsBijvoetProps {
12
14
  staticPressureArray: number[];
13
15
  xScale: ScalesType;
@@ -1,5 +1,6 @@
1
1
  import * as d3 from 'd3';
2
2
  import { ScalesType } from '../Soundings/types';
3
+ import { SoundingDiagramType } from '../../api/edr-api/types';
3
4
  interface DrawMoistAdiabatsProps {
4
5
  staticPressureArray: number[];
5
6
  minTemperature: number;
@@ -12,8 +13,9 @@ interface DrawMoistAdiabatsProps {
12
13
  xScale: ScalesType;
13
14
  yScale: ScalesType;
14
15
  svg: d3.Selection<SVGElement, unknown, HTMLElement, unknown>;
16
+ diagramType: SoundingDiagramType;
15
17
  }
16
- export declare const drawMoistAdiabats: ({ staticPressureArray, minTemperature, maxTemperature, minPressure, maxPressure, width, height, xScale, yScale, svg, dp, }: DrawMoistAdiabatsProps) => void;
18
+ export declare const drawMoistAdiabats: ({ staticPressureArray, minTemperature, maxTemperature, minPressure, maxPressure, width, height, xScale, yScale, svg, dp, diagramType, }: DrawMoistAdiabatsProps) => void;
17
19
  interface DrawMoistAdiabatsBijvoetProps {
18
20
  minPressure: number;
19
21
  maxPressure: number;
@@ -9,7 +9,7 @@ export interface UpdateSourcePayload {
9
9
  value: SourceSelection;
10
10
  }
11
11
  export interface SourceSelection {
12
- url?: string;
12
+ url: string;
13
13
  instanceId?: string;
14
14
  isChecked?: boolean;
15
15
  parameterMappings?: Record<string, string>;
@@ -1,8 +1,10 @@
1
+ import { SoundingDiagramType } from '../api/edr-api/types';
1
2
  export declare const soundingsComponentType = "Soundings";
2
3
  export interface SoundingsLookUpPayload {
3
4
  componentType: typeof soundingsComponentType;
4
5
  id: string;
5
6
  title?: string;
7
+ diagramType?: SoundingDiagramType;
6
8
  initialProps: Record<string, unknown>;
7
9
  }
8
10
  export declare const soundingsLookUp: (payload: SoundingsLookUpPayload) => React.JSX.Element | null;
@@ -1,26 +0,0 @@
1
- export interface Referencing {
2
- coordinates: string[];
3
- system: CRSSystem;
4
- }
5
- interface GeographicCRS {
6
- type: 'GeographicCRS';
7
- id: string;
8
- }
9
- interface ProjectedCRS {
10
- type: 'ProjectedCRS';
11
- id: string;
12
- }
13
- interface VerticalCRS {
14
- type: 'VerticalCRS';
15
- id: string;
16
- }
17
- interface EngineeringCRS {
18
- type: 'EngineeringCRS';
19
- id?: string;
20
- }
21
- interface TemporalRS {
22
- type: 'TemporalRS';
23
- calendar: string;
24
- }
25
- type CRSSystem = GeographicCRS | ProjectedCRS | VerticalCRS | EngineeringCRS | TemporalRS;
26
- export {};