-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Description
Note
The "Shortest travel times journey chain" is also refered as "Analytics" feature (which is actually the name used in the application).
The current "Analytics" feature:
- uses a separate, slower, and unreliable algorithm,
- produces different results than the OD Matrix,
- loses its rendered results when the user pans/zooms the network - the rendering integration is poor - just quick & dirty implemented.
The "Analytics" feature should be refactored to display to travel times and the connections given by the OD Matrix algorithm. Unify the “Analytics” shortest‑path feature with the OD Matrix algorithm so both features use the same computation logic, produce identical travel‑time results, and behave consistently in the UI. The current code should be totally replaced by this, to use a single algorithm for the both features.
The next version of Netzgrafik "Analytics" will only support interactions based on clicking a node.
The following screenshots have been made using this network: analytics.json. When clicking on the "Analytics" button, the view changes, highlighting the departure minutes:
Then we can click on any node (here on node A), and this shows the shortest path to other nodes. Using this shortest path, (1) represents the number of connections to this node and (2) represents the travel time to this node.
However, when we look at the Origin-Destination Matrix for the same network, the results are not the same. For instance, if we click on node F:
The OD Matrix does not output the same result (travel time + connections * penality)
As we have a better trust on the OD Matrix algorithm, we need both features to use the same algorithm, then displaying the same results. The goal is then to refactor the OD Matrix algorithm, to be able to use it elsewhere and generate the shortest path from the clicked node to all other nodes (and not from all nodes to all nodes, which is currently what the OD Matrix algorithm doing).
Mock-ups
The rendering should not be affected by this refactoring, except that the color of the nodes after computation should be based on the travel time, using the same color scale as the OD Matrix does.
Acceptance Criteria
- The OD Matrix feature works the same and display the same results as before the refactoring
- The "Analytics" feature works the same as before and display the same results as the OD Matrix feature, without taking connection penality into account
- Clicking on a node compute "one‑to‑all shortest paths computation"
- In the nodes, the "Total travel time" and "Connections" are displayed:
- "Connections" (number of transfers): displayed on the left side of the node as
#n - "Total travel time" (travel time without any penalty): displayed on the right side of the node, formatted as
hh:mm.
- "Connections" (number of transfers): displayed on the left side of the node as
- The nodes then are colored, using the same color scale as the OD Matrix does, based on the "Total travel time" value
- In the nodes, the "Total travel time" and "Connections" are displayed:
- The trainrun sections part of the computed shortest paths are highlighted (as it is already the case with old "Analytics" feature)
- The transitions part of the computed shortest paths are highlighted (as it is already the case with old "Analytics" feature)
- Clicking on a node compute "one‑to‑all shortest paths computation"
- "Analytics" feature should take active filters into account (as it is already the case for OD Matrix feature)
- Once the "Analytics" is activated and a result is there, it remains visible until another node is clicked, or "Analytics" is explicitly deactivated
- "Analytics" only supports interactions based on clicking a node
- Paning and zooming don't affect the results rendering
- Exports (
.pngand.svg) allow rendered results to be exported
Implementation Plan
- Refactor the OD Matrix algorithm service to make it possible to generate the shortest path from a node to all other nodes (and not from all nodes to all other nodes) and make it available from a service.
- The OD Matrix service should act like an interface that offers:
- all‑to‑all shortest‑path computation (existing behavior)
- one‑to‑all computation (a single row of the matrix)
⚠️ the core algoritm should not be modified, just the endpoints
src/app/services/analytics/origin-destination/components/origin-destination.service.ts
- The OD Matrix service should act like an interface that offers:
- Remove all the existing "Analytics" algorithm code, and use the above service instead
- Populate the "Analytics" rendered values with the OD Matrix algorithm service
- Update the tests (or create new ones) to test the unified algorithm and both endpoints
Tests
Definition of Ready
-
PO/UX-UI
- Mock-ups are complete and validated
- ACs are clear and have been reviewed by another refiner
-
Technical
- Implementation plan has been written and validated by another maintainer
-
General
- Validated by Adrian
Outscope TODOs
This will need to create another issue:
- Extended UI
- such as checkboxes or switches, for the "value" fields and "color" parameter
- Prepare Analytics component for future extension (difficult to imagine from that)