@osrd-project/ui-charts 0.0.69 → 0.0.71

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.
Files changed (41) hide show
  1. package/dist/index.esm.js +1 -1
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/manchette/components/ManchetteWithSpaceTimeChart.d.ts +1 -2
  4. package/dist/manchette/consts.d.ts +1 -0
  5. package/dist/manchette/hooks/useManchetteWithSpaceTimeChart.d.ts +31 -15
  6. package/dist/manchette/hooks/usePaths.d.ts +2 -4
  7. package/dist/manchette/types.d.ts +1 -1
  8. package/dist/manchette/utils/helpers.d.ts +24 -9
  9. package/dist/spaceTimeChart/components/TimeCaptions.d.ts +1 -3
  10. package/dist/spaceTimeChart/components/WorkScheduleLayer.d.ts +6 -1
  11. package/dist/spaceTimeChart/index.d.ts +8 -1
  12. package/dist/spaceTimeChart/lib/consts.d.ts +3 -3
  13. package/dist/spaceTimeChart/lib/types.d.ts +16 -8
  14. package/dist/spaceTimeChart/utils/canvas.d.ts +23 -12
  15. package/dist/spaceTimeChart/utils/scales.d.ts +1 -1
  16. package/dist/speedSpaceChart/components/utils.d.ts +1 -12
  17. package/dist/speedSpaceChart/index.d.ts +1 -1
  18. package/dist/speedSpaceChart/types.d.ts +4 -4
  19. package/dist/theme.css +0 -108
  20. package/dist/theme.css.map +1 -1
  21. package/package.json +4 -4
  22. package/dist/spaceTimeChart/stories/additional-data.stories.d.ts +0 -20
  23. package/dist/spaceTimeChart/stories/base-rendering.stories.d.ts +0 -28
  24. package/dist/spaceTimeChart/stories/custom-styles.stories.d.ts +0 -24
  25. package/dist/spaceTimeChart/stories/horizontal-zoom.stories.d.ts +0 -31
  26. package/dist/spaceTimeChart/stories/layers.stories.d.ts +0 -9
  27. package/dist/spaceTimeChart/stories/lib/components.d.ts +0 -15
  28. package/dist/spaceTimeChart/stories/lib/paths.d.ts +0 -16
  29. package/dist/spaceTimeChart/stories/lib/utils.d.ts +0 -22
  30. package/dist/spaceTimeChart/stories/measuring.stories.d.ts +0 -20
  31. package/dist/spaceTimeChart/stories/options.stories.d.ts +0 -27
  32. package/dist/spaceTimeChart/stories/paths-interactions.stories.d.ts +0 -24
  33. package/dist/spaceTimeChart/stories/performances.stories.d.ts +0 -25
  34. package/dist/spaceTimeChart/stories/quadrilateral.stories.d.ts +0 -28
  35. package/dist/spaceTimeChart/stories/rectangle-zoom.stories.d.ts +0 -40
  36. package/dist/spaceTimeChart/stories/scroll-navigation.stories.d.ts +0 -19
  37. package/dist/spaceTimeChart/stories/split.stories.d.ts +0 -21
  38. package/dist/spaceTimeChart/stories/stage-interactions.stories.d.ts +0 -25
  39. package/dist/spaceTimeChart/stories/tooltip.stories.d.ts +0 -9
  40. package/dist/spaceTimeChart/stories/work-schedules.stories.d.ts +0 -31
  41. package/dist/spaceTimeChart/types.d.ts +0 -6
