@opengeoweb/soundings 14.0.1 → 14.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/index.esm.js +257 -48
- package/package.json +9 -8
- package/src/lib/api/edr-api/api.d.ts +3 -3
- package/src/lib/api/edr-api/utils.d.ts +2 -2
- package/src/lib/components/SoundingsAccordion/SoundingsAccordion.d.ts +10 -0
- package/src/lib/components/SoundingsAccordion/SoundingsAccordion.spec.d.ts +1 -0
- package/src/lib/components/SoundingsAccordion/SoundingsAccordionStories.stories.d.ts +8 -0
- package/src/lib/components/SoundingsTimeSlider/SoundingsTimeSlider.d.ts +1 -1
- package/src/lib/components/SoundingsTooltip/utils.d.ts +1 -0
- package/src/lib/store/store.d.ts +5 -0
- package/src/lib/utils/storyUtils/SoundingsResponsiveView.d.ts +2 -0
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import React, { useRef, useEffect, useMemo, useState, Fragment as Fragment$1 } from 'react';
|
|
3
3
|
import { useSelector, useDispatch } from 'react-redux';
|
|
4
|
-
import { Box, Stack, Menu, ListSubheader, Typography, MenuItem, Tooltip,
|
|
4
|
+
import { Box, Stack, Menu, ListSubheader, Typography, MenuItem, Tooltip, Card, LinearProgress, List, ListItem, ListItemIcon, Checkbox, ListItemText, Grid, ListItemButton } from '@mui/material';
|
|
5
5
|
import { safelyInitI18nForTestsAndStories, sharedTranslations, SHARED_NAMESPACE, dateUtils, CustomSlider, CustomToggleButton, AlertBanner, ToolContainerDraggable, StyledSelect, SearchField, CustomAccordion } from '@opengeoweb/shared';
|
|
6
6
|
import { selectorMemoizationOptions, uiSelectors, uiTypes, uiActions, genericSelectors, mapSelectors, genericActions, syncGroupsActions, mapActions, useSetupDialog, storeReducerMap, storeMiddlewares } from '@opengeoweb/store';
|
|
7
7
|
import { ParseISOTimeRangeDuration, parseISO8601IntervalToDateInterval, webmapUtils } from '@opengeoweb/webmap';
|
|
@@ -15,7 +15,8 @@ import i18n from 'i18next';
|
|
|
15
15
|
export { default as i18n } from 'i18next';
|
|
16
16
|
import { useTranslation } from 'react-i18next';
|
|
17
17
|
import { createSlice, createSelector, combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
18
|
-
import { Sources } from '@opengeoweb/theme';
|
|
18
|
+
import { Sources, ArrowDropDownDown } from '@opengeoweb/theme';
|
|
19
|
+
import { useResizable } from 'react-resizable-layout';
|
|
19
20
|
import { FixedSizeList } from 'react-window';
|
|
20
21
|
|
|
21
22
|
var en = {
|
|
@@ -432,7 +433,8 @@ const createClampedInterpolationFunc = (interpolationFunc, domain) => {
|
|
|
432
433
|
// Construct interpolation functions to use when hovering between data points
|
|
433
434
|
// Ensure NaN/null values are removed and cut the domain to the upper and lower pressure bounds of the parameter
|
|
434
435
|
const constructTooltipData = data => {
|
|
435
|
-
const tooltipData = data.map(features => {
|
|
436
|
+
const tooltipData = data.map((features, index) => {
|
|
437
|
+
const color = SOUNDING_COLORS[index] || SOUNDING_COLORS[0];
|
|
436
438
|
const pressureData = features.map(feature => feature.properties.pressure);
|
|
437
439
|
const tempData = features.map(feature => feature.properties.temp);
|
|
438
440
|
const dewpointData = features.map(feature => feature.properties.dewpoint);
|
|
@@ -453,19 +455,20 @@ const constructTooltipData = data => {
|
|
|
453
455
|
interpolateTemperature: createClampedInterpolationFunc(interpolateTemperature, tempPressure),
|
|
454
456
|
interpolateDewpoint: createClampedInterpolationFunc(interpolateDewpoint, dewpointPressure),
|
|
455
457
|
interpolateWindSpeed: createClampedInterpolationFunc(interpolateWindSpeed, windSpeedPressure),
|
|
456
|
-
interpolateWindDirection: createClampedInterpolationFunc(interpolateWindDirection, windDirPressure)
|
|
458
|
+
interpolateWindDirection: createClampedInterpolationFunc(interpolateWindDirection, windDirPressure),
|
|
459
|
+
tooltipColor: color
|
|
457
460
|
};
|
|
458
461
|
});
|
|
459
462
|
return tooltipData.filter(data => data.pressureData.length > 0);
|
|
460
463
|
};
|
|
461
|
-
const getParamHtml = (paramValue, colorIndex, unit, isLastElement, noDistance = false) => {
|
|
464
|
+
const getParamHtml = (paramValue, colorIndex, unit, isLastElement, color, noDistance = false) => {
|
|
462
465
|
if (colorIndex === 0) {
|
|
463
|
-
return `<p style="${noDistance || isLastElement ? 'margin: 0;' : 'margin-top: 0;'} color: ${
|
|
466
|
+
return `<p style="${noDistance || isLastElement ? 'margin: 0;' : 'margin-top: 0;'} color: ${color}">${!isNaN(paramValue) && paramValue !== null ? `${paramValue.toFixed(1)}${unit}` : '-'}${noDistance ? '' : '<br/>'}</p>`;
|
|
464
467
|
}
|
|
465
468
|
if (isLastElement) {
|
|
466
|
-
return `<p style="${noDistance ? 'margin: 0;' : 'margin-bottom: 0;'} color: ${
|
|
469
|
+
return `<p style="${noDistance ? 'margin: 0;' : 'margin-bottom: 0;'} color: ${color}">${!isNaN(paramValue) && paramValue !== null ? `${paramValue.toFixed(1)}${unit}` : '-'}</p>`;
|
|
467
470
|
}
|
|
468
|
-
return `<p style="${noDistance ? 'margin: 0;' : 'margin-top: 0;'} color: ${
|
|
471
|
+
return `<p style="${noDistance ? 'margin: 0;' : 'margin-top: 0;'} color: ${color}">${!isNaN(paramValue) && paramValue !== null ? `${paramValue.toFixed(1)}${unit}` : '-'}${noDistance ? '' : '<br/>'}</p>`;
|
|
469
472
|
};
|
|
470
473
|
const extractPressureFromY = (diagramType, y, yScale) => {
|
|
471
474
|
if (diagramType === 'BIJVOET') {
|
|
@@ -499,7 +502,8 @@ const drawSoundingsTooltip = ({
|
|
|
499
502
|
hoveredTemp: dataSet.interpolateTemperature(pressure),
|
|
500
503
|
hoveredDewpoint: dataSet.interpolateDewpoint(pressure),
|
|
501
504
|
hoveredWindDirection: dataSet.interpolateWindDirection(pressure),
|
|
502
|
-
hoveredWindSpeed: dataSet.interpolateWindSpeed(pressure)
|
|
505
|
+
hoveredWindSpeed: dataSet.interpolateWindSpeed(pressure),
|
|
506
|
+
color: dataSet.tooltipColor
|
|
503
507
|
};
|
|
504
508
|
});
|
|
505
509
|
// Pressure
|
|
@@ -507,20 +511,20 @@ const drawSoundingsTooltip = ({
|
|
|
507
511
|
.style('top', `${pressureY}px`).html(`${Math.round(pressure)}hPa`);
|
|
508
512
|
// Temperature
|
|
509
513
|
tempRefd3.style('display', 'block').style('left', `${0.75 * width + margin.left}px`).style('top', `${pressureY}px`).html(() => interpolatedData.map((dataSet, index) => {
|
|
510
|
-
return getParamHtml(dataSet.hoveredTemp, index, '°C', index === interpolatedData.length - 1);
|
|
514
|
+
return getParamHtml(dataSet.hoveredTemp, index, '°C', index === interpolatedData.length - 1, dataSet.color);
|
|
511
515
|
}).join(''));
|
|
512
516
|
// Dewpoint temperature
|
|
513
517
|
dewpointRefd3.style('display', 'block').style('left', `${width / 3 + margin.left}px`).style('top', `${pressureY}px`).html(interpolatedData.map((dataSet, index) => {
|
|
514
|
-
return getParamHtml(dataSet.hoveredDewpoint, index, '°C', index === interpolatedData.length - 1);
|
|
518
|
+
return getParamHtml(dataSet.hoveredDewpoint, index, '°C', index === interpolatedData.length - 1, dataSet.color);
|
|
515
519
|
}).join(''));
|
|
516
520
|
// Wind
|
|
517
521
|
windRefd3.style('display', 'block').style('left', `${width + margin.left + margin.right - 55}px`) // -55 to account for width of element
|
|
518
522
|
.style('top', `${pressureY}px`).html(() => {
|
|
519
523
|
const windSpeedStrings = interpolatedData.map((dataSet, index) => {
|
|
520
|
-
return getParamHtml(dataSet.hoveredWindSpeed, index, 'm/s', index === interpolatedData.length - 1, true);
|
|
524
|
+
return getParamHtml(dataSet.hoveredWindSpeed, index, 'm/s', index === interpolatedData.length - 1, dataSet.color, true);
|
|
521
525
|
});
|
|
522
526
|
const windDirStrings = interpolatedData.map((dataSet, index) => {
|
|
523
|
-
return getParamHtml(dataSet.hoveredWindDirection, index, '°', index === interpolatedData.length - 1, index === interpolatedData.length - 1);
|
|
527
|
+
return getParamHtml(dataSet.hoveredWindDirection, index, '°', index === interpolatedData.length - 1, dataSet.color, index === interpolatedData.length - 1);
|
|
524
528
|
});
|
|
525
529
|
return windSpeedStrings.map((windSpeedString, index) => {
|
|
526
530
|
return `${windSpeedString}${windDirStrings[index]}`;
|
|
@@ -1808,16 +1812,18 @@ function parseCoverageCollection(response, parameterMappings) {
|
|
|
1808
1812
|
}
|
|
1809
1813
|
};
|
|
1810
1814
|
const data = {};
|
|
1815
|
+
// Ensure we have an array of coverages. If only a Coverage has been returned, put it in an array so we can "loop"
|
|
1816
|
+
const coverageData = response?.coverages ? response?.coverages : [response];
|
|
1811
1817
|
const {
|
|
1812
1818
|
t: tAxis,
|
|
1813
1819
|
x: xAxis,
|
|
1814
1820
|
y: yAxis,
|
|
1815
1821
|
z: zAxis
|
|
1816
|
-
} =
|
|
1822
|
+
} = coverageData[0]?.domain.axes || {};
|
|
1817
1823
|
if (!tAxis?.values || !xAxis?.values || !yAxis?.values || !zAxis?.values) {
|
|
1818
1824
|
return features;
|
|
1819
1825
|
}
|
|
1820
|
-
|
|
1826
|
+
coverageData.forEach(coverage => {
|
|
1821
1827
|
const {
|
|
1822
1828
|
ranges
|
|
1823
1829
|
} = coverage;
|
|
@@ -2287,7 +2293,7 @@ const translateKeyOutsideComponents = (key, params = undefined) => i18n.t(key, {
|
|
|
2287
2293
|
});
|
|
2288
2294
|
const useSoundingsTranslation = () => useTranslation(ns);
|
|
2289
2295
|
|
|
2290
|
-
const TIMESLIDER_HEIGHT =
|
|
2296
|
+
const TIMESLIDER_HEIGHT = 176;
|
|
2291
2297
|
const LABEL_MIN_WIDTH = 48;
|
|
2292
2298
|
const useMaxLabelCount = ref => {
|
|
2293
2299
|
const [width, setWidth] = React.useState(0);
|
|
@@ -2348,7 +2354,7 @@ const SoundingsTimeSlider = ({
|
|
|
2348
2354
|
ref: sliderRef,
|
|
2349
2355
|
style: {
|
|
2350
2356
|
display: 'flex',
|
|
2351
|
-
paddingTop: '
|
|
2357
|
+
paddingTop: '32px',
|
|
2352
2358
|
marginRight: '80px',
|
|
2353
2359
|
marginLeft: '24px',
|
|
2354
2360
|
height: `${TIMESLIDER_HEIGHT}px`
|
|
@@ -2778,6 +2784,198 @@ const SoundingsLegend = ({
|
|
|
2778
2784
|
});
|
|
2779
2785
|
};
|
|
2780
2786
|
|
|
2787
|
+
const SoundingsAccordion = React.forwardRef(({
|
|
2788
|
+
name,
|
|
2789
|
+
minWidth = 24,
|
|
2790
|
+
maxWidth,
|
|
2791
|
+
accordionIsOpen,
|
|
2792
|
+
diagramTypeButton,
|
|
2793
|
+
children
|
|
2794
|
+
}, aspectRatioRef) => {
|
|
2795
|
+
const containerRef = React.useRef(null);
|
|
2796
|
+
const widthRef = React.useRef(null);
|
|
2797
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
2798
|
+
const [autoSizing, setAutoSizing] = React.useState(false);
|
|
2799
|
+
const {
|
|
2800
|
+
position: containerWidth,
|
|
2801
|
+
setPosition: setContainerWidth,
|
|
2802
|
+
separatorProps
|
|
2803
|
+
} = useResizable({
|
|
2804
|
+
containerRef,
|
|
2805
|
+
axis: 'x',
|
|
2806
|
+
min: minWidth,
|
|
2807
|
+
max: maxWidth || undefined,
|
|
2808
|
+
initial: minWidth,
|
|
2809
|
+
onResizeStart: () => {
|
|
2810
|
+
setAutoSizing(false);
|
|
2811
|
+
},
|
|
2812
|
+
onResizeEnd: ({
|
|
2813
|
+
position
|
|
2814
|
+
}) => {
|
|
2815
|
+
if (position <= minWidth) {
|
|
2816
|
+
widthRef.current = null;
|
|
2817
|
+
return;
|
|
2818
|
+
}
|
|
2819
|
+
widthRef.current = position;
|
|
2820
|
+
}
|
|
2821
|
+
});
|
|
2822
|
+
const openAccordion = () => {
|
|
2823
|
+
if (widthRef.current != null) {
|
|
2824
|
+
setAutoSizing(false);
|
|
2825
|
+
setContainerWidth(Math.max(widthRef.current, minWidth));
|
|
2826
|
+
setIsOpen(true);
|
|
2827
|
+
return;
|
|
2828
|
+
}
|
|
2829
|
+
setAutoSizing(true);
|
|
2830
|
+
setIsOpen(true);
|
|
2831
|
+
};
|
|
2832
|
+
const closeAccordion = React.useCallback(() => {
|
|
2833
|
+
setContainerWidth(minWidth);
|
|
2834
|
+
setIsOpen(false);
|
|
2835
|
+
setAutoSizing(false);
|
|
2836
|
+
}, [minWidth, setContainerWidth]);
|
|
2837
|
+
React.useEffect(() => {
|
|
2838
|
+
if (accordionIsOpen) {
|
|
2839
|
+
setIsOpen(true);
|
|
2840
|
+
setAutoSizing(true);
|
|
2841
|
+
}
|
|
2842
|
+
}, [accordionIsOpen]);
|
|
2843
|
+
React.useLayoutEffect(() => {
|
|
2844
|
+
if (autoSizing) {
|
|
2845
|
+
return;
|
|
2846
|
+
}
|
|
2847
|
+
if (!isOpen && containerWidth > minWidth) {
|
|
2848
|
+
setIsOpen(true);
|
|
2849
|
+
return;
|
|
2850
|
+
}
|
|
2851
|
+
if (isOpen && containerWidth <= minWidth) {
|
|
2852
|
+
setIsOpen(false);
|
|
2853
|
+
setAutoSizing(false);
|
|
2854
|
+
}
|
|
2855
|
+
}, [autoSizing, containerWidth, isOpen, minWidth, setContainerWidth]);
|
|
2856
|
+
React.useLayoutEffect(() => {
|
|
2857
|
+
if (!autoSizing || !containerRef.current) {
|
|
2858
|
+
return;
|
|
2859
|
+
}
|
|
2860
|
+
let raf1 = 0;
|
|
2861
|
+
let raf2 = 0;
|
|
2862
|
+
const measureContainerWidth = () => {
|
|
2863
|
+
if (!containerRef.current) {
|
|
2864
|
+
return;
|
|
2865
|
+
}
|
|
2866
|
+
const {
|
|
2867
|
+
width
|
|
2868
|
+
} = containerRef.current.getBoundingClientRect();
|
|
2869
|
+
const calculatedWidth = Math.max(Math.round(width), minWidth);
|
|
2870
|
+
setContainerWidth(calculatedWidth);
|
|
2871
|
+
widthRef.current = calculatedWidth;
|
|
2872
|
+
setAutoSizing(false); // stop autosizing; lock width now that we have measured it
|
|
2873
|
+
};
|
|
2874
|
+
// Use double requestAnimationFrame so layout paints before measuring
|
|
2875
|
+
raf1 = requestAnimationFrame(() => {
|
|
2876
|
+
raf2 = requestAnimationFrame(measureContainerWidth);
|
|
2877
|
+
});
|
|
2878
|
+
// eslint-disable-next-line consistent-return
|
|
2879
|
+
return () => {
|
|
2880
|
+
cancelAnimationFrame(raf1);
|
|
2881
|
+
cancelAnimationFrame(raf2);
|
|
2882
|
+
};
|
|
2883
|
+
}, [autoSizing, minWidth, setContainerWidth]);
|
|
2884
|
+
const cardStyleWhenAuto = {
|
|
2885
|
+
width: 'auto',
|
|
2886
|
+
flex: '1 1 100%',
|
|
2887
|
+
minWidth: 0,
|
|
2888
|
+
maxWidth: maxWidth || '100%',
|
|
2889
|
+
boxSizing: 'border-box'
|
|
2890
|
+
};
|
|
2891
|
+
const cardStyleWhenLocked = {
|
|
2892
|
+
width: containerWidth,
|
|
2893
|
+
flex: '0 1 auto',
|
|
2894
|
+
minWidth,
|
|
2895
|
+
maxWidth: maxWidth || '100%',
|
|
2896
|
+
boxSizing: 'border-box'
|
|
2897
|
+
};
|
|
2898
|
+
return jsx(Card, {
|
|
2899
|
+
"data-testid": "soundings-accordion",
|
|
2900
|
+
ref: containerRef,
|
|
2901
|
+
sx: {
|
|
2902
|
+
height: '100%',
|
|
2903
|
+
position: 'relative',
|
|
2904
|
+
...(autoSizing ? cardStyleWhenAuto : cardStyleWhenLocked)
|
|
2905
|
+
},
|
|
2906
|
+
children: jsxs(Box, {
|
|
2907
|
+
ref: aspectRatioRef,
|
|
2908
|
+
sx: {
|
|
2909
|
+
height: '100%',
|
|
2910
|
+
width: '100%'
|
|
2911
|
+
},
|
|
2912
|
+
children: [!isOpen && jsxs(Box, {
|
|
2913
|
+
"data-testid": "closed-accordion-header",
|
|
2914
|
+
sx: {
|
|
2915
|
+
display: 'flex',
|
|
2916
|
+
justifyContent: 'center',
|
|
2917
|
+
alignItems: 'center',
|
|
2918
|
+
writingMode: 'vertical-lr',
|
|
2919
|
+
transform: 'rotate(180deg)',
|
|
2920
|
+
paddingBottom: '10px',
|
|
2921
|
+
cursor: 'pointer'
|
|
2922
|
+
},
|
|
2923
|
+
onClick: openAccordion,
|
|
2924
|
+
children: [name, jsx(ArrowDropDownDown, {
|
|
2925
|
+
sx: {
|
|
2926
|
+
transform: 'rotate(90deg)'
|
|
2927
|
+
}
|
|
2928
|
+
})]
|
|
2929
|
+
}), isOpen && jsx(Box, {
|
|
2930
|
+
"data-testid": "open-accordion-header",
|
|
2931
|
+
children: jsxs(Stack, {
|
|
2932
|
+
children: [jsxs(Box, {
|
|
2933
|
+
sx: {
|
|
2934
|
+
width: '100%',
|
|
2935
|
+
display: 'flex',
|
|
2936
|
+
alignItems: 'center',
|
|
2937
|
+
justifyContent: 'flex-end',
|
|
2938
|
+
paddingRight: '10px',
|
|
2939
|
+
overflow: 'hidden',
|
|
2940
|
+
marginTop: '4px'
|
|
2941
|
+
},
|
|
2942
|
+
children: [diagramTypeButton && diagramTypeButton, jsx(Box, {
|
|
2943
|
+
sx: {
|
|
2944
|
+
cursor: 'pointer',
|
|
2945
|
+
textOverflow: 'ellipsis',
|
|
2946
|
+
overflow: 'hidden',
|
|
2947
|
+
whiteSpace: 'nowrap',
|
|
2948
|
+
marginLeft: '16px',
|
|
2949
|
+
height: '100%'
|
|
2950
|
+
},
|
|
2951
|
+
onClick: closeAccordion,
|
|
2952
|
+
children: name
|
|
2953
|
+
}), jsx(ArrowDropDownDown, {})]
|
|
2954
|
+
}), jsx(Box, {
|
|
2955
|
+
sx: {
|
|
2956
|
+
display: 'flex',
|
|
2957
|
+
justifyContent: 'center',
|
|
2958
|
+
alignItems: 'center'
|
|
2959
|
+
},
|
|
2960
|
+
children: children
|
|
2961
|
+
})]
|
|
2962
|
+
})
|
|
2963
|
+
}), jsx(Box, {
|
|
2964
|
+
"data-testid": "soundings-accordion-drag-handle",
|
|
2965
|
+
...separatorProps,
|
|
2966
|
+
sx: {
|
|
2967
|
+
height: '100%',
|
|
2968
|
+
position: 'absolute',
|
|
2969
|
+
right: 0,
|
|
2970
|
+
top: 0,
|
|
2971
|
+
width: '5px',
|
|
2972
|
+
cursor: 'col-resize'
|
|
2973
|
+
}
|
|
2974
|
+
})]
|
|
2975
|
+
})
|
|
2976
|
+
});
|
|
2977
|
+
});
|
|
2978
|
+
|
|
2781
2979
|
const DIAGRAM_TYPE_BUTTON_HEIGHT = 28;
|
|
2782
2980
|
const useGetSize = (viewRef, legendRef) => {
|
|
2783
2981
|
const [size, setSize] = React.useState(0);
|
|
@@ -2940,7 +3138,6 @@ const SoundingsConnect = ({
|
|
|
2940
3138
|
viewId: viewId
|
|
2941
3139
|
})
|
|
2942
3140
|
}), jsxs(Card, {
|
|
2943
|
-
ref: viewRef,
|
|
2944
3141
|
sx: {
|
|
2945
3142
|
width: '100%',
|
|
2946
3143
|
height: '100%'
|
|
@@ -2958,38 +3155,50 @@ const SoundingsConnect = ({
|
|
|
2958
3155
|
children: jsx(SoundingsLegend, {
|
|
2959
3156
|
sourceSelections: sourceSelections
|
|
2960
3157
|
})
|
|
2961
|
-
}),
|
|
2962
|
-
sx: {
|
|
2963
|
-
display: 'flex',
|
|
2964
|
-
justifyContent: 'flex-end',
|
|
2965
|
-
paddingTop: '2px',
|
|
2966
|
-
paddingRight: '2px',
|
|
2967
|
-
width: size
|
|
2968
|
-
},
|
|
2969
|
-
children: jsx(DiagramTypeButton, {
|
|
2970
|
-
diagramType: chosenDiagramType,
|
|
2971
|
-
setDiagramType: setChosenDiagramType
|
|
2972
|
-
})
|
|
2973
|
-
}), jsx(Soundings, {
|
|
2974
|
-
data: data,
|
|
2975
|
-
svgDimensions: {
|
|
2976
|
-
width: size,
|
|
2977
|
-
height: size,
|
|
2978
|
-
margin: {
|
|
2979
|
-
bottom: 0,
|
|
2980
|
-
left: 0,
|
|
2981
|
-
right: 0,
|
|
2982
|
-
top: 0
|
|
2983
|
-
}
|
|
2984
|
-
},
|
|
2985
|
-
diagramType: chosenDiagramType
|
|
2986
|
-
}), jsx(Box, {
|
|
3158
|
+
}), jsxs(Stack, {
|
|
2987
3159
|
sx: {
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
3160
|
+
width: '100%',
|
|
3161
|
+
height: '100%',
|
|
3162
|
+
display: 'flex'
|
|
2991
3163
|
},
|
|
2992
|
-
|
|
3164
|
+
spacing: 1,
|
|
3165
|
+
children: [jsx(Box, {
|
|
3166
|
+
sx: {
|
|
3167
|
+
display: 'flex',
|
|
3168
|
+
flexDirection: 'row',
|
|
3169
|
+
width: '100%',
|
|
3170
|
+
height: '100%',
|
|
3171
|
+
padding: 1
|
|
3172
|
+
},
|
|
3173
|
+
children: jsx(SoundingsAccordion, {
|
|
3174
|
+
ref: viewRef,
|
|
3175
|
+
name: "Soundings",
|
|
3176
|
+
diagramTypeButton: jsx(DiagramTypeButton, {
|
|
3177
|
+
diagramType: chosenDiagramType,
|
|
3178
|
+
setDiagramType: setChosenDiagramType
|
|
3179
|
+
}),
|
|
3180
|
+
accordionIsOpen: true,
|
|
3181
|
+
children: jsx(Soundings, {
|
|
3182
|
+
data: data,
|
|
3183
|
+
svgDimensions: {
|
|
3184
|
+
width: size,
|
|
3185
|
+
height: size,
|
|
3186
|
+
margin: {
|
|
3187
|
+
bottom: 0,
|
|
3188
|
+
left: 0,
|
|
3189
|
+
right: 0,
|
|
3190
|
+
top: 0
|
|
3191
|
+
}
|
|
3192
|
+
},
|
|
3193
|
+
diagramType: chosenDiagramType
|
|
3194
|
+
})
|
|
3195
|
+
})
|
|
3196
|
+
}), jsx(Box, {
|
|
3197
|
+
sx: {
|
|
3198
|
+
width: '100%'
|
|
3199
|
+
},
|
|
3200
|
+
children: jsx(SoundingsTimeSliderConnect, {})
|
|
3201
|
+
})]
|
|
2993
3202
|
})]
|
|
2994
3203
|
})]
|
|
2995
3204
|
})]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/soundings",
|
|
3
|
-
"version": "14.0
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"description": "GeoWeb soundings library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,24 +8,25 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/api": "14.0
|
|
11
|
+
"@opengeoweb/api": "14.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.0
|
|
17
|
+
"@opengeoweb/shared": "14.1.0",
|
|
18
18
|
"@mui/material": "^7.0.1",
|
|
19
|
-
"@opengeoweb/store": "14.0
|
|
19
|
+
"@opengeoweb/store": "14.1.0",
|
|
20
20
|
"react-redux": "^9.2.0",
|
|
21
|
-
"@opengeoweb/theme": "14.0
|
|
21
|
+
"@opengeoweb/theme": "14.1.0",
|
|
22
22
|
"@reduxjs/toolkit": "^2.6.1",
|
|
23
|
-
"@opengeoweb/time-slider": "14.0
|
|
23
|
+
"@opengeoweb/time-slider": "14.1.0",
|
|
24
24
|
"react-window": "^1.8.10",
|
|
25
|
-
"@opengeoweb/webmap": "14.0
|
|
25
|
+
"@opengeoweb/webmap": "14.1.0",
|
|
26
26
|
"lodash": "^4.17.21",
|
|
27
27
|
"@types/geojson": "^7946.0.14",
|
|
28
|
-
"@opengeoweb/webmap-react": "14.0
|
|
28
|
+
"@opengeoweb/webmap-react": "14.1.0",
|
|
29
|
+
"react-resizable-layout": "^0.7.3"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"eslint-plugin-storybook": "9.0.17"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CoverageCollection } from '@opengeoweb/shared';
|
|
1
|
+
import { Coverage, CoverageCollection, VerticalProfileDomain } from '@opengeoweb/shared';
|
|
2
2
|
import { CollectionDetails, LocationsResponseFromBE, SoundingsInstances } from './types';
|
|
3
3
|
export declare const getCollectionLocations: (collectionId: string, baseUrl: string) => Promise<LocationsResponseFromBE>;
|
|
4
4
|
export declare const getCollectionInstances: (collectionId: string, baseUrl: string) => Promise<SoundingsInstances>;
|
|
5
5
|
export declare const getCollectionDetails: (collectionId: string, baseUrl: string) => Promise<CollectionDetails>;
|
|
6
|
-
export declare const getEdrCollectionForLocation: (collectionId: string, baseUrl: string, instanceId: string | undefined, locationId: string, parameters: string[], datetime: string, verticalRange: string) => Promise<CoverageCollection
|
|
7
|
-
export declare const getEdrCollectionForPosition: (collectionId: string, baseUrl: string, instanceId: string | undefined, coordinates: [number, number], parameters: string[], datetime: string, verticalRange: string) => Promise<CoverageCollection
|
|
6
|
+
export declare const getEdrCollectionForLocation: (collectionId: string, baseUrl: string, instanceId: string | undefined, locationId: string, parameters: string[], datetime: string, verticalRange: string) => Promise<CoverageCollection<VerticalProfileDomain> | Coverage<VerticalProfileDomain>>;
|
|
7
|
+
export declare const getEdrCollectionForPosition: (collectionId: string, baseUrl: string, instanceId: string | undefined, coordinates: [number, number], parameters: string[], datetime: string, verticalRange: string) => Promise<CoverageCollection<VerticalProfileDomain> | Coverage<VerticalProfileDomain>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CoverageCollection } from '@opengeoweb/shared';
|
|
1
|
+
import { Coverage, CoverageCollection, VerticalProfileDomain } from '@opengeoweb/shared';
|
|
2
2
|
import { CollectionDetails, SoundingFeature, SoundingsInstance } from './types';
|
|
3
|
-
export declare function parseCoverageCollection(response: CoverageCollection
|
|
3
|
+
export declare function parseCoverageCollection(response: CoverageCollection<VerticalProfileDomain> | Coverage<VerticalProfileDomain>, parameterMappings: Record<string, string>): SoundingFeature[];
|
|
4
4
|
/**
|
|
5
5
|
* Parse duration with repeats
|
|
6
6
|
* @param dateString e.g. 'R67/2025-04-22T09:00:00Z/PT60M'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SoundingsAccordionProps {
|
|
3
|
+
name: string;
|
|
4
|
+
minWidth?: number;
|
|
5
|
+
maxWidth?: number;
|
|
6
|
+
accordionIsOpen?: boolean;
|
|
7
|
+
diagramTypeButton?: React.ReactElement;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const SoundingsAccordion: React.ForwardRefExoticComponent<SoundingsAccordionProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StoryObj, Meta } from '@storybook/react-webpack5';
|
|
2
|
+
import { SoundingsAccordion } from './SoundingsAccordion';
|
|
3
|
+
declare const meta: Meta<typeof SoundingsAccordion>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof SoundingsAccordion>;
|
|
6
|
+
export declare const SoundingsAccordionClosed: Story;
|
|
7
|
+
export declare const SoundingsAccordionOpen: Story;
|
|
8
|
+
export declare const MultipleSoundingsAccordions: Story;
|
|
@@ -8,6 +8,7 @@ interface DrawSoundingsTooltipData {
|
|
|
8
8
|
interpolateDewpoint: (value: number) => number;
|
|
9
9
|
interpolateWindSpeed: (value: number) => number;
|
|
10
10
|
interpolateWindDirection: (value: number) => number;
|
|
11
|
+
tooltipColor: string;
|
|
11
12
|
}
|
|
12
13
|
export declare const constructTooltipData: (data: SoundingFeature[][]) => DrawSoundingsTooltipData[];
|
|
13
14
|
interface DrawSoundingsTooltipProps {
|
package/src/lib/store/store.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ export declare const soundingsReducersMap: {
|
|
|
10
10
|
ui: import("redux").Reducer<import("dist/libs/store/src/store/ui/types").UIStoreType>;
|
|
11
11
|
drawingtools: import("redux").Reducer<import("dist/libs/store/src/store/drawingTool/reducer").DrawingToolState>;
|
|
12
12
|
router: import("redux").Reducer<{}>;
|
|
13
|
+
common: import("redux").Reducer<{
|
|
14
|
+
auth: import("dist/libs/store/src/store/common/auth/types").AuthStore;
|
|
15
|
+
}, import("redux").UnknownAction, Partial<{
|
|
16
|
+
auth: import("dist/libs/store/src/store/common/auth/types").AuthStore | undefined;
|
|
17
|
+
}>>;
|
|
13
18
|
soundings: import("redux").Reducer<import("./types").SoundingsStore>;
|
|
14
19
|
};
|
|
15
20
|
export declare const createMockStore: (mockState?: SoundingsModuleState | WebMapStateModuleState | UIModuleState) => Store;
|