-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin' into feat/green-line-map
- Loading branch information
Showing
19 changed files
with
2,211 additions
and
6,014 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import type { ChartDataset } from 'chart.js'; | ||
|
||
const labels = [ | ||
'🚉 Disabled Train', | ||
'🚪 Door Problem', | ||
'🔌 Power/Wire Issue', | ||
'🚦 Signal Problem', | ||
'🎚️ Switch Problem', | ||
'🛑 Brake Issue', | ||
'🛤️ Track Issue', | ||
`🚧 Track Work`, | ||
`🚙 Cars/Traffic`, | ||
'🔧 Mechanical Problem', | ||
'🌊 Flooding', | ||
'🚓 Police Activity', | ||
'🚑 Medical Emergency', | ||
'🚒 Fire Department Activity', | ||
'Other', | ||
]; | ||
|
||
const backgroundColors = [ | ||
'#dc2626', | ||
'#3f6212', | ||
'#eab308', | ||
'#84cc16', | ||
'#10b981', | ||
'#4c1d95', | ||
'#8b5cf6', | ||
'#f87171', | ||
'#f59e0b', | ||
'#451a03', | ||
'#0ea5e9', | ||
'#1d4ed8', | ||
'#be123c', | ||
'#ea580c', | ||
'#6b7280', | ||
]; | ||
|
||
export const filterOutZeroValues = (delayTotals: number[]) => { | ||
const populatedDelayTotalIdxs = delayTotals.map((delayTotal, idx) => { | ||
return delayTotal > 0 ? idx : -1; | ||
}); | ||
|
||
return { | ||
labels: labels.filter((_, idx) => populatedDelayTotalIdxs[idx] !== -1), | ||
backgroundColors: backgroundColors.filter((_, idx) => populatedDelayTotalIdxs[idx] !== -1), | ||
delayTotals: delayTotals.filter((_, idx) => populatedDelayTotalIdxs[idx] !== -1), | ||
}; | ||
}; | ||
|
||
export const filterOutZeroValueDatasets = (datasets: ChartDataset<'line', number[]>[]) => { | ||
return datasets.filter((dataset) => { | ||
return dataset.data.some((data) => data > 0); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
.slowSegmentLabel { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
height: 100%; | ||
/* This is in weird SVG values btw */ | ||
font-size: 2.5pt; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
height: 100%; | ||
/* This is in weird SVG values btw */ | ||
font-size: 2.5pt; | ||
} | ||
|
||
.slowZoneLabel { | ||
display: flex; | ||
align-items: baseline; | ||
gap: 1.5px; | ||
} | ||
display: flex; | ||
align-items: baseline; | ||
gap: 1.5px; | ||
} |
Oops, something went wrong.