@equinor/echo-framework 0.23.1 → 0.23.2
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.cjs.js +2 -2
- package/package.json +4 -2
- package/src/lib/feature/equipment/utils/equipmentUtils.d.ts +9 -9
- package/src/lib/feature/globalSelection/panToEcho3d/panTo3DButton.d.ts +4 -2
- package/src/lib/feature/globalSelection/panToEcho3d/usePanTo3DWeb.d.ts +2 -2
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/selectionTree.action.types.d.ts +1 -0
- package/src/lib/feature/legend/legendUpdater.d.ts +1 -0
- package/src/lib/feature/legend/legendVisibleDataStore.d.ts +1 -0
- package/src/lib/feature/legend/types/legendType.d.ts +1 -1
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/PointCountSelector.d.ts +15 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/graphStyleControls.d.ts +7 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/measuringHistoryGraphDialog.d.ts +8 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/measuringHistoryGraphTooltip.d.ts +2 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/components/viewInFullScreenButton.d.ts +5 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/hooks/useActiveStyleGraph.d.ts +5 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/hooks/useMeasuringChartConfig.d.ts +10 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/measuringDocumentsHistoryGraph.d.ts +14 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/measuringPointHistoryGraphSection.d.ts +6 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/measuringPointHistoryItem.d.ts +6 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/{measuringPointHistoryList.d.ts → measuringPointHistoryList/measuringPointHistoryList.d.ts} +1 -1
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/types/activeStyleType.d.ts +7 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/types/measuringDocumentsHistoryGraphType.d.ts +7 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/utils/createMeasuringChartConfig.d.ts +4 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/utils/measuringPointHistoryListUtils.d.ts +63 -0
- package/src/lib/feature/measuringPoint/types/measuringPoint.d.ts +2 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@equinor/echo-base": ">= 0.7.0 < 0.8.0",
|
|
6
6
|
"@equinor/echo-components": ">= 0.12.0 < 0.13.0",
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
"lodash": "4.17.21",
|
|
19
19
|
"react-router-dom": "5.3.4",
|
|
20
20
|
"zustand": ">= 4.4.7 < 5",
|
|
21
|
-
"immer": "10.1.1"
|
|
21
|
+
"immer": "10.1.1",
|
|
22
|
+
"ag-charts-react": ">= 11.1.1 < 12.0.0",
|
|
23
|
+
"ag-charts-community": ">= 11.1.1 < 12.0.0"
|
|
22
24
|
},
|
|
23
25
|
"dependencies": {
|
|
24
26
|
"dexie": "4.0.11"
|
|
@@ -12,20 +12,20 @@ interface OpenMeasuringPointsArgs {
|
|
|
12
12
|
export declare const openEquipmentIn3dWeb: ({ equipmentId, e3dRef, goToLink, pathname, instCode, tagNo }: OpenMeasuringPointsArgs) => Promise<void>;
|
|
13
13
|
export declare const is3DEquipment: (equipment: Equipment) => boolean;
|
|
14
14
|
export declare const sortMeasurementsInMeasuringPointsByNewestFirst: (measuringPoints: MeasuringPointDto[]) => {
|
|
15
|
+
measurements: import("../../measuringPoint").MeasurementDto[];
|
|
15
16
|
measuringPointId: string;
|
|
16
|
-
measuringPosition
|
|
17
|
-
measuringPoint
|
|
18
|
-
functionalLocationId
|
|
19
|
-
tagPlantId
|
|
20
|
-
tagId
|
|
21
|
-
equipmentId
|
|
22
|
-
quantitativeCharacteristicId
|
|
23
|
-
quantitativeCharacteristicUnit
|
|
17
|
+
measuringPosition: string;
|
|
18
|
+
measuringPoint: string;
|
|
19
|
+
functionalLocationId: string | undefined;
|
|
20
|
+
tagPlantId: string | undefined;
|
|
21
|
+
tagId: string | undefined;
|
|
22
|
+
equipmentId: string | undefined;
|
|
23
|
+
quantitativeCharacteristicId: string | undefined;
|
|
24
|
+
quantitativeCharacteristicUnit: string | undefined;
|
|
24
25
|
positionDetails_CoordinateSystemName?: string;
|
|
25
26
|
positionDetails_E3DReferenceNumber?: string;
|
|
26
27
|
positionDetails_CoordinateEast?: string;
|
|
27
28
|
positionDetails_CoordinateNorth?: string;
|
|
28
29
|
positionDetails_CoordinateUp?: string;
|
|
29
|
-
measurements: import("../../measuringPoint").MeasurementDto[];
|
|
30
30
|
}[];
|
|
31
31
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
import { GlobalSelectionItemType, GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
|
|
3
3
|
interface PanTo3DButtonProps {
|
|
4
|
-
|
|
4
|
+
itemId: GlobalSelectionTypes.ItemId;
|
|
5
|
+
itemType: GlobalSelectionItemType;
|
|
6
|
+
disabled: boolean;
|
|
5
7
|
}
|
|
6
8
|
export declare const PanTo3DButton: React.FC<PanTo3DButtonProps>;
|
|
7
9
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
|
|
1
|
+
import { GlobalSelectionItemType, GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
|
|
2
2
|
export declare const usePanTo3dWeb: () => {
|
|
3
|
-
panTo3D: (
|
|
3
|
+
panTo3D: (itemId: GlobalSelectionTypes.ItemId, itemType: GlobalSelectionItemType) => Promise<void>;
|
|
4
4
|
};
|
|
@@ -11,6 +11,7 @@ export type AddItemArgs<ItemIdType extends GlobalSelectionTypes.ItemId> = {
|
|
|
11
11
|
} & AddByLabel;
|
|
12
12
|
export type AddItemsResponse<FetchResponseType> = {
|
|
13
13
|
fetchResults: FetchResponseType;
|
|
14
|
+
itemsAdded: Readonly<GlobalSelectionTypes.ItemId[]>;
|
|
14
15
|
actionResult: SelectionTreeActionResult;
|
|
15
16
|
};
|
|
16
17
|
export type SelectionTreeActionResult = 'ItemsUpdated' | 'ItemsAdded' | 'NewGroupCreated' | 'NoChanges';
|
|
@@ -52,6 +52,7 @@ export declare const useLegendVisibleDataStore: import("zustand").UseBoundStore<
|
|
|
52
52
|
type: string;
|
|
53
53
|
} | undefined): void;
|
|
54
54
|
}>;
|
|
55
|
+
export declare function legendVisibleDataSnapshot(): LegendVisibleDataStore;
|
|
55
56
|
/**
|
|
56
57
|
* Visible items are all items on screen that should be affected by the legend.
|
|
57
58
|
* @returns A function for adding visible items by type and key, which is automatically removed when the component unmounts.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Brand } from '@equinor/echo-utils';
|
|
2
2
|
import { GlobalSelectionTypes } from '../../globalSelection';
|
|
3
|
-
type TemporaryLegendIdsForTesting = '
|
|
3
|
+
type TemporaryLegendIdsForTesting = 'Tag Legend' | 'Work Orders with Custom UI';
|
|
4
4
|
export type KnownLegendIds = 'Equipment' | TemporaryLegendIdsForTesting;
|
|
5
5
|
export type LegendId = KnownLegendIds | Brand<string, 'LegendId'>;
|
|
6
6
|
export declare function createLegendId(id: string): LegendId;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PointCountSelector lets users choose how many data points to display,
|
|
3
|
+
* such as the last 5, 10, 15, 20, or all available points.
|
|
4
|
+
*
|
|
5
|
+
* @param maxPoints - The total number of points available for selection.
|
|
6
|
+
* @param pointCount - The currently selected number of points to display.
|
|
7
|
+
* @param onChange - Callback when the user selects a different point count.
|
|
8
|
+
*/
|
|
9
|
+
interface PointCountSelectorProps {
|
|
10
|
+
maxPoints: number;
|
|
11
|
+
pointCount: number;
|
|
12
|
+
onChange: (selectedValue: number) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const PointCountSelector: React.FC<PointCountSelectorProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActiveStyle, HandleInterpolationChange } from '../types/activeStyleType';
|
|
2
|
+
type GraphStyleControlsProps = {
|
|
3
|
+
activeStyle: ActiveStyle;
|
|
4
|
+
onInterpolationChange: HandleInterpolationChange;
|
|
5
|
+
};
|
|
6
|
+
export declare const GraphStyleControls: React.FC<GraphStyleControlsProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AgCartesianChartOptions } from 'ag-charts-community';
|
|
2
|
+
import { MeasurementDto } from '../../../../types/measuringPoint';
|
|
3
|
+
import { ActiveStyle, HandleInterpolationChange } from '../types/activeStyleType';
|
|
4
|
+
export declare function useMeasuringChartConfig(measurements: MeasurementDto[], activeStyle: ActiveStyle, setActiveStyle: (style: ActiveStyle) => void, isFullscreen: boolean): {
|
|
5
|
+
chartConfig: AgCartesianChartOptions;
|
|
6
|
+
sortedMeasurements: import("../utils/measuringPointHistoryListUtils").SortedMeasurement[];
|
|
7
|
+
pointCount: number;
|
|
8
|
+
setPointCount: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
9
|
+
updateInterpolation: HandleInterpolationChange;
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MeasurementDto } from '../../../types/measuringPoint';
|
|
3
|
+
import { ActiveStyle, SetActiveStyle } from './types/activeStyleType';
|
|
4
|
+
type MeasuringDocumentsHistoryGraphProps = {
|
|
5
|
+
measurements: MeasurementDto[];
|
|
6
|
+
activeStyle: ActiveStyle;
|
|
7
|
+
setActiveStyle: SetActiveStyle;
|
|
8
|
+
isFullSize?: boolean;
|
|
9
|
+
specifiedHeight?: string;
|
|
10
|
+
specifiedPadding?: string;
|
|
11
|
+
graphStyleControls?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const MeasuringDocumentsHistoryGraph: React.FC<MeasuringDocumentsHistoryGraphProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MeasurementDto } from '../../../types/measuringPoint';
|
|
2
|
+
interface MeasuringPointHistoryGraphSectionProps {
|
|
3
|
+
measurements: MeasurementDto[];
|
|
4
|
+
}
|
|
5
|
+
export declare const MeasuringPointHistoryGraphSection: React.FC<MeasuringPointHistoryGraphSectionProps>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Position, Type } from './measuringDocumentsHistoryGraphType';
|
|
2
|
+
export type ActiveStyle = {
|
|
3
|
+
type: Type;
|
|
4
|
+
position?: Position;
|
|
5
|
+
};
|
|
6
|
+
export type HandleInterpolationChange = (type: ActiveStyle['type'], position?: ActiveStyle['position']) => void;
|
|
7
|
+
export type SetActiveStyle = (style: ActiveStyle) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AgBaseAxisLabelOptions } from 'ag-charts-community';
|
|
2
|
+
import { SortedMeasurement } from '../utils/measuringPointHistoryListUtils';
|
|
3
|
+
export declare const strongRed: string;
|
|
4
|
+
export declare const strongRedFade: string;
|
|
5
|
+
export type Type = 'linear' | 'smooth' | 'step';
|
|
6
|
+
export type Position = 'start' | 'middle' | 'end';
|
|
7
|
+
export declare const createLabel: (fullScreenDialogOpen: boolean | undefined, sortedMeasurements: SortedMeasurement[], yAxisLabel?: boolean) => AgBaseAxisLabelOptions;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AgCartesianChartOptions } from 'ag-charts-community';
|
|
2
|
+
import { ActiveStyle } from '../types/activeStyleType';
|
|
3
|
+
import { SortedMeasurement } from './measuringPointHistoryListUtils';
|
|
4
|
+
export declare function createMeasuringChartConfig(data: SortedMeasurement[], activeStyle: ActiveStyle, fullScreen?: boolean): AgCartesianChartOptions;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { AgAxisLabelFormatterParams, AgCartesianChartOptions } from 'ag-charts-community';
|
|
2
|
+
import { MeasurementDto } from '../../../../types/measuringPoint';
|
|
3
|
+
import { ActiveStyle } from '../types/activeStyleType';
|
|
4
|
+
export interface SortedMeasurement {
|
|
5
|
+
date: string;
|
|
6
|
+
condition: number;
|
|
7
|
+
fullDateTime: Date;
|
|
8
|
+
unit: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Filters the given list of measurements to include only those with valid quantitative or qualitative readings.
|
|
12
|
+
*
|
|
13
|
+
* @param {MeasurementDto[]} measurements - The list of measurements to filter.
|
|
14
|
+
* @returns {MeasurementDto[]} - The filtered list of measurements.
|
|
15
|
+
*/
|
|
16
|
+
export declare const filterMeasurements: (measurements: MeasurementDto[]) => MeasurementDto[];
|
|
17
|
+
/**
|
|
18
|
+
* Maps a MeasurementDto to a simplified sortable measurement object.
|
|
19
|
+
*
|
|
20
|
+
* @param {MeasurementDto} measurement - The measurement to transform.
|
|
21
|
+
* @returns {Omit<SortedMeasurement, 'date'> & { fullDateTime: Date, date: Date }} - The transformed measurement with full datetime info.
|
|
22
|
+
*/
|
|
23
|
+
export declare const mapToSortableMeasurement: (measurement: MeasurementDto) => Omit<SortedMeasurement, "date"> & {
|
|
24
|
+
fullDateTime: Date;
|
|
25
|
+
date: Date;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Sorts the given list of measurements by their measurement date and maps them to a simplified structure.
|
|
29
|
+
*
|
|
30
|
+
* @param {MeasurementDto[]} measurements - The list of measurements to sort and map.
|
|
31
|
+
* @returns {SortedMeasurement[]} - The sorted and mapped list of measurements.
|
|
32
|
+
*/
|
|
33
|
+
export declare const sortMeasurements: (measurements: MeasurementDto[]) => SortedMeasurement[];
|
|
34
|
+
/**
|
|
35
|
+
* Formats the x-axis labels for the chart, where only a specified number of labels are displayed.
|
|
36
|
+
*
|
|
37
|
+
* @param {AgAxisLabelFormatterParams} params - The parameters for the axis label formatter.
|
|
38
|
+
* @returns {string} - The formatted label for the x-axis.
|
|
39
|
+
*/
|
|
40
|
+
export declare function xAxisLabelFormatter(args: {
|
|
41
|
+
params: AgAxisLabelFormatterParams;
|
|
42
|
+
sortedMeasurements: SortedMeasurement[];
|
|
43
|
+
numberOfLabels: 3 | number;
|
|
44
|
+
}): any;
|
|
45
|
+
/**
|
|
46
|
+
* Updates the chart interpolation style for the given chart options.
|
|
47
|
+
*
|
|
48
|
+
* @param {AgCartesianChartOptions} chartOptions - The chart options to update.
|
|
49
|
+
* @param {boolean} enableInterpolation - Whether to enable or disable interpolation.
|
|
50
|
+
* @returns {AgCartesianChartOptions} - The updated chart options with the interpolation setting applied.
|
|
51
|
+
*/
|
|
52
|
+
export declare function updateChartInterpolation(prevConfig: AgCartesianChartOptions, type: ActiveStyle['type'], position: ActiveStyle['position'] | undefined, isFullscreen: boolean): AgCartesianChartOptions;
|
|
53
|
+
/**
|
|
54
|
+
* Formats a measurement value for display in the chart tooltip or list.
|
|
55
|
+
*
|
|
56
|
+
* @param {number} value - The measurement value to format.
|
|
57
|
+
* @param {string} unit - The unit of the measurement.
|
|
58
|
+
* @returns {string} - The formatted measurement value with the unit.
|
|
59
|
+
*/
|
|
60
|
+
export declare function formatMeasurement(measurement: {
|
|
61
|
+
quantitativeReading?: number;
|
|
62
|
+
quantitativeReadingUnitId?: string | null;
|
|
63
|
+
}): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MeasuringPointData } from '@equinor/echo-search';
|
|
1
2
|
export interface MeasurementDto {
|
|
2
3
|
measurementId: string;
|
|
3
4
|
measuringPointId: string;
|
|
@@ -14,20 +15,6 @@ export interface MeasurementDto {
|
|
|
14
15
|
qualitativeCodeId?: string;
|
|
15
16
|
longText?: object;
|
|
16
17
|
}
|
|
17
|
-
export interface MeasuringPointDto {
|
|
18
|
-
readonly measuringPointId: string;
|
|
19
|
-
readonly measuringPosition?: string;
|
|
20
|
-
readonly measuringPoint?: string;
|
|
21
|
-
readonly functionalLocationId?: string;
|
|
22
|
-
readonly tagPlantId?: string;
|
|
23
|
-
readonly tagId?: string;
|
|
24
|
-
readonly equipmentId?: string;
|
|
25
|
-
readonly quantitativeCharacteristicId?: string;
|
|
26
|
-
readonly quantitativeCharacteristicUnit?: string;
|
|
27
|
-
readonly positionDetails_CoordinateSystemName?: string;
|
|
28
|
-
readonly positionDetails_E3DReferenceNumber?: string;
|
|
29
|
-
readonly positionDetails_CoordinateEast?: string;
|
|
30
|
-
readonly positionDetails_CoordinateNorth?: string;
|
|
31
|
-
readonly positionDetails_CoordinateUp?: string;
|
|
18
|
+
export interface MeasuringPointDto extends MeasuringPointData {
|
|
32
19
|
readonly measurements: MeasurementDto[];
|
|
33
20
|
}
|