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

Fix landing chart data labels #1030

Merged
merged 1 commit into from
Feb 5, 2025
Merged

Conversation

PatrickCleary
Copy link
Member

@PatrickCleary PatrickCleary commented Feb 5, 2025

Motivation

I have been noticing missing data labels on the landing pages. See below:
Screenshot 2025-02-05 at 2 03 23 PM

**Expected: **
Screenshot 2025-02-05 at 2 03 41 PM

Changes

The issue is that the labels for the chart were naively generated under the assumption that all weeks would have data for every line (my fault, I wrote this code). So it only looks at red line data to generate the data labels.

So it looks at the return trip_metrics json file and uses that to generate the labels. see here: https://dashboard.transitmatters.org/static/landing/trip_metrics.json

Currently, there was no data for the week 2024-11-18 in the dataset for the red line (another possible fix would be to generate empty data for weekly aggregates rather than exclude the data).

This caused the labels for the data to be misaligned and causes issues not only with the missing labels, but also all of the datasets were aligned on the dates present on the red line, and gaps weren't appearing in the proper locations.

Upon further review I am pretty sure this issue stems from weekly red line data being missing. I see that for the green line, weeks with no data generate entries with values of 0 but not for the red line.

I tried to take a look at this but couldn't find my AWS credentials. Maybe another day.

Regardless, this change is probably good to have.

Testing Instructions

Verify that the results on each of the landing page charts aligns with the expected data from this endpoint: https://dashboard.transitmatters.org/static/landing/trip_metrics.json

You can also compare the dataset to the existing landing page charts and see there are errors. For example, there is data for 11/18/2024 for the green line in the dataset, but the production site does not show it.

@github-actions github-actions bot added the frontend Change to frontend code label Feb 5, 2025
@PatrickCleary PatrickCleary force-pushed the fix/landing-chart-labels branch from eea22bb to 943701c Compare February 5, 2025 19:24
@PatrickCleary PatrickCleary marked this pull request as ready for review February 5, 2025 19:26
@PatrickCleary PatrickCleary self-assigned this Feb 5, 2025
Copy link
Member

@devinmatte devinmatte left a comment

Choose a reason for hiding this comment

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

🫡

@PatrickCleary
Copy link
Member Author

Added follow up issue
#1031

@PatrickCleary PatrickCleary merged commit aa95fa7 into main Feb 5, 2025
4 checks passed
@PatrickCleary PatrickCleary deleted the fix/landing-chart-labels branch February 5, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Change to frontend code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants