From ae8b1d10cb590dbf644ce24706350fe0e384936c Mon Sep 17 00:00:00 2001 From: Nathan Weinberg <31703736+nathan-weinberg@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:53:59 -0400 Subject: [PATCH] Tweaks to chart format and colors (#835) * Tweaks to chart format and colors * Linting * Changes based on feedback * Change captializations --- .github/ISSUE_TEMPLATE/bug_report.md | 4 ++-- .github/workflows/healthcheck.yml | 1 + common/types/basicWidgets.tsx | 4 ++-- modules/ridership/RidershipGraph.tsx | 10 ++++++---- modules/service/ServiceGraph.tsx | 6 +++--- modules/speed/SpeedGraph.tsx | 3 ++- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d1f355f6d..5f31a1471 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,8 +26,8 @@ Steps to reproduce the behavior: **Device Info (please complete the following information):** - Device: [e.g. iPhone 6, Laptop] - OS: [e.g. iOS, Windows] - - Browser: [e.g. chrome, safari] - - Version: [e.g. 22] + - Browser: [e.g. Chrome, Safari] + - Browser Version: [e.g. 22] **Additional context** diff --git a/.github/workflows/healthcheck.yml b/.github/workflows/healthcheck.yml index f707dfec7..473907664 100644 --- a/.github/workflows/healthcheck.yml +++ b/.github/workflows/healthcheck.yml @@ -1,6 +1,7 @@ name: healthcheck on: + workflow_dispatch: schedule: - cron: '15 23 * * *' # 7:15PM EST every day diff --git a/common/types/basicWidgets.tsx b/common/types/basicWidgets.tsx index 3ab99a1b7..1a813d34d 100644 --- a/common/types/basicWidgets.tsx +++ b/common/types/basicWidgets.tsx @@ -145,7 +145,7 @@ export class PercentageWidgetValue extends BaseWidgetValue implements WidgetValu export class TripsWidgetValue extends BaseWidgetValue implements WidgetValueInterface { getUnits() { - return 'Trips'; + return 'Round trips'; } getFormattedValue(isLarge?: boolean) { @@ -188,7 +188,7 @@ export class MPHWidgetValue extends BaseWidgetValue implements WidgetValueInterf export class RidersWidgetValue extends BaseWidgetValue implements WidgetValueInterface { getUnits() { - return 'Riders'; + return 'Fare validations'; } getFormattedValue(isLarge?: boolean) { diff --git a/modules/ridership/RidershipGraph.tsx b/modules/ridership/RidershipGraph.tsx index 00561396d..f5516cc3c 100644 --- a/modules/ridership/RidershipGraph.tsx +++ b/modules/ridership/RidershipGraph.tsx @@ -58,7 +58,7 @@ export const RidershipGraph: React.FC = ({ labels, datasets: [ { - label: `Riders`, + label: `Fare validations`, borderColor: lineColor, backgroundColor: hexWithAlpha(lineColor, 0.8), pointRadius: 0, @@ -71,7 +71,9 @@ export const RidershipGraph: React.FC = ({ { // This null dataset produces the entry in the legend for the peak annotation. - label: `Historical Maximum (${PEAK_RIDERSHIP[routeIndex ?? 'DEFAULT']})`, + label: `Historical Maximum (${PEAK_RIDERSHIP[ + routeIndex ?? 'DEFAULT' + ].toLocaleString('en-us')} fare validations)`, backgroundColor: CHART_COLORS.ANNOTATIONS, data: null, }, @@ -97,7 +99,7 @@ export const RidershipGraph: React.FC = ({ callbacks: { ...callbacks, label: (context) => { - return `${context.parsed.y} (${( + return `${context.parsed.y.toLocaleString('en-us')} (${( (100 * context.parsed.y) / PEAK_RIDERSHIP[routeIndex ?? 'DEFAULT'] ).toFixed(1)}% of historical maximum)`; @@ -139,7 +141,7 @@ export const RidershipGraph: React.FC = ({ }, title: { display: true, - text: 'Trips', + text: 'Fare validations', color: COLORS.design.subtitleGrey, }, }, diff --git a/modules/service/ServiceGraph.tsx b/modules/service/ServiceGraph.tsx index fe8193e89..5921e9098 100644 --- a/modules/service/ServiceGraph.tsx +++ b/modules/service/ServiceGraph.tsx @@ -73,7 +73,7 @@ export const ServiceGraph: React.FC = ({ ), }, { - label: `MBTA scheduled trips`, + label: `Scheduled round trips`, stepped: true, fill: true, pointBorderWidth: 0, @@ -89,7 +89,7 @@ export const ServiceGraph: React.FC = ({ }, { // This null dataset produces the entry in the legend for the baseline annotation. - label: `Historical Maximum (${peak})`, + label: `Historical Maximum (${peak.toLocaleString('en-us')} round trips)`, backgroundColor: CHART_COLORS.ANNOTATIONS, data: null, }, @@ -157,7 +157,7 @@ export const ServiceGraph: React.FC = ({ }, title: { display: true, - text: 'trips', + text: 'Round trips', color: COLORS.design.subtitleGrey, }, }, diff --git a/modules/speed/SpeedGraph.tsx b/modules/speed/SpeedGraph.tsx index 8f9d7d5b9..a7d02d84e 100644 --- a/modules/speed/SpeedGraph.tsx +++ b/modules/speed/SpeedGraph.tsx @@ -53,6 +53,7 @@ export const SpeedGraph: React.FC = ({ datasets: [ { label: `MPH`, + backgroundColor: COLORS.design.background, borderColor: LINE_COLORS[line ?? 'default'], pointRadius: 0, pointBorderWidth: 0, @@ -67,7 +68,7 @@ export const SpeedGraph: React.FC = ({ }, { // This null dataset produces the entry in the legend for the baseline annotation. - label: `Historical Maximum (${peak})`, + label: `Historical Maximum (${peak} mph)`, backgroundColor: CHART_COLORS.ANNOTATIONS, data: null, },