Conversation
clarani
reviewed
May 6, 2025
clarani
reviewed
May 7, 2025
SharglutDev
reviewed
May 7, 2025
SharglutDev
reviewed
May 9, 2025
jacomyal
added a commit
that referenced
this pull request
May 12, 2025
This commit addresses various discussions opened by reviewers on PR #11636 Details: - Adds train selection in track-occupancy.stories.tsx - Fixes "+XXX trains" label placement in OccupancyZonesLayer - Adds various comments and renames some variables and functions to improve code readability Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
jacomyal
added a commit
that referenced
this pull request
May 13, 2025
This commit addresses various discussions opened by reviewers on PR #11636 Details: - Adds train selection in track-occupancy.stories.tsx - Fixes "+XXX trains" label placement in OccupancyZonesLayer - Adds various comments and renames some variables and functions to improve code readability Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
jacomyal
added a commit
that referenced
this pull request
May 13, 2025
This commit addresses various discussions opened by reviewers on PR #11636 Details: - Adds train selection in track-occupancy.stories.tsx - Fixes "+XXX trains" label placement in OccupancyZonesLayer - Adds various comments and renames some variables and functions to improve code readability Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
jacomyal
added a commit
that referenced
this pull request
May 13, 2025
This commit addresses various discussions opened by reviewers on PR #11636 Details: - Fixes "+XXX trains" label placement in OccupancyZonesLayer, so that it's properly centered on displayed zones of the pack - Replaces `XXX * KILOMETER` with `positionKmToMm(XXX)` for clarity
Contributor
Author
Oh, ok, I misread your comment on the "+X trains" label coordinates. I just pushed a fix. |
jacomyal
added a commit
that referenced
this pull request
May 13, 2025
This commit addresses various discussions opened by reviewers on PR #11636 Details: - Adds train selection in track-occupancy.stories.tsx - Fixes "+XXX trains" label placement in OccupancyZonesLayer - Adds various comments and renames some variables and functions to improve code readability Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
jacomyal
added a commit
that referenced
this pull request
May 13, 2025
This commit addresses various discussions opened by reviewers on PR #11636 Details: - Fixes "+XXX trains" label placement in OccupancyZonesLayer, so that it's properly centered on displayed zones of the pack - Replaces `XXX * KILOMETER` with `positionKmToMm(XXX)` for clarity
jacomyal
added a commit
that referenced
this pull request
May 14, 2025
This commit addresses various discussions opened by reviewers on PR #11636 Details: - Adds train selection in track-occupancy.stories.tsx - Fixes "+XXX trains" label placement in OccupancyZonesLayer - Adds various comments and renames some variables and functions to improve code readability Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
jacomyal
added a commit
that referenced
this pull request
May 14, 2025
This commit addresses various discussions opened by reviewers on PR #11636 Details: - Fixes "+XXX trains" label placement in OccupancyZonesLayer, so that it's properly centered on displayed zones of the pack - Replaces `XXX * KILOMETER` with `positionKmToMm(XXX)` for clarity Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
SharglutDev
approved these changes
May 14, 2025
SharglutDev
left a comment
Contributor
There was a problem hiding this comment.
Lgtm and tested (tested on ubuntu), great job ✅
Lets see if it works for the mac users :)
Details: - Adds splitting waypoints in the operational points given to the STC from useManchetteWithSpaceTimeChart, and handles not rendering them in the STC code directly - Adds flatSteps in the SpaceTimeChartContext, as a Set<number> - Steps rendering path segments on pauses on flat steps, since we now assume they are rendered directly in the split section layer itself Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
This commit allows the SpaceTimeChart to work with space scales that just contain one single flat step. The idea is to allow using the SpaceTimeChart, to only render a TrackOccupancyDiagram, while still having the other interesting interactions (zooming and panning, basically). Details: - Adds new hideTimeCaptions param - Improves utils to allow the SpaceTimeChart to work with only one waypoint, and a flat step on it Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
This commit aims at making Manchette and useManchetteWithSpaceTimeChart work with a single flat step, on a single waypoint. This will allow them to be used to render a TrackOccupancyDiagram, with all the interesting interactions (zooming and panning). Details: - Adds various options to useManchetteWithSpaceTimeChart, to allow disabling zooming, panning or time captions - Allows overriding vertical padding in useManchetteWithSpaceTimeChart, to exactly fit one single flat step, to the pixel - Improves helpers (and their tests) to work in the edge case where there is just one waypoint, and a flat step on it Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
This commit basically replaces the previous trackOccupancyDiagram/rendering story, with a new component, TrackOccupancyStandalone, that actually calls useManchetteWithSpaceTimeChart instead of mimicking it. The main benefit is to get proper interactions, such as panning on the time axis. Also, this commit is very impactful, because many things were done quite customly for track occupancy drawing, when the SpaceTimeChart APIs provide many tools to help rendering additional layers on top of them. One final note, before getting into the detail: This commit breaks selecting a train with the mouse on the TrackOccupancyDiagram, because this was done in the rendering loop, rather than using picking (as it should). Details: - Replaces all time and space to pixels conversions from track occupancy layers, with code that uses proper tools from SpaceTimeChartContext - Removes mouse collision detection (it was done in the rendering process, which meant that rendering was depending on the mousePositions, causing many excess renderings) - Updates OccupancyZone: id becomes trainId, and arrivalTime and departureTime become numbers instead of dates - Adds new TrackOccupancyStandalone component - Updates rendering story to use new component Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
Some code from useManchetteWithSpaceTimeChart stories was out of date, this commit fixes those occurances. Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
There were some weird issues due to the fact that data for the manchette and useManchetteWithSpaceTimeChart were in millimeters, and data for the SpaceTimeChart were in meters. This commit migrates everything SpaceTimeChart-related to millimeters. Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
This commit addresses ticket: osrd-project/osrd-confidential#945 Details: - Adds possibility to add some top padding to TrackOccupancyCanvas - Adds possibility to display a close button in the top right of the TrackOccupancyCanvas - Allows giving children to TrackOccupancyManchette - Adds Waypoint (as WaypointComponent) to exports from ui-charts - Creates new trac-occupancy story, that shows how to display TrackOccupancy diagrams within split sections of the Manchette and the SpaceTimeChart Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
Details: - Implements back clicks detection in the TrackOccupancy diagram, using the picking framework from the SpaceTimeDiagram - Adds an example showing how it works in the trackOccupancyDiagram/rendering story Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
Details: - Adds top and bottom borders to TrackOccupancyCanvas - Adds top and bottom borders to TrackOccupancyManchette - Removes these borders when using TrackOccupancyStandalone Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
This commit addresses various discussions opened by reviewers on PR #11636 Details: - Adds train selection in track-occupancy.stories.tsx - Fixes "+XXX trains" label placement in OccupancyZonesLayer - Adds various comments and renames some variables and functions to improve code readability Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
This commit adds times graduations in the bottom of the TrackOccupancyStandalone component. Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
This commit addresses various discussions opened by reviewers on PR #11636 Details: - Fixes "+XXX trains" label placement in OccupancyZonesLayer, so that it's properly centered on displayed zones of the pack - Replaces `XXX * KILOMETER` with `positionKmToMm(XXX)` for clarity Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
github-merge-queue Bot
pushed a commit
that referenced
this pull request
May 16, 2025
This commit addresses various discussions opened by reviewers on PR #11636 Details: - Adds train selection in track-occupancy.stories.tsx - Fixes "+XXX trains" label placement in OccupancyZonesLayer - Adds various comments and renames some variables and functions to improve code readability Signed-off-by: Alexis Jacomy <alexis.jacomy@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR addresses issue #945. It is huge, and has been designed to be reviewed each commit one at a time.
It was originally submitted here, on the OSRD-UI former repository.
The core parts are:
ManchetteandSpaceTimeChartto ease the track-occupancy diagram integrationTrackOccupancyStandalonecomponent, that properly usesuseManchetteWithSpaceTimeChartto get a track-occupancy diagram, with theSpaceTimeChartinteractions (panning and zooming)TrackOccupancyCanvasand aTrackOccupancyCanvaswithin a split section, usinguseManchetteWithSpaceTimeChartTrackOccupancyCanvaslayer, using picking