-
Notifications
You must be signed in to change notification settings - Fork 2
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
[tweak] Disruption diagram maths #1830
Merged
hannahpurcell
merged 4 commits into
cm/disruption-diagram-frontend
from
hp/disruption-diagram-maths
Aug 3, 2023
Merged
[tweak] Disruption diagram maths #1830
hannahpurcell
merged 4 commits into
cm/disruption-diagram-frontend
from
hp/disruption-diagram-maths
Aug 3, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 task
Coverage of commit
|
Coverage of commit
|
hannahpurcell
commented
Aug 3, 2023
assets/src/components/v2/disruption_diagram/disruption_diagram.tsx
Outdated
Show resolved
Hide resolved
Coverage of commit
|
cmaddox5
approved these changes
Aug 3, 2023
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.
Looks so much more polished! Thanks!
Coverage of commit
|
cmaddox5
added a commit
that referenced
this pull request
Aug 3, 2023
* Adjusted takeover logic. * Added slot_name and widget_type for left body alerts. * Added specs to help track returns. * Added new updated_at field to response. * Added direction_id to route pills. * New alert helper function. * Changed some serializer functions. * Changed updated_at comparison to only look at Date. * Change and to & in util function. * Finished fullscreen serializer functions. * Fixed error when direction_id is nil. * Updated takeover text. * Added headsign to route_pills. * Changed serializer so flexzone pills don't show headsign. * Fixed suspension remedy. * Added PIO text to fullscreen delays. * Made an attribute optional. * Changed get_route_pills so flexzone alerts get the same pills as before. * Fixed some WidgetInstance functions. * Headsign isn't always there so removed it from function pattern. * Fixed tests. * Added region to fullscreen alert functions. * Lots of route pill changes. * Updated route pills and downstream responses. * Changed headsign pills to filenames. * Added/updated tests. * Reverted some changes to route pill serialization. * Fixed test. * Removed changes to test files. Will put them in separate branch. * Reverted some route pill logic. * Fixed parameters. * Added needed svgs * Built new single page alert component * Added styles * Improved typing. * Changed empty string fallback to nil for fullscreen. * Added station_closure function for transfer stations. * Added transfer station case for bypassed stations * Initial type definitions for disruption diagram * Updates to takeover responses. * Rename some types to avoid name clash with builtins + adhere more closely to terms used in designs * Add an alternate, more declarative/concise proposed typing * Add a missing comma * Abbreviated Mass Ave. * Added region to fullscreen responses. * Updated function to only make pills for affected routes at home stop. * Fixed timezone issue. * New function for formatting routes for inside station closures. * Added back serializer for inside flex zone delay alerts. * Changed widget_type. * Stopped GL from always being added to the list. * Clean up * Stub out DisruptionDiagram component * Changed function to only be called by alerts that need it. * Fixed station closure takeover for multiline stations. * Added type. * Fixed issue for suspension/shuttle at multiline stations. * Allow for blank cause * Changed how cause is sent to client. * Fixed types. * Changed route pill response for whole line pills. * Added endpoints to response so we don't need FreeText. * feat: Pre-Fare alerts 2.0 CandidateGenerator (#1765) * Added branching logic for picking fullscreen prefare alerts. * Moved functions so modules that are not WidgetInstances can use them. Will clean up later. * Added a list for common parameters. * Fixed value. * Added distance logic for alerts with non-GL informed routes. * Corrected filter. * Fixed existing tests. * Improved tests. * Added a function to more efficiently get distances. Thanks Jon. * Added distance logic for GL. * Fixed filter for moderate delays. * Credo. * Fixed dialyzer issues. * Removed delays from immediate disruptions. * Changed how distances are merged. * Added a spec. * Improved GL distance logic. * Added a helper function for severity level. * Added a comment. * Changed distance logic so only branch stops use Kenmore as a reference point. * Finished the solid line map and initial math needed for spacing. * Fixed colors. * Changed icon if middle slot is the current stop. * Added background for suspensions. * Added icons for station_clousre. * Added currentStop icon for endpoints. * Remove ElevatorStatus.t() from possible types of LocalizedAlert.t() -- it is not compatible with the module's functions and we never pass one to them * Moved effect background to separate component. * Changed some icons to components. * Started on alert emphasis. * Polished up alert emphasis. * Prevent station closures from showing emphasis. * Fixed effect background and affected icons. * Started on labels. * Label changes. * Added examples for testing. * Added labels and adjusted positioning of emphasis. * Improvements to effect background and emphasis positioning. * Some cleanup and added initial resizing logic. * Added more endpoint labels. * Added label text classes. * Tweaked math for emphasis. * Tweaked shuttle dashes. * Added more mock data. * Added space for map on takeover alerts. * feat(WIP): Disruption diagram backend. Working for Blue Line and other basic scenarios only atm. * Fixed label map. * Fixed some positioning. * Changed diagram so it can use real data. * WIP Handle Orange Line scenarios -- not quite working yet * Add Arrays dependency * Ignore non-subway when looking up alert's informed route * Determine informed route more reliably * Use a different library (aja) that is better!!! * Use Aja.Vector for base array implementation * Finish updating Builder. ALSO: make end region have lowest precedence * Update metadata after (hopefully) all operations that change sequence. Make separate fn clauses for splitting out 0 end stops--Vector.split does not always behave the way we want for that * Guard against omitting 0 or 1 stop(s) since it does not shrink the diagram--currently with additional debug logging. Plus some other tweaks and fixes from cm/disruption-diagram-backend-tweaks * Pull in Christian's changes to ReconstructedAlert * Use a more descriptive fallback clause in filter fn * Fixed emphasis when closure is only 2 stations. * Fix failure condition in omit_stops * Fixed current stop icons for ends. * Move serialize into Builder module * Update end_count/1 to work with left_end and right_end fields * Add some more TODOs for edge cases * Handle Red Line branching scenarios * Remove part of validation--it did not work, and the working code is now in Builder.new * Fixed suspension background length. * Allow overflow so longer text still shows. * Allowed undefined in props. * Took out backend changes. * Removed pills. * Added missing destination. * Fixed how length of stop range is calculated. * Added scaling. * Remove TODO * Changed variable names. * Fixed comment. * Adjusted translation so the whole diagram is in the viewbox. * [tweak] Disruption diagram maths (#1830) * Update assets/src/components/v2/disruption_diagram/disruption_diagram.tsx Co-authored-by: Hannah Purcell <[email protected]> --------- Co-authored-by: Hannah Purcell <[email protected]> Co-authored-by: Jon Zimbel <[email protected]> Co-authored-by: Hannah Purcell <[email protected]>
hannahpurcell
added a commit
that referenced
this pull request
Feb 2, 2024
* feat: Pre-Fare alerts 2.0 CandidateGenerator (#1765) * [feature] Pre-fare alert 2.0 frontend left screen (#1787) * feat: Pre-Fare alerts 2.0 serializer (#1785) * feat: Disruption Diagram - Frontend (#1825) * [tweak] Disruption diagram maths (#1830) * In LocationContext, tag stop sequences by their routes (#1832) * tweak: PreFare simulations (#1837) * [feature] Prefare alerts 2.0 audio (#1824) * feat: Disruption Diagram - Backend (#1828) * feat(WIP): Disruption diagram backend. Working for Blue Line and other basic scenarios only atm. * fix: Update location context stop sequences field in TrainCrowdingTest (#1895) * test: D. diagram unit test for RL trunk statio closure with home stop at Ashmont (#1894) * Added padding-top to layout when there is no banner. (#1902) * Cm/govt ctr gl affected pill fix (#1898) * Cm/adjust diagram size positioning (#1896) * Changed label to display on a single line. (#1899) * Tweaked resizer logic so it maxHeight matches the card height on page. (#1905) * Removed bolding of 'to' from arrow labels. (#1908) * Fixed icon display when current stop is affected. (#1903) * feat: Consistent description of disrupted stop ranges throughout pre-fare alerts (#1912) * Adjusted Ashmont/Braintree destination to proper formatting (#1917) * Refactor disruption diagram SVG (#1914) * Log alert ID and screen's home stop when disruption diagram logic fails (#1920) * polish: Recalculate dimensions in hook (#1921) * Added audio column to GL & PreFare in admin table (#1916) * Draw D. diagrams for multi-line alerts when home stop narrows it to 1 line (#1922) * fix: PreFare Polish - Inside shuttle (#1941) * fix: Pre-fare polish - Boundary alerts banner (#1945) * fix: Pre-fare polish -- Text only resizes for bypassed stations (#1946) * fix: Pre-fare polish -- Station closed takeover text wrapping (#1947) * Downstream shuttle endpoint should be a circle (#1948) * Label splitting logic was buggy (#1949) * Prefare format in config is "Ashmont & Braintree" not "Ashmont/Braintree" (#1954) * Sub-header for takeover alert is now regular weight (#1955) * fix: Prefare alerts polish -- Fix GL headsign in various cases (#1957) * fix: Prefare polish -- Use FreeText to prevent station text wrapping in subheaders (#1956) * fix: Prefare polish -- Alerts that break assumptions use the fallback case (#1958) * fix: Prefare polish -- Reorder audio with alerts before subway status (#1962) * fix: Prefare polish -- New abbreviation rule (#1961) * fix: Prefare Alerts polish -- RL headsigns for branch-only alerts (#1967) * fix: Prefare alerts polish -- Screenplay sim sizing / page layout (#1966) * fix: Prefare polish -- "via" diagram labels need abbreviating (#1968) --------- Co-authored-by: Christian Maddox <[email protected]> Co-authored-by: Jon Zimbel <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In order of changes: