transitmatters / t-performance-dash

TransitMatters performance visualizer for the MBTA
https://dashboard.transitmatters.org/
MIT License
48 stars 16 forks source link

Fix: Align scheduled/delivered trip counts #993

Closed idreyn closed 1 week ago

idreyn commented 2 weeks ago

Motivation

I've noticed that the scheduled/delivered trip counts graph is getting out of sync. It turns out that we are missing a few data points for each line in the DeliveredTripMetricsWeekly table, which is causing the delivered array for a given date range to be a little shorter than the scheduled one. We should backfill these values, but in the meantime, I've added some code to make sure that the data points on those graphs are always aligned by day. This results in some "holes" in the graph. Maybe there was shuttling that should appear here?

Long term I there should be a single API that returns both scheduled and delivered trip counts in one shot, like /api/service_hours does.

Changes

Before:

Screenshot 2024-06-17 at 21-59-55 Service Data Dashboard

After:

Screenshot 2024-06-17 at 22-00-05 Service Data Dashboard

Testing Instructions

With "Past Year" time range selected, click through the Overview pages for each rapid transit line and verify that they load correctly and appear synchronized.