@opengeoweb/time-series 20.2.0 → 21.0.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/index.esm.js +972 -140
- package/dist/src/lib/components/TimeSeries/CurrentTime/CurrentTime.d.ts +20 -0
- package/dist/src/lib/components/TimeSeries/CurrentTime/index.d.ts +1 -0
- package/dist/src/lib/components/TimeSeries/TimeSeriesChart.d.ts +26 -3
- package/dist/src/lib/components/TimeSeries/TimeSeriesView.d.ts +1 -0
- package/dist/src/lib/components/TimeSeries/chartUtils.d.ts +6 -2
- package/dist/src/lib/components/TimeSeries/types.d.ts +2 -0
- package/dist/src/lib/components/TimeSeriesManager/PlotRows.d.ts +1 -0
- package/dist/src/lib/components/TimeSeriesManager/TimeSeriesManager.d.ts +1 -0
- package/dist/src/lib/components/TimeSeriesPanels/TimeSeriesPanelConnect.d.ts +4 -0
- package/dist/src/lib/components/TimeSeriesPanels/TimeSeriesPanelsConnect.d.ts +8 -0
- package/dist/src/lib/store/reducer.d.ts +5 -1
- package/dist/src/lib/store/selectors.d.ts +3 -0
- package/dist/src/lib/store/types.d.ts +13 -0
- package/package.json +11 -11
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { EChartsInstance } from 'echarts-for-react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/** One clock per view; standalone charts can use their own clock. Times are milliseconds. */
|
|
4
|
+
export declare const useCurrentTime: (enabled?: boolean) => number;
|
|
5
|
+
/** Fractional category index, preserving the spacing of the chart's time axis. */
|
|
6
|
+
export declare const getCurrentTimeIndex: (timestamps: number[], currentTime: number) => number | undefined;
|
|
7
|
+
interface IndicatorLine {
|
|
8
|
+
id: string;
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const getCurrentTimeLines: (instance: EChartsInstance, currentTime: number, showPlots: boolean, showZoom: boolean) => IndicatorLine[];
|
|
14
|
+
export declare const CurrentTime: React.FC<{
|
|
15
|
+
instance: EChartsInstance | null;
|
|
16
|
+
currentTime: number;
|
|
17
|
+
showPlots: boolean;
|
|
18
|
+
showZoom: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CurrentTime';
|
|
@@ -2,11 +2,13 @@ import type { EChartsInstance, EChartsOption } from 'echarts-for-react';
|
|
|
2
2
|
import ReactECharts from 'echarts-for-react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import type { PlotWithData } from './types';
|
|
5
|
-
export declare const useChartHeight: ({ plotsWithData, shouldShowLegend, option,
|
|
5
|
+
export declare const useChartHeight: ({ plotsWithData, shouldShowLegend, option, fitToContainer, shouldShowZoom, controlsOnly, }: {
|
|
6
6
|
plotsWithData: PlotWithData[];
|
|
7
7
|
shouldShowLegend: boolean;
|
|
8
8
|
option: EChartsOption;
|
|
9
|
-
|
|
9
|
+
fitToContainer?: boolean;
|
|
10
|
+
shouldShowZoom?: boolean;
|
|
11
|
+
controlsOnly?: "legend" | "zoom";
|
|
10
12
|
}) => {
|
|
11
13
|
chartHeight: number;
|
|
12
14
|
chartRef: React.RefObject<ReactECharts | null>;
|
|
@@ -16,6 +18,21 @@ export interface DataZoomState {
|
|
|
16
18
|
start: number;
|
|
17
19
|
end: number;
|
|
18
20
|
}
|
|
21
|
+
interface AxisPointerEvent {
|
|
22
|
+
axesInfo?: {
|
|
23
|
+
axisDim: string;
|
|
24
|
+
axisIndex: number;
|
|
25
|
+
value: number | string;
|
|
26
|
+
}[];
|
|
27
|
+
}
|
|
28
|
+
export interface ChartSynchronization {
|
|
29
|
+
zoomState: React.RefObject<DataZoomState | null>;
|
|
30
|
+
register: (instance: EChartsInstance, syncPointer?: boolean) => void;
|
|
31
|
+
unregister: (instance: EChartsInstance) => void;
|
|
32
|
+
zoom: (state: DataZoomState, source?: EChartsInstance) => void;
|
|
33
|
+
pointer: (event: AxisPointerEvent, source?: EChartsInstance) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare const useChartSynchronization: () => ChartSynchronization;
|
|
19
36
|
export declare const applyDataZoomState: (option: EChartsOption, dataZoomState: DataZoomState | null) => EChartsOption;
|
|
20
37
|
export declare const extractDataZoomState: (params: {
|
|
21
38
|
start?: number;
|
|
@@ -30,5 +47,11 @@ export declare const TimeSeriesChart: React.FC<{
|
|
|
30
47
|
animation?: boolean;
|
|
31
48
|
shouldShowLegend?: boolean;
|
|
32
49
|
onToggleLegendParam?: (legendId: string) => void;
|
|
33
|
-
|
|
50
|
+
fitToContainer?: boolean;
|
|
51
|
+
shouldShowZoom?: boolean;
|
|
52
|
+
controlsOnly?: 'legend' | 'zoom';
|
|
53
|
+
synchronization?: ReturnType<typeof useChartSynchronization>;
|
|
54
|
+
sharedTimesteps?: Date[];
|
|
55
|
+
currentTime?: number;
|
|
34
56
|
}>;
|
|
57
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import type { PlotPreset, TimeSeriesService } from '@opengeoweb/shared';
|
|
|
3
3
|
import type { TimeSliderStartEndStep } from '@opengeoweb/store';
|
|
4
4
|
import type { PointerLocation, GeoJsonWithService } from './types';
|
|
5
5
|
interface TimeSeriesViewProps {
|
|
6
|
+
viewId: string;
|
|
6
7
|
plotPreset: PlotPreset;
|
|
7
8
|
selectedLocation: PointerLocation;
|
|
8
9
|
services: TimeSeriesService[];
|
|
@@ -21,12 +21,16 @@ export declare const getYAxis: (plotCharts: PlotChart[]) => YAXisComponentOption
|
|
|
21
21
|
export declare const getXAxis: (plotCharts: PlotChart[]) => XAXisComponentOption[];
|
|
22
22
|
export declare const getParameterDisplayName: (parameter: ParameterWithData) => string;
|
|
23
23
|
export declare const roundDecimalValues: (value: number) => string;
|
|
24
|
-
|
|
24
|
+
/** Shared category order for panel charts and their zoom preview. */
|
|
25
|
+
export declare const getSharedTimesteps: (plots: PlotWithData[]) => Date[];
|
|
26
|
+
/** Build a unit-independent overview from visible, open plots and enabled parameters. */
|
|
27
|
+
export declare const getZoomPreviewPlot: (plots: PlotWithData[]) => PlotWithData;
|
|
28
|
+
export declare const getOption: (plotsWithData: PlotWithData[], shouldShowLegend?: boolean, sharedTimesteps?: Date[]) => EChartsOption;
|
|
25
29
|
export declare const getEChartsSeriesDataByTimestep: (timesteps: Date[], parameter: ParameterWithData) => (number | string)[][];
|
|
26
30
|
export declare const getSeries: (plotCharts: PlotChart[], parameterNames: {
|
|
27
31
|
name: string;
|
|
28
32
|
id: string;
|
|
29
|
-
}[]) => (LineSeriesOption | BarSeriesOption | ScatterSeriesOption)[];
|
|
33
|
+
}[], sharedTimesteps?: Date[]) => (LineSeriesOption | BarSeriesOption | ScatterSeriesOption)[];
|
|
30
34
|
export declare const getGrid: (plotCharts: PlotChart[]) => GridComponentOption[];
|
|
31
35
|
export declare const Y_AXIS_OFFSET = 80;
|
|
32
36
|
export declare const PLOT_HEIGHT = 150;
|
|
@@ -22,6 +22,7 @@ export declare const TimeSeriesManager: FC<{
|
|
|
22
22
|
plotState: PlotPreset;
|
|
23
23
|
addPlot: (title: string) => void;
|
|
24
24
|
deletePlot: (id: string) => void;
|
|
25
|
+
duplicatePlot: (id: string) => void;
|
|
25
26
|
togglePlot: (id: string) => void;
|
|
26
27
|
addParameter: (parameter: Parameter) => void;
|
|
27
28
|
deleteParameter: (id: string) => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ResizablePanelWrapperProps } from '@opengeoweb/shared';
|
|
3
|
+
export declare const TIME_SERIES_PANEL_MIN_HEIGHT = 90;
|
|
4
|
+
export declare const TimeSeriesPanelConnect: React.ForwardRefExoticComponent<ResizablePanelWrapperProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ResizablePanelComponent } from '@opengeoweb/shared';
|
|
3
|
+
export interface TimeSeriesPanelsProps {
|
|
4
|
+
viewId: string;
|
|
5
|
+
panelComponent?: ResizablePanelComponent;
|
|
6
|
+
renderPlot: (plotId: string) => React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const TimeSeriesPanelsConnect: ({ viewId, panelComponent, renderPlot, }: TimeSeriesPanelsProps) => React.ReactElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Reducer } from '@reduxjs/toolkit';
|
|
2
2
|
import type { TimeSeriesService } from '@opengeoweb/shared';
|
|
3
|
-
import type { ServiceFilterChipsObject, SetCurrentParameterInfo, SetSearchFilterPayload, MovePlotPayload, SetTimeSeriesServicesPayload, TimeSeriesState, TimeSeriesStoreType, ParameterManipulationPayload, UpdateTitlePayload, MoveParameterPayload, SetTimeSeriesServicePopupPayload, UpsertTimeSeriesServicePayload, RemoveServiceFilterChipFromStorePayload, RemoveTimeSeriesServicePayload, ParameterActionPayload, PlotActionPayload, AddPlotPayload, ParameterPatchPayload, ToggleDisableMapPinPayload, ToggleLocationMarkersPayload, ToggleTimeSeriesLegendPayload, SetTimeSeriesLocationPayload, RegisterTimeSeriesPresetPayload, SetLocationMenuSizeAndPositionPayload, SetLocationsDialogOpenPayload } from './types';
|
|
3
|
+
import type { ServiceFilterChipsObject, SetCurrentParameterInfo, SetSearchFilterPayload, MovePlotPayload, SetTimeSeriesServicesPayload, TimeSeriesState, TimeSeriesStoreType, ParameterManipulationPayload, UpdateTitlePayload, MoveParameterPayload, SetTimeSeriesServicePopupPayload, UpsertTimeSeriesServicePayload, RemoveServiceFilterChipFromStorePayload, RemoveTimeSeriesServicePayload, ParameterActionPayload, PlotActionPayload, AddPlotPayload, DuplicatePlotPayload, ParameterPatchPayload, ToggleDisableMapPinPayload, ToggleLocationMarkersPayload, ToggleTimeSeriesLegendPayload, SetTimeSeriesLocationPayload, RegisterTimeSeriesPresetPayload, SetLocationMenuSizeAndPositionPayload, SetLocationsDialogOpenPayload, SetPlotSizePayload, SetPlotIsOpenPayload, ReorderPlotsPayload } from './types';
|
|
4
4
|
export declare const timeseriesSelectServiceFilterChipsAdapter: import("@reduxjs/toolkit").EntityAdapter<ServiceFilterChipsObject, string>;
|
|
5
5
|
export declare const initialState: TimeSeriesState;
|
|
6
6
|
export declare const createPanelState: () => TimeSeriesStoreType;
|
|
@@ -12,6 +12,9 @@ export declare const timeSeriesActions: {
|
|
|
12
12
|
deletePlot: import("@reduxjs/toolkit").ActionCreatorWithPayload<PlotActionPayload, "timeseriesPanel/deletePlot">;
|
|
13
13
|
togglePlot: import("@reduxjs/toolkit").ActionCreatorWithPayload<PlotActionPayload, "timeseriesPanel/togglePlot">;
|
|
14
14
|
addPlot: import("@reduxjs/toolkit").ActionCreatorWithPayload<AddPlotPayload, "timeseriesPanel/addPlot">;
|
|
15
|
+
setPlotIsOpen: import("@reduxjs/toolkit").ActionCreatorWithPayload<SetPlotIsOpenPayload, "timeseriesPanel/setPlotIsOpen">;
|
|
16
|
+
setPlotSize: import("@reduxjs/toolkit").ActionCreatorWithPayload<SetPlotSizePayload, "timeseriesPanel/setPlotSize">;
|
|
17
|
+
duplicatePlot: import("@reduxjs/toolkit").ActionCreatorWithPayload<DuplicatePlotPayload, "timeseriesPanel/duplicatePlot">;
|
|
15
18
|
deleteParameter: import("@reduxjs/toolkit").ActionCreatorWithPayload<ParameterActionPayload, "timeseriesPanel/deleteParameter">;
|
|
16
19
|
addParameter: import("@reduxjs/toolkit").ActionCreatorWithPayload<ParameterManipulationPayload, "timeseriesPanel/addParameter">;
|
|
17
20
|
toggleParameter: import("@reduxjs/toolkit").ActionCreatorWithPayload<ParameterActionPayload, "timeseriesPanel/toggleParameter">;
|
|
@@ -19,6 +22,7 @@ export declare const timeSeriesActions: {
|
|
|
19
22
|
updateTitle: import("@reduxjs/toolkit").ActionCreatorWithPayload<UpdateTitlePayload, "timeseriesPanel/updateTitle">;
|
|
20
23
|
setSearchFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<SetSearchFilterPayload, "timeseriesPanel/setSearchFilter">;
|
|
21
24
|
movePlot: import("@reduxjs/toolkit").ActionCreatorWithPayload<MovePlotPayload, "timeseriesPanel/movePlot">;
|
|
25
|
+
reorderPlots: import("@reduxjs/toolkit").ActionCreatorWithPayload<ReorderPlotsPayload, "timeseriesPanel/reorderPlots">;
|
|
22
26
|
moveParameter: import("@reduxjs/toolkit").ActionCreatorWithPayload<MoveParameterPayload, "timeseriesPanel/moveParameter">;
|
|
23
27
|
setServiceFilterChipSelected: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
24
28
|
serviceId: string;
|
|
@@ -7,6 +7,9 @@ interface TimeSeriesStateSlice {
|
|
|
7
7
|
}
|
|
8
8
|
export declare const getPanelState: (state: TimeSeriesStateSlice, panelId?: string) => TimeSeriesStoreType | undefined;
|
|
9
9
|
export declare const getPlotState: (state: TimeSeriesStateSlice, panelId?: string) => PlotPreset | undefined;
|
|
10
|
+
export declare const getPlotById: (state: TimeSeriesStateSlice, panelId: string | undefined, plotId: string) => Plot | undefined;
|
|
11
|
+
export declare const getPlotIsOpen: (state: TimeSeriesStateSlice, panelId: string | undefined, plotId: string) => boolean;
|
|
12
|
+
export declare const getPlotCustomSize: (state: TimeSeriesStateSlice, panelId: string | undefined, plotId: string) => number | undefined;
|
|
10
13
|
export declare const getTimeSeriesState: (state: TimeSeriesStateSlice, panelId?: string) => TimeSeriesStoreType | undefined;
|
|
11
14
|
export declare const getMapId: (state: TimeSeriesStateSlice, panelId?: string) => string | undefined;
|
|
12
15
|
export declare const getPlotWithParameters: ((state: TimeSeriesStateSlice, _selectPlotId: string, panelId?: string | undefined) => Plot | undefined) & {
|
|
@@ -108,9 +108,19 @@ export interface ParameterActionPayload extends TimeSeriesPayload {
|
|
|
108
108
|
export interface PlotActionPayload extends TimeSeriesPayload {
|
|
109
109
|
plotId: string;
|
|
110
110
|
}
|
|
111
|
+
export interface DuplicatePlotPayload extends PlotActionPayload {
|
|
112
|
+
title: string;
|
|
113
|
+
}
|
|
111
114
|
export interface AddPlotPayload extends TimeSeriesPayload {
|
|
112
115
|
title: string;
|
|
113
116
|
}
|
|
117
|
+
export interface SetPlotIsOpenPayload extends PlotActionPayload {
|
|
118
|
+
isOpen: boolean;
|
|
119
|
+
}
|
|
120
|
+
export interface SetPlotSizePayload extends TimeSeriesPayload {
|
|
121
|
+
plotId: string;
|
|
122
|
+
size: number;
|
|
123
|
+
}
|
|
114
124
|
export interface UpdateTitlePayload extends TimeSeriesPayload {
|
|
115
125
|
plotId: string;
|
|
116
126
|
title: string;
|
|
@@ -127,6 +137,9 @@ export interface MovePlotPayload extends TimeSeriesPayload {
|
|
|
127
137
|
oldIndex: number;
|
|
128
138
|
newIndex: number;
|
|
129
139
|
}
|
|
140
|
+
export interface ReorderPlotsPayload extends TimeSeriesPayload {
|
|
141
|
+
newOrder: string[];
|
|
142
|
+
}
|
|
130
143
|
export interface MoveParameterPayload extends TimeSeriesPayload {
|
|
131
144
|
oldIndex: number;
|
|
132
145
|
newIndex: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/time-series",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"description": "GeoWeb time-series library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -21,26 +21,26 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"immer": "^10.0.3",
|
|
24
|
-
"@opengeoweb/shared": "
|
|
24
|
+
"@opengeoweb/shared": "21.0.0",
|
|
25
25
|
"@reduxjs/toolkit": "^2.6.1",
|
|
26
26
|
"react-redux": "^9.2.0",
|
|
27
|
-
"@opengeoweb/webmap": "
|
|
28
|
-
"@opengeoweb/webmap-react": "
|
|
27
|
+
"@opengeoweb/webmap": "21.0.0",
|
|
28
|
+
"@opengeoweb/webmap-react": "21.0.0",
|
|
29
29
|
"lodash": "^4.18.1",
|
|
30
|
-
"@opengeoweb/api": "
|
|
31
|
-
"@opengeoweb/authentication": "
|
|
32
|
-
"@opengeoweb/theme": "
|
|
33
|
-
"@opengeoweb/store": "
|
|
30
|
+
"@opengeoweb/api": "21.0.0",
|
|
31
|
+
"@opengeoweb/authentication": "21.0.0",
|
|
32
|
+
"@opengeoweb/theme": "21.0.0",
|
|
33
|
+
"@opengeoweb/store": "21.0.0",
|
|
34
34
|
"echarts-for-react": "^3.0.6",
|
|
35
35
|
"echarts": "^6.1.0",
|
|
36
36
|
"react-sortablejs": "^6.1.4",
|
|
37
|
-
"@opengeoweb/snackbar": "
|
|
37
|
+
"@opengeoweb/snackbar": "21.0.0",
|
|
38
38
|
"react-window": "^2.2.6",
|
|
39
39
|
"msw": "^2.7.3",
|
|
40
40
|
"i18next": "^25.0.1",
|
|
41
41
|
"react-i18next": "^15.1.1",
|
|
42
|
-
"@opengeoweb/core": "
|
|
43
|
-
"@opengeoweb/form-fields": "
|
|
42
|
+
"@opengeoweb/core": "21.0.0",
|
|
43
|
+
"@opengeoweb/form-fields": "21.0.0",
|
|
44
44
|
"@mui/material": "^9.0.1",
|
|
45
45
|
"react-hook-form": "^7.61.1",
|
|
46
46
|
"uuid": "^11.1.1",
|