Public
Edited
Aug 6, 2024
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
db = DuckDBClient.of({data: data})
Insert cell
db.query("select * from data")
Insert cell
routes = db.sql`select distinct(route_name) from data`
Insert cell
selectedRouteName = selectRoute
Insert cell
stopsAlongRoute = ROUTE_STOPS[selectedRouteName]
Insert cell
Insert cell
// Plot.plot({
// width: 1200,
// height: 700,
// marginLeft: 100,
// marginRight: 100,
// marginBottom: 100,
// x: {
// tickRotate: 30,
// },
// y: {
// grid: true,
// inset: 6,
// },
// marks: [
// Plot.boxY(route_section, {x: "stop_name", y: "B19013_001" }),
// Plot.dot(route_section, {x: "stop_name", y: "B19013_001", tip: true, opacity: .01}),
// ]
// })
Insert cell
Insert cell
Insert cell


MAINLINE = [
'PORT JERVIS',
'OTISVILLE',
'MIDDLETOWN NY',
'CAMPBELL HALL',
'SALISBURY MILLS-CORNWALL',
'HARRIMAN',
'TUXEDO',
'SLOATSBURG',
'SUFFERN',
'MAHWAH',
'RAMSEY ROUTE 17 STATION',
'RAMSEY',
'ALLENDALE',
'WALDWICK',
'HOHOKUS',
'RIDGEWOOD',
'GLEN ROCK MAIN LINE',
'HAWTHORNE',
'PATERSON',
'CLIFTON',
'PASSAIC',
'DELAWANNA',
'LYNDHURST',
'KINGSLAND',
'FRANK R LAUTENBERG SECAUCUS LOWER LEVEL',
'HOBOKEN',
]
Insert cell


BERGENLINE = [
'PORT JERVIS',
'OTISVILLE',
'MIDDLETOWN NY',
'CAMPBELL HALL',
'SALISBURY MILLS-CORNWALL',
'HARRIMAN',
'TUXEDO',
'SLOATSBURG',
'SUFFERN',
'MAHWAH',
'RAMSEY ROUTE 17 STATION',
'RAMSEY',
'ALLENDALE',
'WALDWICK',
'HOHOKUS',
'RIDGEWOOD',
'GLEN ROCK BORO HALL',
'RADBURN',
'BROADWAY',
'PLAUDERVILLE',
'GARFIELD',
'WESMONT',
'RUTHERFORD',
'FRANK R LAUTENBERG SECAUCUS LOWER LEVEL',
'HOBOKEN',
]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
ROUTE_STOPS = ({
"Atlantic City Rail Line": ACRL,
"Montclair-Boonton Line": MOBO,
"Main Line": MAINLINE,
"Bergen Line": BERGENLINE,
"Pascack Valley Line": PVL,
"Northeast Corridor": NEC,
"Gladstone Branch": GLAD,
"Raritan Valley Line": RVL,
"Morris & Essex Line": ME,
"North Jersey Coast Line": NJCL,
"Princeton Branch": DINKY,
})
Insert cell
ROUTE_COLOR = ({
"Atlantic City Rail Line": "#2E55A5",
"Montclair-Boonton Line": "#C36366",
"Main Line": "#F2B826",
"Bergen Line": "#F2B826",
"Pascack Valley Line": "#A34F8B",
"Northeast Corridor": "#F7505E",
"Gladstone Branch": "#00953B",
"Raritan Valley Line": "#FF993E",
"Morris & Essex Line": "#00953B",
"North Jersey Coast Line": "#009CDB",
"Princeton Branch": "#F7505E",
})
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more