Skip to content
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

Adding a speed segment map to speed page #1045

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

devinmatte
Copy link
Member

@devinmatte devinmatte commented Feb 27, 2025

Motivation

Changes

Screenshot 2025-02-26 at 9 28 02 PM

Screenshot 2025-02-26 at 10 11 23 PM

Testing Instructions

@github-actions github-actions bot added backend Change to backend code frontend Change to frontend code labels Feb 27, 2025
Comment on lines +33 to +39
export const filterActiveElements = <T extends Record<string, unknown>>(
records: T[],
targetLine: LineShort,
targetDate: Date,
getRecordDateRange: (t: T) => [Date, Date],
getRecordLine: (t: T) => LineShort
) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Quality Violation

Too many parameters (5). Maximum allowed is 4. (...read more)

Having too many parameters can make your code hard to read. The parameters must be used in appropriate order. Forgetting the order of parameters can cause mistakes.

Too many parameters is a code smell. You should refactor your code in smaller reusable bits. While it may be valid to require more than four parameters, you should use object destructuring.

View in Datadog  Leave us feedback  Documentation

Comment on lines 52 to 60
// TODO: Pull from dynamo calculated hourly in data-ingestion
const speedData = TEST_DATA.map((data) => {
const intervalDistance = getStationDistance(data.from_id, data.to_id);

return {
...data,
speed: convertSecondsToMph(data.travel_time, intervalDistance),
};
});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not merge until this is pulling from real data

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Real data relies on https://github.com/transitmatters/slow-zones/pull/65 first getting merged

@devinmatte devinmatte self-assigned this Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Change to backend code frontend Change to frontend code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant