@@ -7,7 +7,10 @@ import { useTranslation } from 'react-i18next';
7
7
import type { SimulationResultsData } from 'applications/operationalStudies/types' ;
8
8
import type { Conflict } from 'common/api/osrdEditoastApi' ;
9
9
import SimulationWarpedMap from 'common/Map/WarpedMap/SimulationWarpedMap' ;
10
- import ManchetteWithSpaceTimeChartWrapper from 'modules/simulationResult/components/ManchetteWithSpaceTimeChart/ManchetteWithSpaceTimeChart' ;
10
+ import ResizableSection from 'common/ResizableSection' ;
11
+ import ManchetteWithSpaceTimeChartWrapper , {
12
+ MANCHETTE_WITH_SPACE_TIME_CHART_DEFAULT_HEIGHT ,
13
+ } from 'modules/simulationResult/components/ManchetteWithSpaceTimeChart/ManchetteWithSpaceTimeChart' ;
11
14
import SimulationResultsMap from 'modules/simulationResult/components/SimulationResultsMap/SimulationResultsMap' ;
12
15
import useGetProjectedTrainOperationalPoints from 'modules/simulationResult/components/SpaceTimeChart/useGetProjectedTrainOperationalPoints' ;
13
16
import useProjectedConflicts from 'modules/simulationResult/components/SpaceTimeChart/useProjectedConflicts' ;
@@ -24,6 +27,7 @@ import { getPointCoordinates } from 'utils/geometry';
24
27
25
28
const SPEED_SPACE_CHART_HEIGHT = 521.5 ;
26
29
const HANDLE_TAB_RESIZE_HEIGHT = 20 ;
30
+ const MANCHETTE_HEIGHT_DIFF = 76 ;
27
31
28
32
type SimulationResultsProps = {
29
33
scenarioData : { name : string ; infraName : string } ;
@@ -55,6 +59,10 @@ const SimulationResults = ({
55
59
const [ extViewport , setExtViewport ] = useState < Viewport > ( ) ;
56
60
const [ showWarpedMap , setShowWarpedMap ] = useState ( false ) ;
57
61
62
+ const [ manchetteWithSpaceTimeChartHeight , setManchetteWithSpaceTimeChartHeight ] = useState (
63
+ MANCHETTE_WITH_SPACE_TIME_CHART_DEFAULT_HEIGHT
64
+ ) ;
65
+
58
66
const [ speedSpaceChartContainerHeight , setSpeedSpaceChartContainerHeight ] =
59
67
useState ( SPEED_SPACE_CHART_HEIGHT ) ;
60
68
const [ mapCanvas , setMapCanvas ] = useState < string > ( ) ;
@@ -129,43 +137,53 @@ const SimulationResults = ({
129
137
</ div >
130
138
) }
131
139
132
- { /* SIMULATION : SPACE TIME CHART */ }
133
- < div className = "simulation-warped-map d-flex flex-row align-items-stretch mb-2" >
134
- { projectionData && projectionData . projectedTrains . length > 0 && pathProperties && (
135
- < >
136
- < button
137
- type = "button"
138
- className = "show-warped-map-button my-3 ml-3 mr-1"
139
- aria-label = { t ( 'toggleWarpedMap' ) }
140
- title = { t ( 'toggleWarpedMap' ) }
141
- onClick = { ( ) => setShowWarpedMap ( ! showWarpedMap ) }
142
- >
143
- { showWarpedMap ? < ChevronLeft /> : < ChevronRight /> }
144
- </ button >
145
- < SimulationWarpedMap
146
- collapsed = { ! showWarpedMap }
147
- pathGeometry = { projectionData . geometry }
148
- />
140
+ < ResizableSection
141
+ height = { manchetteWithSpaceTimeChartHeight }
142
+ setHeight = { setManchetteWithSpaceTimeChartHeight }
143
+ minHeight = { MANCHETTE_WITH_SPACE_TIME_CHART_DEFAULT_HEIGHT }
144
+ >
145
+ { /* SIMULATION : SPACE TIME CHART */ }
146
+ < div
147
+ className = "simulation-warped-map d-flex flex-row align-items-stretch mb-2"
148
+ style = { { height : manchetteWithSpaceTimeChartHeight } }
149
+ >
150
+ { projectionData && projectionData . projectedTrains . length > 0 && pathProperties && (
151
+ < >
152
+ < button
153
+ type = "button"
154
+ className = "show-warped-map-button my-3 ml-3 mr-1"
155
+ aria-label = { t ( 'toggleWarpedMap' ) }
156
+ title = { t ( 'toggleWarpedMap' ) }
157
+ onClick = { ( ) => setShowWarpedMap ( ! showWarpedMap ) }
158
+ >
159
+ { showWarpedMap ? < ChevronLeft /> : < ChevronRight /> }
160
+ </ button >
161
+ < SimulationWarpedMap
162
+ collapsed = { ! showWarpedMap }
163
+ pathGeometry = { projectionData . geometry }
164
+ />
149
165
150
- < div className = "osrd-simulation-container d-flex flex-grow-1 flex-shrink-1" >
151
- < div className = "chart-container" >
152
- < ManchetteWithSpaceTimeChartWrapper
153
- operationalPoints = { projectedOperationalPoints }
154
- projectPathTrainResult = { projectionData ?. projectedTrains }
155
- selectedTrainScheduleId = { selectedTrainSchedule ?. id }
156
- waypointsPanelData = { {
157
- filteredWaypoints : filteredOperationalPoints ,
158
- setFilteredWaypoints : setFilteredOperationalPoints ,
159
- projectionPath : projectionData . trainSchedule . path ,
160
- } }
161
- conflicts = { conflictZones }
162
- projectionLoaderData = { projectionData . projectionLoaderData }
163
- />
166
+ < div className = "osrd-simulation-container d-flex flex-grow-1 flex-shrink-1" >
167
+ < div className = "chart-container" >
168
+ < ManchetteWithSpaceTimeChartWrapper
169
+ operationalPoints = { projectedOperationalPoints }
170
+ projectPathTrainResult = { projectionData ?. projectedTrains }
171
+ selectedTrainScheduleId = { selectedTrainSchedule ?. id }
172
+ waypointsPanelData = { {
173
+ filteredWaypoints : filteredOperationalPoints ,
174
+ setFilteredWaypoints : setFilteredOperationalPoints ,
175
+ projectionPath : projectionData . trainSchedule . path ,
176
+ } }
177
+ conflicts = { conflictZones }
178
+ projectionLoaderData = { projectionData . projectionLoaderData }
179
+ height = { manchetteWithSpaceTimeChartHeight - MANCHETTE_HEIGHT_DIFF }
180
+ />
181
+ </ div >
164
182
</ div >
165
- </ div >
166
- </ >
167
- ) }
168
- </ div >
183
+ </ >
184
+ ) }
185
+ </ div >
186
+ </ ResizableSection >
169
187
170
188
{ /* TRAIN : SPACE SPEED CHART */ }
171
189
{ selectedTrainRollingStock && trainSimulation && pathProperties && selectedTrainSchedule && (
0 commit comments