Skip to content

Commit

Permalink
front: remove workaround for empty space scales
Browse files Browse the repository at this point in the history
The upstream osrd-ui bug has been fixed.

Signed-off-by: Simon Ser <contact@emersion.fr>
References: OpenRailAssociation/osrd-ui#653
  • Loading branch information
emersion committed Oct 21, 2024
1 parent d857ec8 commit 98a34c6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,6 @@ const SimulationResults = ({
[projectionData]
);

// TODO: remove this after closing https://github.com/OpenRailAssociation/osrd-ui/issues/648
const projectPathTrainResult = useMemo(
() =>
projectionData?.projectedTrains.filter((train) => train.space_time_curves.length > 0) || [],
[projectionData]
);

const conflictZones = useProjectedConflicts(infraId, conflicts, projectionData?.path);

useEffect(() => {
Expand Down Expand Up @@ -162,7 +155,7 @@ const SimulationResults = ({
)}
<ManchetteWithSpaceTimeChartWrapper
operationalPoints={projectedOperationalPoints}
projectPathTrainResult={projectPathTrainResult}
projectPathTrainResult={projectionData?.projectedTrains}
selectedTrainScheduleId={selectedTrainSchedule?.id}
waypointsPanelData={{
filteredWaypoints: filteredOperationalPoints,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,19 @@ const ManchetteWithSpaceTimeChartWrapper = ({
onClose={() => setShowSettingsPanel(false)}
/>
)}
{/* TODO: remove this condition after closing
https://github.com/OpenRailAssociation/osrd-ui/issues/648 */}
{spaceTimeChartProps.spaceScales.length > 0 && (
<SpaceTimeChart
className="inset-0 absolute h-full"
spaceOrigin={
(waypointsPanelData?.filteredWaypoints ?? operationalPoints).at(0)?.position || 0
}
timeOrigin={Math.min(
...projectPathTrainResult.map((p) => +new Date(p.departure_time))
)}
{...spaceTimeChartProps}
>
{spaceTimeChartProps.paths.map((path) => (
<PathLayer key={path.id} path={path} color={path.color} />
))}
{settings.showConflicts && <ConflictLayer conflicts={conflicts} />}
</SpaceTimeChart>
)}
<SpaceTimeChart
className="inset-0 absolute h-full"
spaceOrigin={
(waypointsPanelData?.filteredWaypoints ?? operationalPoints).at(0)?.position || 0
}
timeOrigin={Math.min(...projectPathTrainResult.map((p) => +new Date(p.departure_time)))}
{...spaceTimeChartProps}
>
{spaceTimeChartProps.paths.map((path) => (
<PathLayer key={path.id} path={path} color={path.color} />
))}
{settings.showConflicts && <ConflictLayer conflicts={conflicts} />}
</SpaceTimeChart>
</div>
</div>
</div>
Expand Down

0 comments on commit 98a34c6

Please sign in to comment.