Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLX stops, Medford Branch #79

Merged
merged 12 commits into from
Dec 11, 2022
35 changes: 33 additions & 2 deletions src/lines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import { start, line, wiggle, stationRange } from './paths';
import { Line, LineShape } from './types';

const GLStations = {
MedfordTufts: 'place-mdftf',
BallSqaure: 'place-balsq',
MagounSquare: 'place-mgngl',
GilmanSquare: 'place-gilmn',
EastSomerville: 'place-esomr',
UnionSquare: 'place-unsqu',
Lechemere: 'place-lech',
SciencePark: 'place-spmnl',
Expand All @@ -24,8 +29,15 @@ const GLStations = {
Prudential: 'place-prmnl',
} as const;

const glxStations = [
GLStations.MedfordTufts,
GLStations.BallSqaure,
GLStations.MagounSquare,
GLStations.GilmanSquare,
GLStations.EastSomerville,
];

const glSharedStations = [
GLStations.UnionSquare,
GLStations.Lechemere,
GLStations.SciencePark,
GLStations.NorthStation,
Expand All @@ -38,6 +50,8 @@ const glSharedStations = [
];

const labeledGreenLineStations = [
GLStations.MedfordTufts,
GLStations.UnionSquare,
...glSharedStations,
GLStations.Hynes,
GLStations.Kenmore,
Expand All @@ -48,7 +62,6 @@ const labeledGreenLineStations = [
];

const greenShared: LineShape[] = [
start(0, 0, 90),
stationRange({
stations: glSharedStations,
commands: [line(100)],
Expand All @@ -65,6 +78,7 @@ const greenBCDTrunk: LineShape[] = [
];

const greenBShape: LineShape[] = [
start(0, 0, 90),
...greenShared,
...greenBCDTrunk,
wiggle(30, -20),
Expand All @@ -76,6 +90,7 @@ const greenBShape: LineShape[] = [
];

const greenCShape: LineShape[] = [
start(0, 0, 90),
...greenShared,
...greenBCDTrunk,
line(30),
Expand All @@ -87,6 +102,12 @@ const greenCShape: LineShape[] = [
];

const greenDShape: LineShape[] = [
start(-20, -31, 90),
stationRange({
stations: [GLStations.UnionSquare],
commands: [line(1)],
}),
wiggle(30, 20),
...greenShared,
...greenBCDTrunk,
wiggle(30, 20),
Expand All @@ -98,6 +119,13 @@ const greenDShape: LineShape[] = [
];

const greenEShape: LineShape[] = [
start(0, -55, 90),
stationRange({
start: GLStations.MedfordTufts,
end: GLStations.EastSomerville,
commands: [line(40)],
}),
line(15),
...greenShared,
wiggle(60, 40),
stationRange({
Expand All @@ -116,6 +144,9 @@ export const greenLine: Line = {
if (labeledGreenLineStations.includes(stationId)) {
return stationId === GLStations.Hynes ? 'left' : 'right';
}
if (isRouteFocused && glxStations.includes(stationId)) {
return 'right';
}
if (isRouteFocused) {
return routeId === 'Green-E' ? 'left' : 'right';
}
Expand Down