@osrd-project/ui-charts 0.0.79 → 0.0.82
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/chronogram/components/Chronogram.d.ts +3 -0
- package/dist/chronogram/index.d.ts +4 -0
- package/dist/chronogram/lib/context.d.ts +6 -0
- package/dist/chronogram/lib/types.d.ts +21 -0
- package/dist/common/consts.d.ts +5 -0
- package/dist/common/context.d.ts +2 -0
- package/dist/{spaceTimeChart/utils → common/helpers}/colors.d.ts +1 -1
- package/dist/common/helpers/time.d.ts +31 -0
- package/dist/common/helpers/utils.d.ts +8 -0
- package/dist/common/hooks/useCanvas.d.ts +16 -0
- package/dist/{spaceTimeChart → common}/hooks/useSize.d.ts +0 -1
- package/dist/common/index.d.ts +5 -0
- package/dist/common/types.d.ts +104 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +1895 -1445
- package/dist/index.esm.js.map +1 -1
- package/dist/manchette/assets/sampleData.d.ts +2 -0
- package/dist/manchette/components/Manchette.d.ts +6 -1
- package/dist/manchette/components/ManchetteWithSpaceTimeChart.d.ts +3 -3
- package/dist/manchette/components/Waypoint.d.ts +2 -1
- package/dist/manchette/hooks/useManchetteWithSpaceTimeChart.d.ts +3 -36
- package/dist/manchette/hooks/useSyncManchette.d.ts +94 -0
- package/dist/manchette/index.d.ts +1 -2
- package/dist/manchette/types.d.ts +13 -0
- package/dist/spaceTimeChart/components/ConflictLayer.d.ts +1 -1
- package/dist/spaceTimeChart/components/ConflictTooltip.d.ts +1 -1
- package/dist/spaceTimeChart/components/PathLayer.d.ts +2 -1
- package/dist/spaceTimeChart/components/Quadrilateral.d.ts +2 -1
- package/dist/spaceTimeChart/components/Tooltip.d.ts +1 -1
- package/dist/spaceTimeChart/hooks/useMouseInteractions.d.ts +36 -3
- package/dist/spaceTimeChart/index.d.ts +2 -5
- package/dist/spaceTimeChart/lib/consts.d.ts +0 -3
- package/dist/spaceTimeChart/lib/context.d.ts +3 -6
- package/dist/spaceTimeChart/lib/types.d.ts +4 -91
- package/dist/spaceTimeChart/utils/canvas.d.ts +2 -37
- package/dist/spaceTimeChart/utils/events.d.ts +1 -1
- package/dist/spaceTimeChart/utils/geometry.d.ts +1 -1
- package/dist/spaceTimeChart/utils/scales.d.ts +2 -3
- package/dist/spaceTimeChart/utils/snapping.d.ts +1 -1
- package/dist/spaceTimeChart/utils/vectors.d.ts +1 -1
- package/dist/speedSpaceChart/components/SpeedSpaceChart.d.ts +21 -2
- package/dist/speedSpaceChart/components/common/DetailsBox.d.ts +5 -2
- package/dist/speedSpaceChart/components/common/SettingsPanel.d.ts +2 -1
- package/dist/speedSpaceChart/components/const.d.ts +22 -6
- package/dist/speedSpaceChart/components/helpers/drawElements/reticle.d.ts +2 -1
- package/dist/speedSpaceChart/components/layers/ReticleLayer.d.ts +3 -1
- package/dist/speedSpaceChart/components/utils.d.ts +7 -3
- package/dist/speedSpaceChart/index.d.ts +2 -1
- package/dist/speedSpaceChart/types.d.ts +40 -0
- package/dist/theme.css +468 -243
- package/dist/theme.css.map +1 -1
- package/dist/trackOccupancyDiagram/components/TrackOccupancyCanvas.d.ts +1 -1
- package/dist/trackOccupancyDiagram/components/TrackOccupancyManchette.d.ts +1 -1
- package/dist/trackOccupancyDiagram/components/TrackOccupancyStandalone.d.ts +1 -1
- package/dist/trackOccupancyDiagram/components/helpers/drawElements/drawOccupancyZones.d.ts +8 -2
- package/dist/trackOccupancyDiagram/components/helpers/drawElements/drawOccupancyZonesTexts.d.ts +1 -1
- package/dist/trackOccupancyDiagram/components/helpers/drawElements/drawTracks.d.ts +1 -1
- package/dist/trackOccupancyDiagram/components/layers/OccupancyZonesLayer.d.ts +2 -2
- package/dist/trackOccupancyDiagram/components/layers/TracksLayer.d.ts +1 -1
- package/dist/trackOccupancyDiagram/components/utils.d.ts +1 -1
- package/dist/trackOccupancyDiagram/index.d.ts +2 -2
- package/dist/trackOccupancyDiagram/{components → lib}/types.d.ts +2 -1
- package/package.json +6 -6
- package/dist/manchette/hooks/usePaths.d.ts +0 -11
- package/dist/spaceTimeChart/hooks/useCanvas.d.ts +0 -19
- /package/dist/{spaceTimeChart/utils → common/helpers}/png.d.ts +0 -0
- /package/dist/{spaceTimeChart → common}/hooks/useDevicePixelRatio.d.ts +0 -0
- /package/dist/{spaceTimeChart/components → common/layers}/TimeCaptions.d.ts +0 -0
- /package/dist/{spaceTimeChart/components → common/layers}/TimeGraduations.d.ts +0 -0
- /package/dist/trackOccupancyDiagram/{components → lib}/consts.d.ts +0 -0
|
@@ -9,6 +9,7 @@ type SettingsPanelProps = {
|
|
|
9
9
|
adjustHeightOnLayerChange: (layerName: 'electricalProfiles' | 'powerRestrictions' | 'speedLimitTags', isCurrentlyActive: boolean) => void;
|
|
10
10
|
translations?: SpeedSpaceChartProps['translations'];
|
|
11
11
|
testIdPrefix?: string;
|
|
12
|
+
displayEtcs?: boolean;
|
|
12
13
|
};
|
|
13
|
-
declare const SettingsPanel: ({ color, store, setStore, setIsMouseHoveringSettingsPanel, adjustHeightOnLayerChange, translations, testIdPrefix, }: SettingsPanelProps) => React.JSX.Element;
|
|
14
|
+
declare const SettingsPanel: ({ color, store, setStore, setIsMouseHoveringSettingsPanel, adjustHeightOnLayerChange, translations, testIdPrefix, displayEtcs, }: SettingsPanelProps) => React.JSX.Element;
|
|
14
15
|
export default SettingsPanel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import chroma from 'chroma-js';
|
|
2
|
-
import { type ColorDictionary, type Store } from '../types';
|
|
2
|
+
import { type ColorDictionary, type EtcsAlphaDictionary, EtcsBrakingCurveType, EtcsBrakingType, type EtcsColorDictionary, type EtcsLayersDisplay, type Store } from '../types';
|
|
3
3
|
export declare const SLOPE_FILL_COLOR = "#CFDDCE";
|
|
4
4
|
export declare const RIGHT_TICK_HEIGHT_OFFSET = 2;
|
|
5
5
|
export declare const TICK_TITLE_MARGINS: {
|
|
@@ -25,11 +25,6 @@ export declare const LINEAR_LAYERS_HEIGHTS: {
|
|
|
25
25
|
POWER_RESTRICTIONS_HEIGHT: number;
|
|
26
26
|
SPEED_LIMIT_TAGS_HEIGHT: number;
|
|
27
27
|
};
|
|
28
|
-
export declare const LINEAR_LAYERS_HEIGHTS_BY_NAME: {
|
|
29
|
-
electricalProfiles: number;
|
|
30
|
-
powerRestrictions: number;
|
|
31
|
-
speedLimitTags: number;
|
|
32
|
-
};
|
|
33
28
|
export declare const LINEAR_LAYER_SEPARATOR_HEIGHT = 1;
|
|
34
29
|
export declare const LINEAR_LAYERS_BACKGROUND_COLOR: {
|
|
35
30
|
FIRST: string;
|
|
@@ -39,6 +34,20 @@ export declare const LINEAR_LAYERS_BACKGROUND_COLOR: {
|
|
|
39
34
|
export declare const FRONT_INTERACTIVITY_LAYER_ID = "#front-interactivity-layer";
|
|
40
35
|
export declare const DETAILS_BOX_SELECTION: Array<keyof Store['detailsBoxDisplay']>;
|
|
41
36
|
export declare const LAYERS_SELECTION: Array<keyof Store['layersDisplay']>;
|
|
37
|
+
export declare const DEFAULT_ETCS_LAYERS_DISPLAY: {
|
|
38
|
+
etcsBrakingTypes: {
|
|
39
|
+
stopsAndTransitions: boolean;
|
|
40
|
+
spacing: boolean;
|
|
41
|
+
routing: boolean;
|
|
42
|
+
};
|
|
43
|
+
etcsBrakingCurveTypes: {
|
|
44
|
+
indication: boolean;
|
|
45
|
+
permittedSpeed: boolean;
|
|
46
|
+
guidance: boolean;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export declare const ETCS_BRAKING_SELECTION: Record<keyof EtcsLayersDisplay['etcsBrakingTypes'], EtcsBrakingType[]>;
|
|
50
|
+
export declare const ETCS_CURVE_SELECTION: Record<keyof EtcsLayersDisplay['etcsBrakingCurveTypes'], EtcsBrakingCurveType>;
|
|
42
51
|
export declare const BLACK: chroma.Color;
|
|
43
52
|
export declare const ERROR_30: chroma.Color;
|
|
44
53
|
export declare const ERROR_60: chroma.Color;
|
|
@@ -47,6 +56,11 @@ export declare const GREY_80: chroma.Color;
|
|
|
47
56
|
export declare const LIGHT_BLUE: chroma.Color;
|
|
48
57
|
export declare const WARNING_30: chroma.Color;
|
|
49
58
|
export declare const WHITE: chroma.Color;
|
|
59
|
+
export declare const BASE_SPEED_COLOR: chroma.Color;
|
|
60
|
+
export declare const ECO_SPEED_COLOR: chroma.Color;
|
|
61
|
+
export declare const BASE_SPEED_FILL_ALPHA = 0.15;
|
|
62
|
+
export declare const ETCS_COLOR_DICTIONARY: EtcsColorDictionary;
|
|
63
|
+
export declare const ETCS_ALPHA_DICTIONARY: EtcsAlphaDictionary;
|
|
50
64
|
/**
|
|
51
65
|
* COLOR_DICTIONARY maps specific colors to their corresponding secondary colors used for speed limit tags.
|
|
52
66
|
*/
|
|
@@ -56,3 +70,5 @@ export declare const ZOOM_CONFIG: {
|
|
|
56
70
|
MAX_RATIO: number;
|
|
57
71
|
SLIDER_WIDTH: number;
|
|
58
72
|
};
|
|
73
|
+
export declare const SPEEDS_LINEWIDTH = 0.5;
|
|
74
|
+
export declare const ETCS_LINEWIDTH = 3;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type DrawFunctionParams, EtcsBrakingCurveType, EtcsBrakingType, type EtcsSpeedValue } from '../../../types';
|
|
2
2
|
export declare const drawCursor: ({ ctx, width, height, store }: DrawFunctionParams) => {
|
|
3
3
|
curveX: number;
|
|
4
4
|
curveY: number;
|
|
5
5
|
speedText: string;
|
|
6
6
|
ecoSpeedText: string;
|
|
7
|
+
etcsSpeedValues: Record<EtcsBrakingType, Record<EtcsBrakingCurveType, EtcsSpeedValue[]>> | undefined;
|
|
7
8
|
effortText: string;
|
|
8
9
|
electricalModeText: string;
|
|
9
10
|
electricalProfileText: string;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Store } from '../../types';
|
|
3
|
+
import type { SpeedSpaceChartProps } from '../SpeedSpaceChart';
|
|
3
4
|
type ReticleLayerProps = {
|
|
4
5
|
width: number;
|
|
5
6
|
internalHeight: number;
|
|
6
7
|
store: Store;
|
|
8
|
+
translations?: SpeedSpaceChartProps['translations'];
|
|
7
9
|
};
|
|
8
|
-
declare const ReticleLayer: ({ width, internalHeight: height, store }: ReticleLayerProps) => React.JSX.Element;
|
|
10
|
+
declare const ReticleLayer: ({ width, internalHeight: height, store, translations, }: ReticleLayerProps) => React.JSX.Element;
|
|
9
11
|
export default ReticleLayer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MARGINS, type LAYERS_SELECTION } from './const';
|
|
2
|
-
import type { LayerData, OperationalPoints, Store } from '../types';
|
|
2
|
+
import type { EtcsLayersDisplay, LayerData, OperationalPoints, Store } from '../types';
|
|
3
3
|
type SlopesValues = {
|
|
4
4
|
minGradient: number;
|
|
5
5
|
maxGradient: number;
|
|
@@ -58,7 +58,7 @@ export declare const drawSeparatorLinearLayer: (ctx: CanvasRenderingContext2D, s
|
|
|
58
58
|
*/
|
|
59
59
|
export declare const drawLinearLayerBackground: (ctx: CanvasRenderingContext2D, backgroundColor: string, margins: typeof MARGINS, width: number, startingHeight: number, layerHeight: number) => void;
|
|
60
60
|
/**
|
|
61
|
-
* Return
|
|
61
|
+
* Return whether a layer should be active or not.
|
|
62
62
|
* Depending on the available data, some layers should be disabled.
|
|
63
63
|
*/
|
|
64
64
|
export declare const isLayerActive: (store: Store, selection: (typeof LAYERS_SELECTION)[number]) => true | {
|
|
@@ -67,7 +67,7 @@ export declare const isLayerActive: (store: Store, selection: (typeof LAYERS_SEL
|
|
|
67
67
|
speed: number;
|
|
68
68
|
isTemporary: boolean;
|
|
69
69
|
}[];
|
|
70
|
-
} | LayerData<import("
|
|
70
|
+
} | LayerData<import("..").ElectricalProfileValues>[] | LayerData<import("..").PowerRestrictionValues>[] | LayerData<import("..").SpeedLimitTagValues>[] | undefined;
|
|
71
71
|
/**
|
|
72
72
|
* Given a store including a list of slopes, return the position and value of min and max slopes
|
|
73
73
|
* @param store
|
|
@@ -105,4 +105,8 @@ export declare const getCursorPosition: (cursorX: number, width: number, store:
|
|
|
105
105
|
* If the cursor is not close enough to a stop, return null.
|
|
106
106
|
*/
|
|
107
107
|
export declare const getSnappedStop: (cursorX: number, width: number, store: Store) => LayerData<OperationalPoints> | null;
|
|
108
|
+
/** Retrieve list of active EtcsBrakingTypes. */
|
|
109
|
+
export declare const getActiveEtcsBrakingTypes: (layers: EtcsLayersDisplay) => import("..").EtcsBrakingType[];
|
|
110
|
+
/** Retrieve list of active EtcsBrakingCurveTypes. */
|
|
111
|
+
export declare const getActiveEtcsBrakingCurveTypes: (layers: EtcsLayersDisplay) => import("..").EtcsBrakingCurveType[];
|
|
108
112
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '@osrd-project/ui-core/dist/theme.css';
|
|
2
2
|
import './styles/main.css';
|
|
3
3
|
export { default as SpeedSpaceChart, type SpeedSpaceChartProps, } from './components/SpeedSpaceChart';
|
|
4
|
-
export type { LayerData, PowerRestrictionValues, ElectricalProfileValues, ElectrificationValues, SpeedLimitTagValues, Data as SpeedSpaceChartData, } from './types';
|
|
4
|
+
export type { LayerData, PowerRestrictionValues, ElectricalProfileValues, ElectrificationValues, SpeedLimitTagValues, Data as SpeedSpaceChartData, EtcsBrakingCurve, EtcsBrakingCurves, } from './types';
|
|
5
|
+
export { EtcsBrakingCurveType, EtcsBrakingType } from './types';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type chroma from 'chroma-js';
|
|
1
2
|
export type ElectricalProfileValues = {
|
|
2
3
|
electricalProfile: string;
|
|
3
4
|
color?: string;
|
|
@@ -39,6 +40,7 @@ type SpeedLimit = {
|
|
|
39
40
|
export type Data = {
|
|
40
41
|
speeds: LayerData<number>[];
|
|
41
42
|
ecoSpeeds: LayerData<number>[];
|
|
43
|
+
etcsBrakingCurves?: EtcsBrakingCurves;
|
|
42
44
|
stops: LayerData<OperationalPoints>[];
|
|
43
45
|
electrifications: LayerData<ElectrificationValues>[];
|
|
44
46
|
slopes: LayerData<number>[];
|
|
@@ -59,6 +61,7 @@ export type Store = Data & {
|
|
|
59
61
|
energySource: boolean;
|
|
60
62
|
tractionStatus: boolean;
|
|
61
63
|
declivities: boolean;
|
|
64
|
+
etcs: boolean;
|
|
62
65
|
electricalProfiles: boolean;
|
|
63
66
|
powerRestrictions: boolean;
|
|
64
67
|
};
|
|
@@ -70,6 +73,7 @@ export type Store = Data & {
|
|
|
70
73
|
powerRestrictions: boolean;
|
|
71
74
|
speedLimitTags: boolean;
|
|
72
75
|
};
|
|
76
|
+
etcsLayersDisplay: EtcsLayersDisplay;
|
|
73
77
|
isSettingsPanelOpened: boolean;
|
|
74
78
|
};
|
|
75
79
|
export type DrawFunctionParams = {
|
|
@@ -97,6 +101,7 @@ export type TrainDetails = {
|
|
|
97
101
|
curveY: number;
|
|
98
102
|
speedText: string;
|
|
99
103
|
ecoSpeedText: string;
|
|
104
|
+
etcsSpeedValues?: Record<EtcsBrakingType, Record<EtcsBrakingCurveType, EtcsSpeedValue[]>>;
|
|
100
105
|
effortText: string;
|
|
101
106
|
electricalModeText: string;
|
|
102
107
|
electricalProfileText: string;
|
|
@@ -112,4 +117,39 @@ export type tooltipInfos = {
|
|
|
112
117
|
export type ColorDictionary = {
|
|
113
118
|
[key: string]: string;
|
|
114
119
|
};
|
|
120
|
+
export type EtcsBrakingCurve = {
|
|
121
|
+
[key in EtcsBrakingCurveType]: LayerData<number>[];
|
|
122
|
+
};
|
|
123
|
+
export type EtcsBrakingCurves = {
|
|
124
|
+
[key in EtcsBrakingType]: EtcsBrakingCurve[];
|
|
125
|
+
};
|
|
126
|
+
export declare enum EtcsBrakingType {
|
|
127
|
+
SLOWDOWN = "transition",
|
|
128
|
+
STOP = "stop",
|
|
129
|
+
SPACING = "spacing",
|
|
130
|
+
ROUTING = "routing"
|
|
131
|
+
}
|
|
132
|
+
export declare enum EtcsBrakingCurveType {
|
|
133
|
+
IND = "IND",
|
|
134
|
+
PS = "PS",
|
|
135
|
+
GUI = "GUI"
|
|
136
|
+
}
|
|
137
|
+
export type EtcsLayersDisplay = {
|
|
138
|
+
etcsBrakingTypes: {
|
|
139
|
+
stopsAndTransitions: boolean;
|
|
140
|
+
spacing: boolean;
|
|
141
|
+
routing: boolean;
|
|
142
|
+
};
|
|
143
|
+
etcsBrakingCurveTypes: {
|
|
144
|
+
indication: boolean;
|
|
145
|
+
permittedSpeed: boolean;
|
|
146
|
+
guidance: boolean;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
export type EtcsSpeedValue = {
|
|
150
|
+
etcsSpeed: number;
|
|
151
|
+
etcsEndOfCurvePos: number;
|
|
152
|
+
};
|
|
153
|
+
export type EtcsColorDictionary = Record<EtcsBrakingCurveType, chroma.Color>;
|
|
154
|
+
export type EtcsAlphaDictionary = Record<EtcsBrakingCurveType, number>;
|
|
115
155
|
export {};
|