@osrd-project/ui-charts 0.0.80 → 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 +1893 -1442
- 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 +410 -195
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { OccupancyZone, Track } from '
|
|
2
|
+
import type { OccupancyZone, Track } from '../lib/types';
|
|
3
3
|
declare const TrackOccupancyCanvas: ({ position, tracks, occupancyZones, selectedTrainId, onClose, topPadding, hideBorders, }: {
|
|
4
4
|
position: number;
|
|
5
5
|
tracks: Track[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react';
|
|
2
|
-
import type { Track } from '
|
|
2
|
+
import type { Track } from '../lib/types';
|
|
3
3
|
declare const TrackOccupancyManchette: ({ tracks, children }: PropsWithChildren<{
|
|
4
4
|
tracks: Track[];
|
|
5
5
|
}>) => React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { OccupancyZone, Track } from '
|
|
2
|
+
import type { OccupancyZone, Track } from '../lib/types';
|
|
3
3
|
declare const TrackOccupancyStandalone: ({ tracks, occupancyZones, selectedTrainId, onSelectedTrainIdChange, height, }: {
|
|
4
4
|
tracks: Track[];
|
|
5
5
|
occupancyZones: OccupancyZone[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { OccupancyZone } from '
|
|
1
|
+
import type { SpaceTimeChartContextType } from '../../../../spaceTimeChart';
|
|
2
|
+
import type { OccupancyZone } from '../../../lib/types';
|
|
3
3
|
export declare const drawRemainingTrainsBox: (ctx: CanvasRenderingContext2D, { getTimePixel, getSpacePixel }: SpaceTimeChartContextType, { time, position, yOffset, remainingTrainsNb, }: {
|
|
4
4
|
time: number;
|
|
5
5
|
position: number;
|
|
@@ -12,3 +12,9 @@ export declare const drawOccupationZone: (ctx: CanvasRenderingContext2D, stcCont
|
|
|
12
12
|
position: number;
|
|
13
13
|
isSelected?: boolean;
|
|
14
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
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OccupancyZone } from '
|
|
1
|
+
import type { OccupancyZone } from '../../../lib/types';
|
|
2
2
|
export declare const drawOccupancyZonesTexts: ({ ctx, zone, arrivalTimePixel, departureTimePixel, yPosition, isThroughTrain, isSelected, }: {
|
|
3
3
|
ctx: CanvasRenderingContext2D;
|
|
4
4
|
zone: OccupancyZone;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SpaceTimeChartContextType } from '../../../../spaceTimeChart';
|
|
2
|
-
import { type Track } from '
|
|
2
|
+
import { type Track } from '../../../lib/types';
|
|
3
3
|
export declare const drawTracks: (ctx: CanvasRenderingContext2D, stcContext: SpaceTimeChartContextType, { position, tracks, drawBorders, topPadding, }: {
|
|
4
4
|
position: number;
|
|
5
5
|
tracks: Track[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { OccupancyZone, OccupancyZonePickingElement, Track } from '
|
|
1
|
+
import type { PickingElement } from '../../../common/types';
|
|
2
|
+
import type { OccupancyZone, OccupancyZonePickingElement, Track } from '../../lib/types';
|
|
3
3
|
export declare function isOccupancyPickingElement(element: PickingElement): element is OccupancyZonePickingElement;
|
|
4
4
|
declare const OccupancyZonesLayer: ({ tracks, occupancyZones, position, topPadding, selectedTrainId, }: {
|
|
5
5
|
tracks: Track[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './styles/main.css';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
2
|
+
export * from './lib/types';
|
|
3
|
+
export * from './lib/consts';
|
|
4
4
|
export { isOccupancyPickingElement } from './components/layers/OccupancyZonesLayer';
|
|
5
5
|
export { default as TrackOccupancyCanvas } from './components/TrackOccupancyCanvas';
|
|
6
6
|
export { default as TrackOccupancyManchette } from './components/TrackOccupancyManchette';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TICKS_PATTERN } from './consts';
|
|
2
|
-
import {
|
|
2
|
+
import type { PickingElement } from '../../common/types';
|
|
3
3
|
export type Track = {
|
|
4
4
|
id: string;
|
|
5
5
|
name?: string;
|
|
@@ -17,6 +17,7 @@ export type OccupancyZone = {
|
|
|
17
17
|
endTime: number;
|
|
18
18
|
startDirection?: 'up' | 'down';
|
|
19
19
|
endDirection?: 'up' | 'down';
|
|
20
|
+
trailingText?: string;
|
|
20
21
|
};
|
|
21
22
|
export type OccupancyZonePickingElement = PickingElement & {
|
|
22
23
|
type: 'occupancyZone';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osrd-project/ui-charts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.82",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
5
|
"bugs": "https://github.com/OpenRailAssociation/osrd/issues",
|
|
6
6
|
"repository": {
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"tailwindcss": ">=4.1"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@osrd-project/ui-core": "0.0.
|
|
46
|
-
"@osrd-project/ui-icons": "0.0.
|
|
47
|
-
"chroma-js": "^3.
|
|
45
|
+
"@osrd-project/ui-core": "0.0.82",
|
|
46
|
+
"@osrd-project/ui-icons": "0.0.82",
|
|
47
|
+
"chroma-js": "^3.2.0",
|
|
48
48
|
"d3-selection": "^3.0.0",
|
|
49
49
|
"d3-zoom": "^3.0.0",
|
|
50
|
-
"lodash": "^4.17.
|
|
50
|
+
"lodash": "^4.17.23"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@types/chroma-js": "^3.1.
|
|
53
|
+
"@types/chroma-js": "^3.1.2",
|
|
54
54
|
"@types/d3-selection": "^3.0.11",
|
|
55
55
|
"@types/d3-zoom": "^3.0.0",
|
|
56
56
|
"@types/file-saver": "^2.0.7",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type ProjectPathTrainResult } from '../types';
|
|
2
|
-
declare const usePaths: (projectPathTrainResult: ProjectPathTrainResult[]) => {
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
points: {
|
|
6
|
-
time: number;
|
|
7
|
-
position: number;
|
|
8
|
-
}[];
|
|
9
|
-
color: string;
|
|
10
|
-
}[];
|
|
11
|
-
export default usePaths;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type CanvasContextType, type DrawingFunction, type HoveredItem, type LayerType, type PickingDrawingFunction, type PickingLayerType, type Point, type SpaceTimeChartContextType } from '../lib/types';
|
|
2
|
-
/**
|
|
3
|
-
* This hook handles the internal canvas drawing logic of the SpaceTimeChart component.
|
|
4
|
-
* It is an internal hook, and should only be used inside SpaceTimeChart.
|
|
5
|
-
*/
|
|
6
|
-
export declare function useCanvas(dom: HTMLElement | null, inputStcContext: SpaceTimeChartContextType, position?: Point): {
|
|
7
|
-
canvasContext: CanvasContextType;
|
|
8
|
-
hoveredItem: HoveredItem | null;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* This hook helps to bind a picking function to a layer in the SpaceTimeChart.
|
|
12
|
-
* It is public and can be used outside SpaceTimeChart.
|
|
13
|
-
*/
|
|
14
|
-
export declare function usePicking(layer: PickingLayerType, fn: PickingDrawingFunction): void;
|
|
15
|
-
/**
|
|
16
|
-
* This hook helps to bind a drawing function to a layer in the SpaceTimeChart.
|
|
17
|
-
* It is public and can be used outside SpaceTimeChart.
|
|
18
|
-
*/
|
|
19
|
-
export declare function useDraw(layer: LayerType, fn: DrawingFunction): void;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|