@@ -5,7 +5,6 @@ import { type ProjectPathTrainResult, type Waypoint } from '../types';
5
5
  export type ManchetteWithSpaceTimeChartProps = {
6
6
  waypoints: Waypoint[];
7
7
  projectPathTrainResult: ProjectPathTrainResult[];
8
- selectedTrain?: number;
9
8
  height?: number;
10
9
  children?: React.ReactNode;
11
10
  header?: React.ReactNode;
@@ -18,5 +17,5 @@ export type ManchetteWithSpaceTimeChartProps = {
18
17
  * This only covers basic usage. For more advanced control over the manchette
19
18
  * and space time chart, the useManchetteWithSpaceTimeChart() hook can be used.
20
19
  */
21
- declare const ManchetteWithSpaceTimeChart: ({ waypoints, projectPathTrainResult, selectedTrain, height, children, header, manchetteProps: additionalManchetteProps, spaceTimeChartProps: additionalSpaceTimeChartProps, }: ManchetteWithSpaceTimeChartProps) => React.JSX.Element;
20
+ declare const ManchetteWithSpaceTimeChart: ({ waypoints, projectPathTrainResult, height, children, header, manchetteProps: additionalManchetteProps, spaceTimeChartProps: additionalSpaceTimeChartProps, }: ManchetteWithSpaceTimeChartProps) => React.JSX.Element;
22
21
  export default ManchetteWithSpaceTimeChart;
@@ -10,6 +10,7 @@ export declare const MAX_ZOOM_X = 100;
10
10
  export declare const MIN_ZOOM_Y = 1;
11
11
  export declare const MAX_ZOOM_Y = 10.5;
12
12
  export declare const ZOOM_Y_DELTA = 0.5;
13
+ export declare const MAX_ZOOM_MANCHETTE_HEIGHT_MILLIMETER = 500000;
13
14
  export declare const FOOTER_HEIGHT = 40;
14
15
  export declare const WAYPOINT_LINE_HEIGHT = 16;
15
16
  export declare const PATH_COLOR_DEFAULT = "#8A714B";
@@ -1,6 +1,14 @@
1
1
  import type { SpaceTimeChartProps } from '../../spaceTimeChart';
2
2
  import type { ProjectPathTrainResult, Waypoint } from '../types';
3
- declare const useManchettesWithSpaceTimeChart: (waypoints: Waypoint[], projectPathTrainResult: ProjectPathTrainResult[], manchetteWithSpaceTimeChartContainer: React.RefObject<HTMLDivElement>, selectedTrain?: number, height?: number, spaceTimeChartRef?: React.RefObject<HTMLDivElement>) => {
3
+ declare const useManchetteWithSpaceTimeChart: ({ waypoints, projectPathTrainResult, manchetteWithSpaceTimeChartRef, height, spaceTimeChartRef, defaultTimeOrigin, defaultSpaceOrigin, }: {
4
+ waypoints: Waypoint[];
5
+ projectPathTrainResult: ProjectPathTrainResult[];
6
+ manchetteWithSpaceTimeChartRef: React.RefObject<HTMLDivElement>;
7
+ height?: number;
8
+ spaceTimeChartRef?: React.RefObject<HTMLDivElement>;
9
+ defaultTimeOrigin?: number;
10
+ defaultSpaceOrigin?: number;
11
+ }) => {
4
12
  manchetteProps: {
5
13
  contents: import("../types").InteractiveWaypoint[];
6
14
  zoomYIn: () => void;
@@ -37,30 +45,38 @@ declare const useManchettesWithSpaceTimeChart: (waypoints: Waypoint[], projectPa
37
45
  paths: {
38
46
  id: string;
39
47
  label: string;
40
- color: string;
41
- level: import("../../spaceTimeChart").PathLevel;
42
48
  points: {
43
49
  time: number;
44
50
  position: number;
45
51
  }[];
52
+ color: string;
46
53
  }[];
47
54
  xOffset: number;
48
55
  yOffset: number;
56
+ timeOrigin: number;
57
+ spaceOrigin: number;
58
+ rect: {
59
+ timeStart: Date;
60
+ timeEnd: Date;
61
+ spaceStart: number;
62
+ spaceEnd: number;
63
+ } | null;
49
64
  onZoom: ({ delta, position }: Parameters<NonNullable<SpaceTimeChartProps["onZoom"]>>[0]) => void;
50
- onPan: (payload: {
51
- initialPosition: {
52
- x: number;
53
- y: number;
54
- };
55
- position: {
56
- x: number;
57
- y: number;
58
- };
59
- isPanning: boolean;
60
- }) => void;
65
+ onPan: (payload: Parameters<NonNullable<SpaceTimeChartProps["onPan"]>>[0]) => void;
61
66
  };
62
67
  handleScroll: () => void;
63
68
  handleXZoom: (newXZoom: number, xPosition?: number) => void;
64
69
  xZoom: number;
70
+ toggleZoomMode: () => void;
71
+ zoomMode: boolean;
72
+ rect: {
73
+ timeStart: Date;
74
+ timeEnd: Date;
75
+ spaceStart: number;
76
+ spaceEnd: number;
77
+ } | null;
78
+ timeScale: number;
79
+ spaceScale: number;
80
+ setTimeOrigin: (newTimeOrigin: number) => void;
65
81
  };
66
- export default useManchettesWithSpaceTimeChart;
82
+ export default useManchetteWithSpaceTimeChart;
@@ -1,13 +1,11 @@
1
- import { type PathLevel } from '../../spaceTimeChart';
2
1
  import { type ProjectPathTrainResult } from '../types';
3
- declare const usePaths: (projectPathTrainResult: ProjectPathTrainResult[], selectedTrain?: number) => {
2
+ declare const usePaths: (projectPathTrainResult: ProjectPathTrainResult[]) => {
4
3
  id: string;
5
4
  label: string;
6
- color: string;
7
- level: PathLevel;
8
5
  points: {
9
6
  time: number;
10
7
  position: number;
11
8
  }[];
9
+ color: string;
12
10
  }[];
13
11
  export default usePaths;
@@ -16,7 +16,7 @@ export type WaypointMenuData = {
16
16
  manchetteWrapperRef: React.RefObject<HTMLDivElement>;
17
17
  };
18
18
  export type ProjectPathTrainResult = {
19
- id: number;
19
+ id: string;
20
20
  name: string;
21
21
  spaceTimeCurves: {
22
22
  positions: number[];
@@ -1,12 +1,34 @@
1
1
  import type { InteractiveWaypoint, Waypoint } from '../types';
2
+ export declare const zoomValueToTimeScale: (slider: number) => number;
3
+ export declare const timeScaleToZoomValue: (timeScale: number) => number;
4
+ /**
5
+ * min zoom is computed with manchette px height between first and last waypoint.
6
+ * max zoom just the canvas drawing height (without the x-axis scale section)
7
+ */
8
+ export declare const getExtremaScales: (drawingHeightWithoutTopPadding: number, drawingHeightWithoutBothPadding: number, pathLengthMillimeter: number) => {
9
+ minZoomMillimeterPerPx: number;
10
+ maxZoomMillimeterPerPx: number;
11
+ };
12
+ export declare const zoomValueToSpaceScale: (minZoomMillimeterPerPx: number, maxZoomMillimeterPerPx: number, slider: number) => number;
13
+ export declare const spaceScaleToZoomValue: (minZoomMillimeterPerPx: number, maxZoomMillimeterPerPx: number, spaceScale: number) => number;
14
+ /** Zoom on X axis and center on the mouse position */
15
+ export declare const zoomX: (currentZoom: number, currentOffset: number, newZoom: number, position: number) => {
16
+ xZoom: number;
17
+ xOffset: number;
18
+ };
2
19
  type WaypointsOptions = {
3
20
  isProportional: boolean;
4
21
  yZoom: number;
5
22
  height: number;
6
23
  };
7
24
  export declare const filterVisibleElements: (elements: Waypoint[], totalDistance: number, heightWithoutFinalWaypoint: number, minSpace: number) => Waypoint[];
8
- export declare const computeWaypointsToDisplay: (waypoints: Waypoint[], { height, isProportional, yZoom }: WaypointsOptions) => InteractiveWaypoint[];
9
- export declare const getScales: (waypoints: Waypoint[], { height, isProportional, yZoom }: WaypointsOptions) => {
25
+ export declare const computeWaypointsToDisplay: (waypoints: Waypoint[], { height, isProportional, yZoom }: WaypointsOptions, minZoomMillimeterPerPx: number, maxZoomMillimeterPerPx: number) => InteractiveWaypoint[];
26
+ /**
27
+ * 2 modes for space scales
28
+ * km (isProportional): { coefficient: gives a scale in meter/pixel }
29
+ * linear: { size: height in pixel } (each point distributed evenly along the height of manchette.)
30
+ */
31
+ export declare const getScales: (waypoints: Waypoint[], { isProportional, yZoom }: WaypointsOptions, minZoomMillimeterPerPx: number, maxZoomMillimeterPerPx: number) => {
10
32
  from: number;
11
33
  to: number;
12
34
  size: number;
@@ -21,11 +43,4 @@ export declare const getScales: (waypoints: Waypoint[], { height, isProportional
21
43
  from: number;
22
44
  to: number;
23
45
  })[];
24
- export declare const zoomValueToTimeScale: (slider: number) => number;
25
- export declare const timeScaleToZoomValue: (timeScale: number) => number;
26
- /** Zoom on X axis and center on the mouse position */
27
- export declare const zoomX: (currentZoom: number, currentOffset: number, newZoom: number, position: number) => {
28
- xZoom: number;
29
- xOffset: number;
30
- };
31
46
  export {};
@@ -1,3 +1 @@
1
- export declare const CAPTION_SIZE = 33;
2
- declare const TimeCaptions: () => null;
3
- export default TimeCaptions;
1
+ export declare const TimeCaptions: () => null;
@@ -1,5 +1,10 @@
1
1
  import React from 'react';
2
- import { type WorkSchedule } from '../types';
2
+ export type WorkSchedule = {
3
+ type: 'TRACK' | 'CATENARY';
4
+ timeStart: Date;
5
+ timeEnd: Date;
6
+ spaceRanges: [number, number][];
7
+ };
3
8
  type WorkScheduleLayerProps = {
4
9
  workSchedules: WorkSchedule[];
5
10
  imageUrl: string;
@@ -1,5 +1,4 @@
1
1
  import './styles/main.css';
2
- export type { HoveredItem, SpaceTimeChartProps, SpaceScale, OperationalPoint, SpaceTimeChartTheme, Point, DataPoint, SpaceTimeChartContextType, } from './lib/types';
3
2
  export * from './components/SpaceTimeChart';
4
3
  export * from './components/PathLayer';
5
4
  export * from './components/ConflictLayer';
@@ -9,3 +8,11 @@ export * from './components/OccupancyBlockLayer';
9
8
  export * from './components/WorkScheduleLayer';
10
9
  export * from './components/PatternRect';
11
10
  export * from './components/Quadrilateral';
11
+ export * from './components/ZoomRect';
12
+ export * from './components/TimeCaptions';
13
+ export { usePicking, useDraw } from './hooks/useCanvas';
14
+ export { DEFAULT_THEME } from './lib/consts';
15
+ export { CanvasContext, MouseContext, SpaceTimeChartContext } from './lib/context';
16
+ export type { HoveredItem, SpaceTimeChartProps, SpaceScale, OperationalPoint, SpaceTimeChartTheme, PathData, Point, DataPoint, SpaceTimeChartContextType, DrawingFunction, PickingDrawingFunction, PickingElement, } from './lib/types';
17
+ export { isPathOnScreen } from './utils/geometry';
18
+ export { getSpaceAtTime } from './utils/scales';
@@ -2,8 +2,9 @@ import { type SpaceTimeChartTheme } from './types';
2
2
  export declare const BLACK = "#000000";
3
3
  export declare const BLUE = "#2170B9";
4
4
  export declare const GREY_10 = "#EDEDED";
5
- export declare const GREY_30 = "#B6B2AF";
5
+ export declare const GREY_30 = "#B6B3AF";
6
6
  export declare const GREY_50 = "#797671";
7
+ export declare const WHITE = "#FFFFFF";
7
8
  export declare const WHITE_75 = "#FFFFFFC0";
8
9
  export declare const AMBIANT_A10 = "#EFF3F5";
9
10
  export declare const ERROR_30 = "#FF6868";
@@ -12,9 +13,8 @@ export declare const OCCUPANCY_FREE = "#CAEDDB";
12
13
  export declare const OCCUPANCY_SEMAPHORE = "#FFD4D8";
13
14
  export declare const OCCUPANCY_WARNING = "#FFEABF";
14
15
  export declare const FONT_SIZE = 10;
15
- export declare const FONT = "IBM Plex Sans";
16
+ export declare const FONT = "IBM Plex Sans, sans-serif";
16
17
  export declare const SECOND = 1000;
17
18
  export declare const MINUTE: number;
18
19
  export declare const HOUR: number;
19
- export declare const KILOMETER = 1000;
20
20
  export declare const DEFAULT_THEME: SpaceTimeChartTheme;
@@ -73,7 +73,7 @@ export type HoveredItem = {
73
73
  element: PickingElement;
74
74
  };
75
75
  export type DrawingFunction = (canvasContext: CanvasRenderingContext2D, stcContext: SpaceTimeChartContextType) => void;
76
- export type PickingDrawingFunction = (imageData: ImageData, stcContext: SpaceTimeChartContextType) => void;
76
+ export type PickingDrawingFunction = (imageData: ImageData, stcContext: SpaceTimeChartContextType, scalingRatio: number) => void;
77
77
  export type DrawingFunctionHandler = (arg: {
78
78
  type: 'picking';
79
79
  layer: PickingLayerType;
@@ -106,6 +106,14 @@ export type LineStyle = {
106
106
  opacity?: number;
107
107
  dashArray?: number[];
108
108
  };
109
+ export type CaptionStyle = {
110
+ color: string;
111
+ font: string;
112
+ fontWeight?: string;
113
+ fontSize?: string;
114
+ topOffset?: number;
115
+ textAlign?: CanvasTextAlign;
116
+ };
109
117
  export type SpaceTimeChartTheme = {
110
118
  background: string;
111
119
  breakpoints: number[];
@@ -116,15 +124,12 @@ export type SpaceTimeChartTheme = {
116
124
  };
117
125
  spaceGraduationsStyles: Record<number, LineStyle>;
118
126
  timeCaptionsPriorities: number[][];
119
- timeCaptionsStyles: Record<number, {
120
- color: string;
121
- font: string;
122
- fontWeight?: string;
123
- fontSize?: string;
124
- topOffset?: number;
125
- }>;
127
+ timeCaptionsStyles: Record<number, CaptionStyle>;
128
+ timeCaptionsSize: number;
126
129
  timeGraduationsPriorities: number[][];
127
130
  timeGraduationsStyles: Record<number, LineStyle>;
131
+ dateCaptionsStyle: CaptionStyle;
132
+ dateCaptionsSize: number;
128
133
  };
129
134
  export type SpaceTimeChartProps = {
130
135
  children?: ReactNode[];
@@ -139,6 +144,7 @@ export type SpaceTimeChartProps = {
139
144
  enableSnapping?: boolean;
140
145
  hideGrid?: boolean;
141
146
  hidePathsLabels?: boolean;
147
+ hideDates?: boolean;
142
148
  showTicks?: boolean;
143
149
  theme?: Partial<SpaceTimeChartTheme>;
144
150
  onPan?: Handler<{
@@ -202,8 +208,10 @@ export type SpaceTimeChartContextType = {
202
208
  tracks?: Track[];
203
209
  occupancyZones?: OccupancyZone[];
204
210
  theme: SpaceTimeChartTheme;
211
+ captionSize: number;
205
212
  enableSnapping: boolean;
206
213
  hideGrid: boolean;
207
214
  hidePathsLabels: boolean;
215
+ hideDates: boolean;
208
216
  showTicks: boolean;
209
217
  };
@@ -1,16 +1,24 @@
1
1
  import type { SpaceTimeChartContextType, Direction, PathEnd, Point, RGBAColor, RGBColor } from '../lib/types';
2
+ /**
3
+ * This function returns the picking layers scaling ratio. We basically take the min of the screen
4
+ * pixels and the "HTML pixels", and divide it by two.
5
+ *
6
+ * This allows having a smaller picking stage to fill (so it's faster), while keeping a "good enough
7
+ * precision".
8
+ */
9
+ export declare function getPickingScalingRatio(): number;
2
10
  /**
3
11
  * This function draws a thick lines from "from" to "to" on the given ImageData, with no
4
12
  * antialiasing. This is very useful to handle picking, since it is not possible to disable
5
13
  * antialiasing with the native JavaScript canvas APIs.
6
14
  */
7
- export declare function drawAliasedLine(imageData: ImageData, from: Point, to: Point, [r, g, b]: RGBColor | RGBAColor, thickness: number, drawOnBottom: boolean, number?: number): void;
15
+ export declare function drawAliasedLine(imageData: ImageData, { x: fromX, y: fromY }: Point, { x: toX, y: toY }: Point, [r, g, b]: RGBColor | RGBAColor, thickness: number, drawOnBottom: boolean, scalingRatio?: number): void;
8
16
  export declare function getAliasedDiscShape(radius: number): Uint8Array;
9
17
  /**
10
18
  * This function draws an aliased disc, using a shape computed by getDiscShape.
11
19
  */
12
- export declare function drawAliasedDisc(imageData: ImageData, { x: centerX, y: centerY }: Point, radius: number, [r, g, b]: RGBColor | RGBAColor, drawOnBottom: boolean): void;
13
- export declare function drawAliasedRect(imageData: ImageData, { x, y }: Point, width: number, height: number, [r, g, b]: RGBColor | RGBAColor): void;
20
+ export declare function drawAliasedDisc(imageData: ImageData, { x: centerX, y: centerY }: Point, radius: number, [r, g, b]: RGBColor | RGBAColor, drawOnBottom: boolean, scalingRatio?: number): void;
21
+ export declare function drawAliasedRect(imageData: ImageData, { x, y }: Point, width: number, height: number, [r, g, b]: RGBColor | RGBAColor, scalingRatio?: number): void;
14
22
  export declare function drawPathStopExtremity(ctx: CanvasRenderingContext2D, timePixel: number, spacePixel: number, swapAxis: boolean): void;
15
23
  export declare function drawPathOutExtremity(ctx: CanvasRenderingContext2D, timePixel: number, spacePixel: number, swapAxis: boolean, extremityType: 'from' | 'to', pathDirection: Direction): void;
16
24
  /**
@@ -18,17 +26,19 @@ export declare function drawPathOutExtremity(ctx: CanvasRenderingContext2D, time
18
26
  */
19
27
  export declare function drawPathExtremity(ctx: CanvasRenderingContext2D, timePixel: number, spacePixel: number, swapAxis: boolean, extremityType: 'from' | 'to', pathDirection: Direction, pathEnd: PathEnd): void;
20
28
  /**
21
- *
22
29
  * @param minT number timestamp
23
30
  * @param maxT number timestamp
24
31
  * @param timeRanges time frames (24h, 12h, 6h, …)
25
32
  * @param gridlinesLevels width of the lines for each time frame
26
33
  * @param formatter function to format de values inside the output object
27
- * @returns Record<number, number>
28
34
  * Keys are times in ms
29
35
  * Values are the highest level on each time
30
36
  */
31
- export declare function computeVisibleTimeMarkers<T>(minT: number, maxT: number, timeRanges: number[], gridlinesLevels: number[], formatter?: (level: number, i: number) => T): Record<number, T>;
37
+ export declare function computeVisibleTimeMarkers<T extends object = {
38
+ level: number;
39
+ }>(minT: number, maxT: number, timeRanges: number[], gridlinesLevels: number[], formatter?: (level: number, i: number) => T): (T & {
40
+ time: number;
41
+ })[];
32
42
  /**
33
43
  * To get crisp horizontal or vertical lines on a canvas, we must draw them as thin as possible, in
34
44
  * terms of actual pixels on screen.
@@ -46,10 +56,11 @@ export type CanvasRect = {
46
56
  spaceStart: number;
47
57
  spaceEnd: number;
48
58
  };
49
- export declare function fillRect(ctx: CanvasRenderingContext2D, rect: CanvasRect, spaceTimeContext: SpaceTimeChartContextType): {
50
- areaTimeSize?: undefined;
51
- areaSpaceSize?: undefined;
52
- } | {
53
- areaTimeSize: number;
54
- areaSpaceSize: number;
59
+ /**
60
+ * You most likely need to wrap this function call with ctx.save ctx.restore
61
+ * as it modifies ctx current transformation matrix
62
+ */
63
+ export declare function fillRect(ctx: CanvasRenderingContext2D, { timeStart, timeEnd, spaceStart, spaceEnd }: CanvasRect, { getPoint }: SpaceTimeChartContextType): {
64
+ width: number;
65
+ height: number;
55
66
  };
@@ -29,7 +29,7 @@ export declare function getNormalizedScaleAtPixel(y: number, tree: NormalizedSca
29
29
  export declare function getTimeToPixel(timeOrigin: number, pixelOffset: number, timeScale: number): TimeToPixel;
30
30
  export declare function getPixelToTime(timeOrigin: number, pixelOffset: number, timeScale: number): PixelToTime;
31
31
  export declare function getSpaceToPixel(pixelOffset: number, binaryTree: NormalizedScaleTree): SpaceToPixel;
32
- export declare function getPixelToSpace(spaceOrigin: number, pixelOffset: number, binaryTree: NormalizedScaleTree): PixelToSpace;
32
+ export declare function getPixelToSpace(pixelOffset: number, binaryTree: NormalizedScaleTree): PixelToSpace;
33
33
  export declare function getPointToData(getTime: PixelToTime, getSpace: PixelToSpace, timeAxis: Axis, spaceAxis: Axis): PointToData;
34
34
  export declare function getDataToPoint(getTimePixel: TimeToPixel, getSpacePixel: SpaceToPixel, timeAxis: Axis, spaceAxis: Axis): DataToPoint;
35
35
  /**
@@ -80,18 +80,7 @@ export declare const isLayerActive: (store: Store, selection: (typeof LAYERS_SEL
80
80
  speed: number;
81
81
  isTemporary: boolean;
82
82
  }[];
83
- } | LayerData<{
84
- electricalProfile: string;
85
- color?: string;
86
- heightLevel?: number;
87
- handled?: boolean;
88
- }>[] | LayerData<{
89
- powerRestriction: string;
90
- handled: boolean;
91
- }>[] | LayerData<{
92
- tag: string;
93
- color: string;
94
- }>[] | undefined;
83
+ } | LayerData<import("../types").ElectricalProfileValues>[] | LayerData<import("../types").PowerRestrictionValues>[] | LayerData<import("../types").SpeedLimitTagValues>[] | undefined;
95
84
  /**
96
85
  * Given a store including a list of slopes, return the position and value of min and max slopes
97
86
  * @param store
@@ -1,4 +1,4 @@
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 { Data as SpeedSpaceChartData } from './types';
4
+ export type { LayerData, PowerRestrictionValues, ElectricalProfileValues, ElectrificationValues, SpeedLimitTagValues, Data as SpeedSpaceChartData, } from './types';
@@ -1,18 +1,18 @@
1
- type ElectricalProfileValues = {
1
+ export type ElectricalProfileValues = {
2
2
  electricalProfile: string;
3
3
  color?: string;
4
4
  heightLevel?: number;
5
5
  handled?: boolean;
6
6
  };
7
- type PowerRestrictionValues = {
7
+ export type PowerRestrictionValues = {
8
8
  powerRestriction: string;
9
9
  handled: boolean;
10
10
  };
11
- type SpeedLimitTagValues = {
11
+ export type SpeedLimitTagValues = {
12
12
  tag: string;
13
13
  color: string;
14
14
  };
15
- type ElectrificationValues = {
15
+ export type ElectrificationValues = {
16
16
  type: 'electrification' | 'neutral_section' | 'non_electrified';
17
17
  voltage?: '1500V' | '25000V';
18
18
  lowerPantograph?: boolean;
package/dist/theme.css CHANGED
@@ -3838,12 +3838,6 @@ video {
3838
3838
  .z-10 {
3839
3839
  z-index: 10;
3840
3840
  }
3841
- .m-0 {
3842
- margin: 0px;
3843
- }
3844
- .m-4 {
3845
- margin: 1rem;
3846
- }
3847
3841
  .mx-2 {
3848
3842
  margin-left: 0.5rem;
3849
3843
  margin-right: 0.5rem;
@@ -3878,15 +3872,6 @@ video {
3878
3872
  .transform {
3879
3873
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3880
3874
  }
3881
- .cursor-grabbing {
3882
- cursor: grabbing;
3883
- }
3884
- .cursor-pointer {
3885
- cursor: pointer;
3886
- }
3887
- .flex-row {
3888
- flex-direction: row;
3889
- }
3890
3875
  .flex-col {
3891
3876
  flex-direction: column;
3892
3877
  }
@@ -3905,21 +3890,12 @@ video {
3905
3890
  .justify-end {
3906
3891
  justify-content: flex-end;
3907
3892
  }
3908
- .gap-1 {
3909
- gap: 0.25rem;
3910
- }
3911
- .gap-5 {
3912
- gap: 1.25rem;
3913
- }
3914
3893
  .justify-self-start {
3915
3894
  justify-self: start;
3916
3895
  }
3917
3896
  .justify-self-end {
3918
3897
  justify-self: end;
3919
3898
  }
3920
- .overflow-hidden {
3921
- overflow: hidden;
3922
- }
3923
3899
  .rounded-t-xl {
3924
3900
  border-top-left-radius: 0.75rem;
3925
3901
  border-top-right-radius: 0.75rem;
@@ -3956,9 +3932,6 @@ video {
3956
3932
  background-color: rgba(255, 255, 255, 1);
3957
3933
  background-color: rgba(255, 255, 255, var(--tw-bg-opacity, 1));
3958
3934
  }
3959
- .p-0 {
3960
- padding: 0px;
3961
- }
3962
3935
  .pr-2 {
3963
3936
  padding-right: 0.5rem;
3964
3937
  }
@@ -4545,12 +4518,6 @@ video {
4545
4518
  .z-10 {
4546
4519
  z-index: 10;
4547
4520
  }
4548
- .m-0 {
4549
- margin: 0px;
4550
- }
4551
- .m-4 {
4552
- margin: 1rem;
4553
- }
4554
4521
  .mx-2 {
4555
4522
  margin-left: 0.5rem;
4556
4523
  margin-right: 0.5rem;
@@ -4585,15 +4552,6 @@ video {
4585
4552
  .transform {
4586
4553
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
4587
4554
  }
4588
- .cursor-grabbing {
4589
- cursor: grabbing;
4590
- }
4591
- .cursor-pointer {
4592
- cursor: pointer;
4593
- }
4594
- .flex-row {
4595
- flex-direction: row;
4596
- }
4597
4555
  .flex-col {
4598
4556
  flex-direction: column;
4599
4557
  }
@@ -4612,21 +4570,12 @@ video {
4612
4570
  .justify-end {
4613
4571
  justify-content: flex-end;
4614
4572
  }
4615
- .gap-1 {
4616
- gap: 0.25rem;
4617
- }
4618
- .gap-5 {
4619
- gap: 1.25rem;
4620
- }
4621
4573
  .justify-self-start {
4622
4574
  justify-self: start;
4623
4575
  }
4624
4576
  .justify-self-end {
4625
4577
  justify-self: end;
4626
4578
  }
4627
- .overflow-hidden {
4628
- overflow: hidden;
4629
- }
4630
4579
  .rounded-t-xl {
4631
4580
  border-top-left-radius: 0.75rem;
4632
4581
  border-top-right-radius: 0.75rem;
@@ -4663,9 +4612,6 @@ video {
4663
4612
  background-color: rgba(255, 255, 255, 1);
4664
4613
  background-color: rgba(255, 255, 255, var(--tw-bg-opacity, 1));
4665
4614
  }
4666
- .p-0 {
4667
- padding: 0px;
4668
- }
4669
4615
  .pr-2 {
4670
4616
  padding-right: 0.5rem;
4671
4617
  }
@@ -5441,12 +5387,6 @@ video {
5441
5387
  .z-10 {
5442
5388
  z-index: 10;
5443
5389
  }
5444
- .m-0 {
5445
- margin: 0px;
5446
- }
5447
- .m-4 {
5448
- margin: 1rem;
5449
- }
5450
5390
  .mx-2 {
5451
5391
  margin-left: 0.5rem;
5452
5392
  margin-right: 0.5rem;
@@ -5481,15 +5421,6 @@ video {
5481
5421
  .transform {
5482
5422
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
5483
5423
  }
5484
- .cursor-grabbing {
5485
- cursor: grabbing;
5486
- }
5487
- .cursor-pointer {
5488
- cursor: pointer;
5489
- }
5490
- .flex-row {
5491
- flex-direction: row;
5492
- }
5493
5424
  .flex-col {
5494
5425
  flex-direction: column;
5495
5426
  }
@@ -5508,21 +5439,12 @@ video {
5508
5439
  .justify-end {
5509
5440
  justify-content: flex-end;
5510
5441
  }
5511
- .gap-1 {
5512
- gap: 0.25rem;
5513
- }
5514
- .gap-5 {
5515
- gap: 1.25rem;
5516
- }
5517
5442
  .justify-self-start {
5518
5443
  justify-self: start;
5519
5444
  }
5520
5445
  .justify-self-end {
5521
5446
  justify-self: end;
5522
5447
  }
5523
- .overflow-hidden {
5524
- overflow: hidden;
5525
- }
5526
5448
  .rounded-t-xl {
5527
5449
  border-top-left-radius: 0.75rem;
5528
5450
  border-top-right-radius: 0.75rem;
@@ -5559,9 +5481,6 @@ video {
5559
5481
  background-color: rgba(255, 255, 255, 1);
5560
5482
  background-color: rgba(255, 255, 255, var(--tw-bg-opacity, 1));
5561
5483
  }
5562
- .p-0 {
5563
- padding: 0px;
5564
- }
5565
5484
  .pr-2 {
5566
5485
  padding-right: 0.5rem;
5567
5486
  }
@@ -6271,12 +6190,6 @@ video {
6271
6190
  .z-10 {
6272
6191
  z-index: 10;
6273
6192
  }
6274
- .m-0 {
6275
- margin: 0px;
6276
- }
6277
- .m-4 {
6278
- margin: 1rem;
6279
- }
6280
6193
  .mx-2 {
6281
6194
  margin-left: 0.5rem;
6282
6195
  margin-right: 0.5rem;
@@ -6311,15 +6224,6 @@ video {
6311
6224
  .transform {
6312
6225
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
6313
6226
  }
6314
- .cursor-grabbing {
6315
- cursor: grabbing;
6316
- }
6317
- .cursor-pointer {
6318
- cursor: pointer;
6319
- }
6320
- .flex-row {
6321
- flex-direction: row;
6322
- }
6323
6227
  .flex-col {
6324
6228
  flex-direction: column;
6325
6229
  }
@@ -6338,21 +6242,12 @@ video {
6338
6242
  .justify-end {
6339
6243
  justify-content: flex-end;
6340
6244
  }
6341
- .gap-1 {
6342
- gap: 0.25rem;
6343
- }
6344
- .gap-5 {
6345
- gap: 1.25rem;
6346
- }
6347
6245
  .justify-self-start {
6348
6246
  justify-self: start;
6349
6247
  }
6350
6248
  .justify-self-end {
6351
6249
  justify-self: end;
6352
6250
  }
6353
- .overflow-hidden {
6354
- overflow: hidden;
6355
- }
6356
6251
  .rounded-t-xl {
6357
6252
  border-top-left-radius: 0.75rem;
6358
6253
  border-top-right-radius: 0.75rem;
@@ -6389,9 +6284,6 @@ video {
6389
6284
  background-color: rgba(255, 255, 255, 1);
6390
6285
  background-color: rgba(255, 255, 255, var(--tw-bg-opacity, 1));
6391
6286
  }
6392
- .p-0 {
6393
- padding: 0px;
6394
- }
6395
6287
  .pr-2 {
6396
6288
  padding-right: 0.5rem;
6397
6289
  }