Skip to content

Commit

Permalink
Speed and service details for mattapan
Browse files Browse the repository at this point in the history
  • Loading branch information
devinmatte committed Jan 25, 2025
1 parent 3446102 commit 0a56c8c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions common/constants/baselines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const PEAK_SCHEDULED_SERVICE = {
'line-orange': 161,
'line-blue': 186,
'line-green': 506,
'line-mattapan': 159,
'line-bus': 0,
DEFAULT: 0,
};
Expand All @@ -15,6 +16,7 @@ export const PEAK_SPEED = {
'line-orange': 18,
'line-blue': 20.5,
'line-green': 12.6,
'line-mattapan': 21.6,
'line-bus': 0,
};

Expand Down
2 changes: 1 addition & 1 deletion common/constants/lines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const LINE_OBJECTS: LineObject = {
color: COLORS.mbta.blue,
},
'line-mattapan': {
name: 'Mattapan Trolley',
name: 'Mattapan Line',
short: 'Mattapan',
path: 'mattapan',
key: 'line-mattapan',
Expand Down
6 changes: 3 additions & 3 deletions common/constants/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ export const ALL_PAGES: PageMap = {
key: 'overview',
path: '/',
name: 'Line overview',
lines: ['line-red', 'line-blue', 'line-green', 'line-orange'],
lines: ['line-red', 'line-blue', 'line-green', 'line-orange', 'line-mattapan'],
dateStoreSection: 'overview',
icon: faTableColumns,
},
speed: {
key: 'speed',
path: '/speed',
name: 'Speed',
lines: ['line-red', 'line-orange', 'line-blue', 'line-green'],
lines: ['line-red', 'line-orange', 'line-blue', 'line-green', 'line-mattapan'],
icon: faGaugeHigh,
dateStoreSection: 'line',
},
Expand All @@ -111,7 +111,7 @@ export const ALL_PAGES: PageMap = {
key: 'service',
path: '/service',
name: 'Service',
lines: ['line-red', 'line-orange', 'line-blue', 'line-green'],
lines: ['line-red', 'line-orange', 'line-blue', 'line-green', 'line-mattapan'],
dateStoreSection: 'line',
icon: faClockFour,
},
Expand Down
2 changes: 1 addition & 1 deletion modules/dashboard/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function Overview() {
<div className="grid w-full grid-cols-1 gap-4 md:gap-8 xl:grid-cols-2">
{tab === 'Subway' && <SpeedWidget />}
{tab === 'Subway' && <ServiceWidget />}
<RidershipWidget />
{line !== 'line-mattapan' && <RidershipWidget />}
{tab === 'Subway' && <SlowZonesWidget />}
<div className="grid w-full grid-cols-1 gap-4 md:gap-8 xl:col-span-2 xl:grid-cols-2">
{tab === 'Subway' && lineShort && <AlertsWidget lineShort={lineShort} />}
Expand Down
2 changes: 1 addition & 1 deletion server/chalicelib/speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def trip_metrics_by_line(params: TripMetricsByLineParams):
end_date = params["end_date"]
config = AGG_TO_CONFIG_MAP[params["agg"]]
line = params["line"]
if line not in ["line-red", "line-blue", "line-green", "line-orange"]:
if line not in ["line-red", "line-blue", "line-green", "line-orange", "line-mattapan"]:
raise BadRequestError("Invalid Line key.")
except KeyError:
raise BadRequestError("Missing or invalid parameters.")
Expand Down

0 comments on commit 0a56c8c

Please sign in to comment.