Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Conversation

@jacomyal
Copy link
Contributor

@jacomyal jacomyal commented Apr 25, 2025

This PR addresses issue #945. It is huge, and has been designed to be reviewed each commit one at a time.

The core parts are:

  • Improving Manchette and SpaceTimeChart to ease the track-occupancy diagram integration
  • Creating a new TrackOccupancyStandalone component, that properly uses useManchetteWithSpaceTimeChart to get a track-occupancy diagram, with the SpaceTimeChart interactions (panning and zooming)
  • Adding a new story to showcase how to display a TrackOccupancyCanvas and a TrackOccupancyCanvas within a split section, using useManchetteWithSpaceTimeChart
  • Re-implements clicking trains in the TrackOccupancyCanvas layer, using picking

Details:
- Adds splitting waypoints in the operational points given to the GET
  from useManchetteWithSpaceTimeChart, and handles not rendering them in
  the GET 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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Some code from useManchetteWithSpaceTimeChart stories was out of date,
this commit fixes those occurances.

Signed-off-by: Alexis Jacomy <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
@jacomyal jacomyal marked this pull request as ready for review April 29, 2025 14:47
@jacomyal jacomyal requested a review from a team as a code owner April 29, 2025 14:47
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 <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants