-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
front: adds warped map in simulation #4995
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #4995 +/- ##
============================================
- Coverage 22.03% 21.62% -0.41%
Complexity 2455 2455
============================================
Files 852 863 +11
Lines 89224 90906 +1682
Branches 2483 2494 +11
============================================
+ Hits 19658 19659 +1
- Misses 68205 69875 +1670
- Partials 1361 1372 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
|
...plications/operationalStudies/components/SimulationResults/SpaceTimeChart/SpaceTimeChart.jsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, nice job !! Thank you for this great work 💪
I tested in local, 1 bug when you rotate the GET
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !! Great job, tested in local :)
Details: - Lots of new utils and helpers to get a transformation that "warps" a part of the map to something straighter - Hacky GeoJSON data loading using an hidden map - Drafts a rendering of the final transformed data
Details: - Deduplicates OSM queried features - Improves rendering and data querying
Details: - Simplifies code structure - Adapts new imports rules (ie "no relative import") - WarpedMap now renders already warped data, and no more calls any data or method from the store - SimulationWarpedMap loads everything it needs from the store (current path, selected train...), handles warping the data, and gives everything to a WarpedMap
Details: - Adds utils/useAsyncMemo to simplify async data retrieving code - Moves `getSimulationHoverPositions` and related helpers from SimulationResultsMap component code to new file SimulationResultsMap/helpers to make them reusable from elsewhere - Uses those helpers to get similar trains to display in SimulationWarpedMap (after some warping magic)
Details: - Updates SpaceTimeChart so that it calls `dispatchUpdateChart` when the graph is updated. I feel like it was missing, since this `dispatchUpdateChart` is called in `drawAllTrain` so the global chart is already "somehow" synchronized with the one in SpaceTimeChart - Allows WarpedMap to be given a bounding box, in which case interactions are disabled - Updates SimulationWarpedMap so that it computes a bounding box to fit SpaceTimeChart viewport, and gives it to WarpedMap
Details: - TrainHoverPosition no more reads train, allowancesSettings and viewport from global store, and requires them in props instead (this allows showing not the selected train, and not in the main map) - Adds the proper trains in the TrainPosition that are not related to the selected train - Adapts SimulationWarpedMap, WarpedMap and SimulationResultsMap to these changes
Most of the updates are: - Adds various comments - Clarifies getWarping output naming - Fixes some comment blocks syntax
be4a7c3
to
a33c757
Compare
This PR solves issue #4882 (closes #4882).
Details:
utils/useAsyncMemo
to help managing asynchronous states in React componentssrc/common/Map/WarpedMap
that displays a map that is warped along a given pathgetWarping.ts
is a good start to understand how the warping worksWarpedMap.tsx
is a reusable isolated componentSimulationWarpedMap.tsx
is a component coupled to simulation stateTrainHoverPosition
to make it usable with a train that is not selected, and with a map that is not the "main" mapSimulationResults
to mount aSimulationWarpedMap
next to theSpaceTimeChart
SpaceTimeChart
so that it properly dispatches anupdateChart
event when the chart changes