Skip to content

Commit

Permalink
Tweaks to chart format and colors (#835)
Browse files Browse the repository at this point in the history
* Tweaks to chart format and colors

* Linting

* Changes based on feedback

* Change captializations
  • Loading branch information
nathan-weinberg authored Aug 21, 2023
1 parent ebdcb14 commit ae8b1d1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
<!-- Add any other context about the problem here. -->
1 change: 1 addition & 0 deletions .github/workflows/healthcheck.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: healthcheck

on:
workflow_dispatch:
schedule:
- cron: '15 23 * * *' # 7:15PM EST every day

Expand Down
4 changes: 2 additions & 2 deletions common/types/basicWidgets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
10 changes: 6 additions & 4 deletions modules/ridership/RidershipGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const RidershipGraph: React.FC<RidershipGraphProps> = ({
labels,
datasets: [
{
label: `Riders`,
label: `Fare validations`,
borderColor: lineColor,
backgroundColor: hexWithAlpha(lineColor, 0.8),
pointRadius: 0,
Expand All @@ -71,7 +71,9 @@ export const RidershipGraph: React.FC<RidershipGraphProps> = ({

{
// 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,
},
Expand All @@ -97,7 +99,7 @@ export const RidershipGraph: React.FC<RidershipGraphProps> = ({
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)`;
Expand Down Expand Up @@ -139,7 +141,7 @@ export const RidershipGraph: React.FC<RidershipGraphProps> = ({
},
title: {
display: true,
text: 'Trips',
text: 'Fare validations',
color: COLORS.design.subtitleGrey,
},
},
Expand Down
6 changes: 3 additions & 3 deletions modules/service/ServiceGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const ServiceGraph: React.FC<ServiceGraphProps> = ({
),
},
{
label: `MBTA scheduled trips`,
label: `Scheduled round trips`,
stepped: true,
fill: true,
pointBorderWidth: 0,
Expand All @@ -89,7 +89,7 @@ export const ServiceGraph: React.FC<ServiceGraphProps> = ({
},
{
// 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,
},
Expand Down Expand Up @@ -157,7 +157,7 @@ export const ServiceGraph: React.FC<ServiceGraphProps> = ({
},
title: {
display: true,
text: 'trips',
text: 'Round trips',
color: COLORS.design.subtitleGrey,
},
},
Expand Down
3 changes: 2 additions & 1 deletion modules/speed/SpeedGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const SpeedGraph: React.FC<SpeedGraphProps> = ({
datasets: [
{
label: `MPH`,
backgroundColor: COLORS.design.background,
borderColor: LINE_COLORS[line ?? 'default'],
pointRadius: 0,
pointBorderWidth: 0,
Expand All @@ -67,7 +68,7 @@ export const SpeedGraph: React.FC<SpeedGraphProps> = ({
},
{
// 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,
},
Expand Down

0 comments on commit ae8b1d1

Please sign in to comment.