@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 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { OccupancyZone, Track } from '../lib/types';
|
|
3
|
-
declare const TrackOccupancyCanvas: ({ position, tracks, occupancyZones, selectedTrainId, onClose, topPadding, hideBorders, }: {
|
|
4
|
-
position: number;
|
|
5
|
-
tracks: Track[];
|
|
6
|
-
occupancyZones: OccupancyZone[];
|
|
7
|
-
selectedTrainId?: string;
|
|
8
|
-
onClose?: () => void;
|
|
9
|
-
topPadding?: number;
|
|
10
|
-
hideBorders?: boolean;
|
|
11
|
-
}) => React.JSX.Element;
|
|
12
|
-
export default TrackOccupancyCanvas;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React, { type PropsWithChildren } from 'react';
|
|
2
|
-
import type { Track } from '../lib/types';
|
|
3
|
-
declare const TrackOccupancyManchette: ({ tracks, children }: PropsWithChildren<{
|
|
4
|
-
tracks: Track[];
|
|
5
|
-
}>) => React.JSX.Element;
|
|
6
|
-
export default TrackOccupancyManchette;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { OccupancyZone, Track } from '../lib/types';
|
|
3
|
-
declare const TrackOccupancyStandalone: ({ tracks, occupancyZones, selectedTrainId, onSelectedTrainIdChange, height, }: {
|
|
4
|
-
tracks: Track[];
|
|
5
|
-
occupancyZones: OccupancyZone[];
|
|
6
|
-
selectedTrainId?: string;
|
|
7
|
-
onSelectedTrainIdChange?: (selectedTrainId?: string) => void;
|
|
8
|
-
height?: number;
|
|
9
|
-
}) => React.JSX.Element;
|
|
10
|
-
export default TrackOccupancyStandalone;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { SpaceTimeChartContextType } from '../../../../spaceTimeChart';
|
|
2
|
-
import type { OccupancyZone } from '../../../lib/types';
|
|
3
|
-
export declare const drawRemainingTrainsBox: (ctx: CanvasRenderingContext2D, { getTimePixel, getSpacePixel }: SpaceTimeChartContextType, { time, position, yOffset, remainingTrainsNb, }: {
|
|
4
|
-
time: number;
|
|
5
|
-
position: number;
|
|
6
|
-
yOffset: number;
|
|
7
|
-
remainingTrainsNb: number;
|
|
8
|
-
}) => void;
|
|
9
|
-
export declare const drawOccupationZone: (ctx: CanvasRenderingContext2D, stcContext: SpaceTimeChartContextType, { zone, yOffset, position, isSelected, }: {
|
|
10
|
-
zone: OccupancyZone;
|
|
11
|
-
yOffset: number;
|
|
12
|
-
position: number;
|
|
13
|
-
isSelected?: boolean;
|
|
14
|
-
}) => void;
|
|
15
|
-
export declare const drawZoneTrailingText: (ctx: CanvasRenderingContext2D, { getTimePixel, getSpacePixel }: SpaceTimeChartContextType, { zone, position, yOffset, trailingText, }: {
|
|
16
|
-
zone: OccupancyZone;
|
|
17
|
-
position: number;
|
|
18
|
-
yOffset: number;
|
|
19
|
-
trailingText: string;
|
|
20
|
-
}) => void;
|
package/dist/trackOccupancyDiagram/components/helpers/drawElements/drawOccupancyZonesTexts.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { OccupancyZone } from '../../../lib/types';
|
|
2
|
-
export declare const drawOccupancyZonesTexts: ({ ctx, zone, arrivalTimePixel, departureTimePixel, yPosition, isThroughTrain, isSelected, }: {
|
|
3
|
-
ctx: CanvasRenderingContext2D;
|
|
4
|
-
zone: OccupancyZone;
|
|
5
|
-
arrivalTimePixel: number;
|
|
6
|
-
departureTimePixel: number;
|
|
7
|
-
yPosition: number;
|
|
8
|
-
isThroughTrain: boolean;
|
|
9
|
-
isSelected?: boolean;
|
|
10
|
-
}) => void;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type DrawTrackProps = {
|
|
2
|
-
ctx: CanvasRenderingContext2D;
|
|
3
|
-
width: number;
|
|
4
|
-
getTimePixel: (time: number) => number;
|
|
5
|
-
labelMarks: Record<number, {
|
|
6
|
-
level: number;
|
|
7
|
-
rangeIndex: number;
|
|
8
|
-
}>;
|
|
9
|
-
};
|
|
10
|
-
export declare const drawTrack: ({ ctx, width, getTimePixel, labelMarks }: DrawTrackProps) => void;
|
|
11
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SpaceTimeChartContextType } from '../../../../spaceTimeChart';
|
|
2
|
-
import { type Track } from '../../../lib/types';
|
|
3
|
-
export declare const drawTracks: (ctx: CanvasRenderingContext2D, stcContext: SpaceTimeChartContextType, { position, tracks, drawBorders, topPadding, }: {
|
|
4
|
-
position: number;
|
|
5
|
-
tracks: Track[];
|
|
6
|
-
drawBorders: boolean;
|
|
7
|
-
topPadding: number;
|
|
8
|
-
}) => void;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { PickingElement } from '../../../common/types';
|
|
2
|
-
import type { OccupancyZone, OccupancyZonePickingElement, Track } from '../../lib/types';
|
|
3
|
-
export declare function isOccupancyPickingElement(element: PickingElement): element is OccupancyZonePickingElement;
|
|
4
|
-
declare const OccupancyZonesLayer: ({ tracks, occupancyZones, position, topPadding, selectedTrainId, }: {
|
|
5
|
-
tracks: Track[];
|
|
6
|
-
occupancyZones: OccupancyZone[];
|
|
7
|
-
position: number;
|
|
8
|
-
topPadding: number;
|
|
9
|
-
selectedTrainId?: string;
|
|
10
|
-
}) => null;
|
|
11
|
-
export default OccupancyZonesLayer;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { type TickPattern } from '../lib/types';
|
|
2
|
-
type DrawTextType = {
|
|
3
|
-
ctx: CanvasRenderingContext2D;
|
|
4
|
-
text: string;
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
color: string;
|
|
8
|
-
xPosition?: 'left' | 'center' | 'right';
|
|
9
|
-
yPosition?: 'top' | 'middle' | 'bottom';
|
|
10
|
-
font?: string;
|
|
11
|
-
rotateAngle?: number;
|
|
12
|
-
stroke?: {
|
|
13
|
-
color: string;
|
|
14
|
-
width: number;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare const drawText: ({ ctx, text, x, y, color, xPosition, yPosition, font, rotateAngle, stroke, }: DrawTextType) => void;
|
|
18
|
-
export declare const getTickPattern: (minutes: string) => TickPattern;
|
|
19
|
-
export declare const getLabelMarks: (timeRanges: number[], minT: number, maxT: number, labelLevels: number[]) => Record<number, {
|
|
20
|
-
level: number;
|
|
21
|
-
rangeIndex: number;
|
|
22
|
-
}>;
|
|
23
|
-
export declare const getLabelLevels: (breakpoints: number[], pixelsPerMinute: number, ticksPriorities: number[][]) => number[];
|
|
24
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import './styles/main.css';
|
|
2
|
-
export * from './lib/types';
|
|
3
|
-
export * from './lib/consts';
|
|
4
|
-
export { isOccupancyPickingElement } from './components/layers/OccupancyZonesLayer';
|
|
5
|
-
export { default as TrackOccupancyCanvas } from './components/TrackOccupancyCanvas';
|
|
6
|
-
export { default as TrackOccupancyManchette } from './components/TrackOccupancyManchette';
|
|
7
|
-
export { default as TrackOccupancyStandalone } from './components/TrackOccupancyStandalone';
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export declare const TRACK_HEIGHT_CONTAINER = 100;
|
|
2
|
-
export declare const CANVAS_PADDING = 10;
|
|
3
|
-
export declare const OCCUPANCY_ZONE_Y_START: number;
|
|
4
|
-
export declare const OCCUPANCY_ZONE_HEIGHT = 3;
|
|
5
|
-
export declare const MINUTES_TEXT_OFFSET = 8.5;
|
|
6
|
-
export declare const STATION_TEXT_OFFSET = 5;
|
|
7
|
-
export declare const FONTS: {
|
|
8
|
-
SANS: string;
|
|
9
|
-
MONO: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const COLORS: {
|
|
12
|
-
GREY_20: string;
|
|
13
|
-
GREY_50: string;
|
|
14
|
-
GREY_60: string;
|
|
15
|
-
GREY_80: string;
|
|
16
|
-
MANCHETTE_BACKGROUND: string;
|
|
17
|
-
HOUR_BACKGROUND_1: string;
|
|
18
|
-
HOUR_BACKGROUND_2: string;
|
|
19
|
-
RAIL_TICK: string;
|
|
20
|
-
REMAINING_TRAINS_BACKGROUND: string;
|
|
21
|
-
SELECTION_20: string;
|
|
22
|
-
WHITE_50: string;
|
|
23
|
-
WHITE_100: string;
|
|
24
|
-
};
|
|
25
|
-
export declare const TICKS_PATTERN: {
|
|
26
|
-
MINUTE: number[];
|
|
27
|
-
FIVE_MINUTES: number[];
|
|
28
|
-
QUARTER_HOUR: number[];
|
|
29
|
-
HALF_HOUR: number[];
|
|
30
|
-
HOUR: number[];
|
|
31
|
-
};
|
|
32
|
-
export declare const TICKS_PRIORITIES: number[][];
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { PickingElement } from '../../common/types';
|
|
2
|
-
import { type TICKS_PATTERN } from './consts';
|
|
3
|
-
export type Track = {
|
|
4
|
-
id: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
line?: string;
|
|
7
|
-
};
|
|
8
|
-
export type OccupancyZone = {
|
|
9
|
-
trainId: string;
|
|
10
|
-
trackId: string;
|
|
11
|
-
color?: string;
|
|
12
|
-
size?: number;
|
|
13
|
-
trainName: string;
|
|
14
|
-
originStation?: string;
|
|
15
|
-
destinationStation?: string;
|
|
16
|
-
startTime: number;
|
|
17
|
-
endTime: number;
|
|
18
|
-
startDirection?: 'up' | 'down';
|
|
19
|
-
endDirection?: 'up' | 'down';
|
|
20
|
-
trailingText?: string;
|
|
21
|
-
};
|
|
22
|
-
export type OccupancyZonePickingElement = PickingElement & {
|
|
23
|
-
type: 'occupancyZone';
|
|
24
|
-
pathId: string;
|
|
25
|
-
};
|
|
26
|
-
export type TickPattern = keyof typeof TICKS_PATTERN;
|