@osrd-project/ui-charts 0.0.83 → 0.0.85
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.d.ts +1055 -7
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7148 -0
- package/dist/index.js.map +1 -0
- package/dist/theme.css +1065 -3725
- package/package.json +17 -16
- package/dist/chronogram/components/Chronogram.d.ts +0 -3
- package/dist/chronogram/components/ChronogramCanvas.d.ts +0 -3
- package/dist/chronogram/components/ChronogramManchette.d.ts +0 -9
- package/dist/chronogram/components/OccupancyBlocksLayer.d.ts +0 -1
- package/dist/chronogram/hooks/useChronogram.d.ts +0 -35
- package/dist/chronogram/index.d.ts +0 -9
- package/dist/chronogram/lib/const.d.ts +0 -5
- package/dist/chronogram/lib/context.d.ts +0 -6
- package/dist/chronogram/lib/types.d.ts +0 -30
- package/dist/chronogram/utils/format.d.ts +0 -1
- package/dist/common/consts.d.ts +0 -5
- package/dist/common/context.d.ts +0 -2
- package/dist/common/helpers/colors.d.ts +0 -21
- package/dist/common/helpers/png.d.ts +0 -5
- package/dist/common/helpers/time.d.ts +0 -31
- package/dist/common/helpers/utils.d.ts +0 -8
- package/dist/common/hooks/useCanvas.d.ts +0 -16
- package/dist/common/hooks/useDevicePixelRatio.d.ts +0 -1
- package/dist/common/hooks/useMouseInteractions.d.ts +0 -41
- package/dist/common/hooks/useMouseTracking.d.ts +0 -6
- package/dist/common/hooks/useSize.d.ts +0 -7
- package/dist/common/index.d.ts +0 -5
- package/dist/common/layers/TimeCaptions.d.ts +0 -1
- package/dist/common/layers/TimeGraduations.d.ts +0 -2
- package/dist/common/types.d.ts +0 -104
- package/dist/index.esm.js +0 -6391
- package/dist/index.esm.js.map +0 -1
- package/dist/manchette/assets/sampleData.d.ts +0 -2
- package/dist/manchette/components/Manchette.d.ts +0 -23
- package/dist/manchette/components/ManchetteWithSpaceTimeChart.d.ts +0 -23
- package/dist/manchette/components/Waypoint.d.ts +0 -14
- package/dist/manchette/consts.d.ts +0 -15
- package/dist/manchette/hooks/useManchetteWithSpaceTimeChart.d.ts +0 -49
- package/dist/manchette/hooks/useSyncManchette.d.ts +0 -94
- package/dist/manchette/index.d.ts +0 -11
- package/dist/manchette/types.d.ts +0 -34
- package/dist/manchette/utils/__tests__/helpers.spec.d.ts +0 -1
- package/dist/manchette/utils/helpers.d.ts +0 -44
- package/dist/manchette/utils/index.d.ts +0 -13
- package/dist/spaceTimeChart/__tests__/canvas.spec.d.ts +0 -1
- package/dist/spaceTimeChart/__tests__/geometry.spec.d.ts +0 -1
- package/dist/spaceTimeChart/__tests__/paths.spec.d.ts +0 -1
- package/dist/spaceTimeChart/__tests__/scales.spec.d.ts +0 -1
- package/dist/spaceTimeChart/__tests__/snapping.spec.d.ts +0 -1
- package/dist/spaceTimeChart/components/ConflictLayer.d.ts +0 -16
- package/dist/spaceTimeChart/components/ConflictTooltip.d.ts +0 -13
- package/dist/spaceTimeChart/components/OccupancyBlockLayer.d.ts +0 -12
- package/dist/spaceTimeChart/components/PathLayer.d.ts +0 -37
- package/dist/spaceTimeChart/components/PatternRect.d.ts +0 -8
- package/dist/spaceTimeChart/components/Quadrilateral.d.ts +0 -26
- package/dist/spaceTimeChart/components/SpaceGraduations.d.ts +0 -2
- package/dist/spaceTimeChart/components/SpaceTimeChart.d.ts +0 -3
- package/dist/spaceTimeChart/components/Tooltip.d.ts +0 -7
- package/dist/spaceTimeChart/components/WorkScheduleLayer.d.ts +0 -19
- package/dist/spaceTimeChart/components/ZoomRect.d.ts +0 -2
- package/dist/spaceTimeChart/config.d.ts +0 -4
- package/dist/spaceTimeChart/index.d.ts +0 -17
- package/dist/spaceTimeChart/lib/consts.d.ts +0 -17
- package/dist/spaceTimeChart/lib/context.d.ts +0 -13
- package/dist/spaceTimeChart/lib/theme.d.ts +0 -2
- package/dist/spaceTimeChart/lib/types.d.ts +0 -129
- package/dist/spaceTimeChart/utils/__tests__/canvas.spec.d.ts +0 -1
- package/dist/spaceTimeChart/utils/__tests__/scales.spec.d.ts +0 -1
- package/dist/spaceTimeChart/utils/canvas.d.ts +0 -43
- package/dist/spaceTimeChart/utils/events.d.ts +0 -12
- package/dist/spaceTimeChart/utils/geometry.d.ts +0 -13
- package/dist/spaceTimeChart/utils/paths.d.ts +0 -16
- package/dist/spaceTimeChart/utils/scales.d.ts +0 -73
- package/dist/spaceTimeChart/utils/snapping.d.ts +0 -10
- package/dist/spaceTimeChart/utils/vectors.d.ts +0 -2
- package/dist/speedSpaceChart/__tests__/utils.spec.d.ts +0 -1
- package/dist/speedSpaceChart/components/SpeedSpaceChart.d.ts +0 -50
- package/dist/speedSpaceChart/components/common/DetailsBox.d.ts +0 -22
- package/dist/speedSpaceChart/components/common/InteractionButtons.d.ts +0 -10
- package/dist/speedSpaceChart/components/common/SettingsPanel.d.ts +0 -15
- package/dist/speedSpaceChart/components/common/Tooltip.d.ts +0 -9
- package/dist/speedSpaceChart/components/const.d.ts +0 -74
- package/dist/speedSpaceChart/components/helpers/drawElements/axisY.d.ts +0 -2
- package/dist/speedSpaceChart/components/helpers/drawElements/curve.d.ts +0 -2
- package/dist/speedSpaceChart/components/helpers/drawElements/declivity.d.ts +0 -2
- package/dist/speedSpaceChart/components/helpers/drawElements/electricalProfile.d.ts +0 -2
- package/dist/speedSpaceChart/components/helpers/drawElements/powerRestrictions.d.ts +0 -2
- package/dist/speedSpaceChart/components/helpers/drawElements/reticle.d.ts +0 -14
- package/dist/speedSpaceChart/components/helpers/drawElements/speedLimitTags.d.ts +0 -3
- package/dist/speedSpaceChart/components/helpers/drawElements/speedLimits.d.ts +0 -2
- package/dist/speedSpaceChart/components/helpers/drawElements/steps.d.ts +0 -2
- package/dist/speedSpaceChart/components/helpers/drawElements/tickX.d.ts +0 -2
- package/dist/speedSpaceChart/components/helpers/drawElements/tickYRight.d.ts +0 -2
- package/dist/speedSpaceChart/components/helpers/frontFrame.d.ts +0 -2
- package/dist/speedSpaceChart/components/helpers/layersManager.d.ts +0 -5
- package/dist/speedSpaceChart/components/hooks.d.ts +0 -11
- package/dist/speedSpaceChart/components/layers/CurveLayer.d.ts +0 -9
- package/dist/speedSpaceChart/components/layers/DeclivityLayer.d.ts +0 -9
- package/dist/speedSpaceChart/components/layers/ElectricalProfileLayer.d.ts +0 -9
- package/dist/speedSpaceChart/components/layers/FrontInteractivityLayer.d.ts +0 -10
- package/dist/speedSpaceChart/components/layers/PowerRestrictionsLayer.d.ts +0 -9
- package/dist/speedSpaceChart/components/layers/ReticleLayer.d.ts +0 -11
- package/dist/speedSpaceChart/components/layers/SpeedLimitTagsLayer.d.ts +0 -9
- package/dist/speedSpaceChart/components/layers/SpeedLimitsLayer.d.ts +0 -9
- package/dist/speedSpaceChart/components/layers/StepsLayer.d.ts +0 -9
- package/dist/speedSpaceChart/components/layers/TickLayerX.d.ts +0 -9
- package/dist/speedSpaceChart/components/layers/TickLayerY.d.ts +0 -9
- package/dist/speedSpaceChart/components/layers/TickLayerYRight.d.ts +0 -9
- package/dist/speedSpaceChart/components/layers/index.d.ts +0 -12
- package/dist/speedSpaceChart/components/utils.d.ts +0 -112
- package/dist/speedSpaceChart/index.d.ts +0 -5
- package/dist/speedSpaceChart/types.d.ts +0 -155
- package/dist/theme.css.map +0 -1
- package/dist/trackOccupancyDiagram/__tests__/utils.spec.d.ts +0 -1
- package/dist/trackOccupancyDiagram/components/TrackOccupancyCanvas.d.ts +0 -12
- package/dist/trackOccupancyDiagram/components/TrackOccupancyManchette.d.ts +0 -6
- package/dist/trackOccupancyDiagram/components/TrackOccupancyStandalone.d.ts +0 -10
- package/dist/trackOccupancyDiagram/components/helpers/drawElements/drawOccupancyZones.d.ts +0 -20
- package/dist/trackOccupancyDiagram/components/helpers/drawElements/drawOccupancyZonesTexts.d.ts +0 -10
- package/dist/trackOccupancyDiagram/components/helpers/drawElements/drawTrack.d.ts +0 -11
- package/dist/trackOccupancyDiagram/components/helpers/drawElements/drawTracks.d.ts +0 -8
- package/dist/trackOccupancyDiagram/components/layers/OccupancyZonesLayer.d.ts +0 -11
- package/dist/trackOccupancyDiagram/components/layers/TracksLayer.d.ts +0 -8
- package/dist/trackOccupancyDiagram/components/utils.d.ts +0 -24
- package/dist/trackOccupancyDiagram/index.d.ts +0 -7
- package/dist/trackOccupancyDiagram/lib/consts.d.ts +0 -32
- package/dist/trackOccupancyDiagram/lib/types.d.ts +0 -26
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Store } from '../../types';
|
|
3
|
-
import type { SpeedSpaceChartProps } from '../SpeedSpaceChart';
|
|
4
|
-
type ReticleLayerProps = {
|
|
5
|
-
width: number;
|
|
6
|
-
internalHeight: number;
|
|
7
|
-
store: Store;
|
|
8
|
-
translations?: SpeedSpaceChartProps['translations'];
|
|
9
|
-
};
|
|
10
|
-
declare const ReticleLayer: ({ width, internalHeight: height, store, translations, }: ReticleLayerProps) => React.JSX.Element;
|
|
11
|
-
export default ReticleLayer;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Store } from '../../types';
|
|
3
|
-
type SpeedLimitTagsLayerProps = {
|
|
4
|
-
width: number;
|
|
5
|
-
marginTop: number;
|
|
6
|
-
store: Store;
|
|
7
|
-
};
|
|
8
|
-
declare const SpeedLimitTagsLayer: ({ width, marginTop, store }: SpeedLimitTagsLayerProps) => React.JSX.Element;
|
|
9
|
-
export default SpeedLimitTagsLayer;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Store } from '../../types';
|
|
3
|
-
type SpeedLimitsLayerProps = {
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
store: Store;
|
|
7
|
-
};
|
|
8
|
-
declare const SpeedLimitsLayer: ({ width, height, store }: SpeedLimitsLayerProps) => React.JSX.Element;
|
|
9
|
-
export default SpeedLimitsLayer;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Store } from '../../types';
|
|
3
|
-
type StepsLayerProps = {
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
store: Store;
|
|
7
|
-
};
|
|
8
|
-
declare const StepsLayer: ({ width, height, store }: StepsLayerProps) => React.JSX.Element;
|
|
9
|
-
export default StepsLayer;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Store } from '../../types';
|
|
3
|
-
type TickLayerXProps = {
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
store: Store;
|
|
7
|
-
};
|
|
8
|
-
declare const TickLayerX: ({ width, height, store }: TickLayerXProps) => React.JSX.Element;
|
|
9
|
-
export default TickLayerX;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Store } from '../../types';
|
|
3
|
-
type TickLayerYProps = {
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
store: Store;
|
|
7
|
-
};
|
|
8
|
-
declare const AxisLayerY: ({ width, height, store }: TickLayerYProps) => React.JSX.Element;
|
|
9
|
-
export default AxisLayerY;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Store } from '../../types';
|
|
3
|
-
type TickLayerYRightProps = {
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
store: Store;
|
|
7
|
-
};
|
|
8
|
-
declare const TickLayerYRight: ({ width, height, store }: TickLayerYRightProps) => React.JSX.Element;
|
|
9
|
-
export default TickLayerYRight;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { default as StepsLayer } from './StepsLayer';
|
|
2
|
-
export { default as SpeedLimitsLayer } from './SpeedLimitsLayer';
|
|
3
|
-
export { default as CurveLayer } from './CurveLayer';
|
|
4
|
-
export { default as DeclivityLayer } from './DeclivityLayer';
|
|
5
|
-
export { default as ElectricalProfileLayer } from './ElectricalProfileLayer';
|
|
6
|
-
export { default as FrontInteractivityLayer } from './FrontInteractivityLayer';
|
|
7
|
-
export { default as PowerRestrictionsLayer } from './PowerRestrictionsLayer';
|
|
8
|
-
export { default as ReticleLayer } from './ReticleLayer';
|
|
9
|
-
export { default as SpeedLimitTagsLayer } from './SpeedLimitTagsLayer';
|
|
10
|
-
export { default as TickLayerX } from './TickLayerX';
|
|
11
|
-
export { default as AxisLayerY } from './TickLayerY';
|
|
12
|
-
export { default as TickLayerYRight } from './TickLayerYRight';
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import type { EtcsLayersDisplay, LayerData, OperationalPoints, Store } from '../types';
|
|
2
|
-
import { MARGINS, type LAYERS_SELECTION } from './const';
|
|
3
|
-
type SlopesValues = {
|
|
4
|
-
minGradient: number;
|
|
5
|
-
maxGradient: number;
|
|
6
|
-
slopesRange: number;
|
|
7
|
-
maxPosition: number;
|
|
8
|
-
};
|
|
9
|
-
export type VisibilityFilterOptions<T> = {
|
|
10
|
-
elements: T[];
|
|
11
|
-
getPosition: (element: T) => number;
|
|
12
|
-
getWeight: (element: T) => number | undefined;
|
|
13
|
-
minSpace: number;
|
|
14
|
-
};
|
|
15
|
-
export declare const getGraphOffsets: (width: number, height: number, declivities?: boolean) => {
|
|
16
|
-
WIDTH_OFFSET: number;
|
|
17
|
-
HEIGHT_OFFSET: number;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Given the store, return the max speed value.
|
|
21
|
-
* Can be either the max speed value from the MRSP or the max speed value from the speeds,
|
|
22
|
-
* depending on the layers displayed.
|
|
23
|
-
* @param store
|
|
24
|
-
*/
|
|
25
|
-
export declare const maxSpeedValue: (store: Store) => number;
|
|
26
|
-
/**
|
|
27
|
-
* Given a list of speed data return the max position
|
|
28
|
-
* @param speeds
|
|
29
|
-
*/
|
|
30
|
-
export declare const maxPositionValue: (speeds: LayerData<number>[]) => number;
|
|
31
|
-
export declare const clearCanvas: (ctx: CanvasRenderingContext2D, width: number, height: number) => void;
|
|
32
|
-
export declare const getLinearLayersDisplayedHeight: (layersDisplay: Store["layersDisplay"]) => number;
|
|
33
|
-
/**
|
|
34
|
-
* Calculates the position on the graph scale based on the given parameters.
|
|
35
|
-
* @param position - The current position.
|
|
36
|
-
* @param maxPosition - The maximum position.
|
|
37
|
-
* @param width - The width of the graph.
|
|
38
|
-
* @param ratioX - The X-axis ratio.
|
|
39
|
-
* @param margins - The margins of the graph.
|
|
40
|
-
* @returns The calculated position on the graph scale.
|
|
41
|
-
*/
|
|
42
|
-
export declare const positionOnGraphScale: (position: number, maxPosition: number, width: number, ratioX: number, margins: typeof MARGINS) => number;
|
|
43
|
-
/**
|
|
44
|
-
* Draws a separator line on a canvas context.
|
|
45
|
-
*
|
|
46
|
-
* @param ctx - The canvas rendering context.
|
|
47
|
-
* @param separatorColor - The color of the separator line.
|
|
48
|
-
* @param margins - The margins of the canvas.
|
|
49
|
-
* @param width - The width of the canvas.
|
|
50
|
-
* @param height - The height of the canvas.
|
|
51
|
-
*/
|
|
52
|
-
export declare const drawSeparatorLinearLayer: (ctx: CanvasRenderingContext2D, separatorColor: string, margins: typeof MARGINS, width: number, height: number) => void;
|
|
53
|
-
/**
|
|
54
|
-
* Draw the background for linear layers. Depending on the layer and how many are displayed, the background color
|
|
55
|
-
* will change.
|
|
56
|
-
* @param backgroundColor depends on the linear layer. Electrical profile is always first, power restrictions
|
|
57
|
-
* can be first or second, speedlimit tags can be on any position.
|
|
58
|
-
*/
|
|
59
|
-
export declare const drawLinearLayerBackground: (ctx: CanvasRenderingContext2D, backgroundColor: string, margins: typeof MARGINS, width: number, startingHeight: number, layerHeight: number) => void;
|
|
60
|
-
/**
|
|
61
|
-
* Return whether a layer should be active or not.
|
|
62
|
-
* Depending on the available data, some layers should be disabled.
|
|
63
|
-
*/
|
|
64
|
-
export declare const isLayerActive: (store: Store, selection: (typeof LAYERS_SELECTION)[number]) => true | {
|
|
65
|
-
boundaries: number[];
|
|
66
|
-
values: {
|
|
67
|
-
speed: number;
|
|
68
|
-
isTemporary: boolean;
|
|
69
|
-
}[];
|
|
70
|
-
} | LayerData<import("..").ElectricalProfileValues>[] | LayerData<import("..").PowerRestrictionValues>[] | LayerData<import("..").SpeedLimitTagValues>[] | undefined;
|
|
71
|
-
/**
|
|
72
|
-
* Given a store including a list of slopes, return the position and value of min and max slopes
|
|
73
|
-
* @param store
|
|
74
|
-
*/
|
|
75
|
-
export declare const slopesValues: (store: Store) => SlopesValues;
|
|
76
|
-
export declare const drawSvgImageWithColor: (ctx: CanvasRenderingContext2D, image: HTMLImageElement, x: number, y: number, width: number, height: number, color: string) => void;
|
|
77
|
-
export declare const drawRoundedRect: (ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: number) => void;
|
|
78
|
-
export declare const loadSvgImage: (svgUrl: string) => Promise<HTMLImageElement>;
|
|
79
|
-
export declare const createSvgBlobUrl: (svgString: string) => string;
|
|
80
|
-
/** Retrieve the index of an element in the list.
|
|
81
|
-
* If the element is not found, return the predecessor.
|
|
82
|
-
* If the element is smaller than the first element, return 0.
|
|
83
|
-
* If the element is greater than the last element, return the last index.
|
|
84
|
-
* If the list is empty, return -1.
|
|
85
|
-
* @param data - The **sorted** data array.
|
|
86
|
-
* @param element - The element to search
|
|
87
|
-
* @param lambda - The function to extract the value from the data list.
|
|
88
|
-
*/
|
|
89
|
-
export declare const binarySearch: <T>(data: T[], element: number, lambda: (element: T) => number) => number;
|
|
90
|
-
/** Convert meters to kilometers */
|
|
91
|
-
export declare const convertMToKm: (meters: number) => number;
|
|
92
|
-
/** Transform a position in km into a position on the x-axis in pixels */
|
|
93
|
-
export declare const positionToPosX: (position: number, maxPosition: number, width: number, ratioX: number, leftOffset?: number) => number;
|
|
94
|
-
/** Interpole on a straight line given two points and the x-axis value */
|
|
95
|
-
export declare const interpolate: (x1: number, y1: number, x2: number, y2: number, x: number) => number;
|
|
96
|
-
/** Clamps the given value between the given minimum number and maximum number values */
|
|
97
|
-
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
98
|
-
export declare const filterVisibleElements: <T>({ elements, getPosition, getWeight, minSpace, }: VisibilityFilterOptions<T>) => T[];
|
|
99
|
-
/** Filter stops to avoid overlapping, showing the most important stops first */
|
|
100
|
-
export declare const getDisplayedStops: (stops: LayerData<OperationalPoints>[], ratioX: number, width: number, maxPosition: number, minSpace?: number) => LayerData<OperationalPoints>[];
|
|
101
|
-
/** Compute the cursor position on the x-axis given its position on the canva */
|
|
102
|
-
export declare const getCursorPosition: (cursorX: number, width: number, store: Store) => number;
|
|
103
|
-
/**
|
|
104
|
-
* Retrieve the snapped stop given the cursor position.
|
|
105
|
-
* If the cursor is not close enough to a stop, return null.
|
|
106
|
-
*/
|
|
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[];
|
|
112
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import '@osrd-project/ui-core/dist/theme.css';
|
|
2
|
-
import './styles/main.css';
|
|
3
|
-
export { default as SpeedSpaceChart, type SpeedSpaceChartProps, } from './components/SpeedSpaceChart';
|
|
4
|
-
export type { LayerData, PowerRestrictionValues, ElectricalProfileValues, ElectrificationValues, SpeedLimitTagValues, Data as SpeedSpaceChartData, EtcsBrakingCurve, EtcsBrakingCurves, } from './types';
|
|
5
|
-
export { EtcsBrakingCurveType, EtcsBrakingType } from './types';
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import type chroma from 'chroma-js';
|
|
2
|
-
export type ElectricalProfileValues = {
|
|
3
|
-
electricalProfile: string;
|
|
4
|
-
color?: string;
|
|
5
|
-
heightLevel?: number;
|
|
6
|
-
handled?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export type PowerRestrictionValues = {
|
|
9
|
-
powerRestriction: string;
|
|
10
|
-
handled: boolean;
|
|
11
|
-
};
|
|
12
|
-
export type SpeedLimitTagValues = {
|
|
13
|
-
tag: string;
|
|
14
|
-
color: string;
|
|
15
|
-
};
|
|
16
|
-
export type ElectrificationValues = {
|
|
17
|
-
type: 'electrification' | 'neutral_section' | 'non_electrified';
|
|
18
|
-
voltage?: '1500V' | '25000V';
|
|
19
|
-
lowerPantograph?: boolean;
|
|
20
|
-
};
|
|
21
|
-
export type LayerData<T> = {
|
|
22
|
-
position: {
|
|
23
|
-
start: number;
|
|
24
|
-
end?: number;
|
|
25
|
-
};
|
|
26
|
-
value: T;
|
|
27
|
-
};
|
|
28
|
-
export type OperationalPoints = {
|
|
29
|
-
name: string;
|
|
30
|
-
weight?: number;
|
|
31
|
-
};
|
|
32
|
-
type ValuesAlongPath<T> = {
|
|
33
|
-
boundaries: number[];
|
|
34
|
-
values: T[];
|
|
35
|
-
};
|
|
36
|
-
type SpeedLimit = {
|
|
37
|
-
speed: number;
|
|
38
|
-
isTemporary: boolean;
|
|
39
|
-
};
|
|
40
|
-
export type Data = {
|
|
41
|
-
speeds: LayerData<number>[];
|
|
42
|
-
ecoSpeeds: LayerData<number>[];
|
|
43
|
-
etcsBrakingCurves?: EtcsBrakingCurves;
|
|
44
|
-
stops: LayerData<OperationalPoints>[];
|
|
45
|
-
electrifications: LayerData<ElectrificationValues>[];
|
|
46
|
-
slopes: LayerData<number>[];
|
|
47
|
-
mrsp?: ValuesAlongPath<SpeedLimit>;
|
|
48
|
-
electricalProfiles?: LayerData<ElectricalProfileValues>[];
|
|
49
|
-
powerRestrictions?: LayerData<PowerRestrictionValues>[];
|
|
50
|
-
speedLimitTags?: LayerData<SpeedLimitTagValues>[];
|
|
51
|
-
trainLength: number;
|
|
52
|
-
};
|
|
53
|
-
export type Store = Data & {
|
|
54
|
-
ratioX: number;
|
|
55
|
-
leftOffset: number;
|
|
56
|
-
cursor: {
|
|
57
|
-
x: number | null;
|
|
58
|
-
y: number | null;
|
|
59
|
-
};
|
|
60
|
-
detailsBoxDisplay: {
|
|
61
|
-
energySource: boolean;
|
|
62
|
-
tractionStatus: boolean;
|
|
63
|
-
declivities: boolean;
|
|
64
|
-
etcs: boolean;
|
|
65
|
-
electricalProfiles: boolean;
|
|
66
|
-
powerRestrictions: boolean;
|
|
67
|
-
};
|
|
68
|
-
layersDisplay: {
|
|
69
|
-
steps: boolean;
|
|
70
|
-
declivities: boolean;
|
|
71
|
-
speedLimits: boolean;
|
|
72
|
-
electricalProfiles: boolean;
|
|
73
|
-
powerRestrictions: boolean;
|
|
74
|
-
speedLimitTags: boolean;
|
|
75
|
-
};
|
|
76
|
-
etcsLayersDisplay: EtcsLayersDisplay;
|
|
77
|
-
isSettingsPanelOpened: boolean;
|
|
78
|
-
};
|
|
79
|
-
export type DrawFunctionParams = {
|
|
80
|
-
ctx: CanvasRenderingContext2D;
|
|
81
|
-
width: number;
|
|
82
|
-
height: number;
|
|
83
|
-
store: Store;
|
|
84
|
-
setStore?: React.Dispatch<React.SetStateAction<Store>>;
|
|
85
|
-
};
|
|
86
|
-
export type SpeedLimitTagsLayerDrawingStore = Pick<Store, 'speedLimitTags' | 'ratioX' | 'leftOffset' | 'speeds'> & {
|
|
87
|
-
layersDisplay: Pick<Store['layersDisplay'], 'electricalProfiles' | 'powerRestrictions'>;
|
|
88
|
-
};
|
|
89
|
-
export type SpeedLimitTagsLayerDrawFunctionParams = {
|
|
90
|
-
ctx: CanvasRenderingContext2D;
|
|
91
|
-
width: number;
|
|
92
|
-
height: number;
|
|
93
|
-
store: SpeedLimitTagsLayerDrawingStore;
|
|
94
|
-
images: {
|
|
95
|
-
questionImage: HTMLImageElement | null;
|
|
96
|
-
alertFillImage: HTMLImageElement | null;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
export type TrainDetails = {
|
|
100
|
-
curveX: number;
|
|
101
|
-
curveY: number;
|
|
102
|
-
speedText: string;
|
|
103
|
-
ecoSpeedText: string;
|
|
104
|
-
etcsSpeedValues?: Record<EtcsBrakingType, Record<EtcsBrakingCurveType, EtcsSpeedValue[]>>;
|
|
105
|
-
effortText: string;
|
|
106
|
-
electricalModeText: string;
|
|
107
|
-
electricalProfileText: string;
|
|
108
|
-
powerRestrictionText: string;
|
|
109
|
-
previousGradientText: number;
|
|
110
|
-
modeText: string;
|
|
111
|
-
};
|
|
112
|
-
export type tooltipInfos = {
|
|
113
|
-
cursorX: number;
|
|
114
|
-
cursorY: number;
|
|
115
|
-
text: string;
|
|
116
|
-
};
|
|
117
|
-
export type ColorDictionary = {
|
|
118
|
-
[key: string]: string;
|
|
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>;
|
|
155
|
-
export {};
|