Public
Edited
Jul 16, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
vehicleLocationHistory = fetch("https://mbta-tracker.jmuyskens.workers.dev/?getHours=6").then(d => d.json())
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
schedulesClean
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
inboundSchedules = schedulesClean.filter(d => d.direction_name === "Inbound")
Insert cell
outboundSchedules = schedulesClean.filter(d => d.direction_name === "Outbound")
Insert cell
Insert cell
Insert cell
nextInboundQuincyCenter = inboundSchedules.filter(d => d.arrivalTime >= Date.now() && d.stop_name === "Quincy Center").sort((a, b) => d3.ascending(a.arrivalTime, b.arrivalTime))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
greenbush = FileAttachment("greenbush.geojson").json()
Insert cell
turf = require("@turf/turf@6")
Insert cell
Insert cell
vehiclesClean.map(vehicle => {
const point = turf.nearestPointOnLine(greenbush.features[0].geometry, [vehicle.longitude, vehicle.latitude], {units: 'miles'})
return point
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
oldColonyRouteProgress
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
import {geoMassachusettsMainland} from "@washpostgraphics/state-plane-selector"
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