diff --git a/lib/get-spectrogram-data.js b/lib/get-spectrogram-data.js index b3ee634..3a3d792 100644 --- a/lib/get-spectrogram-data.js +++ b/lib/get-spectrogram-data.js @@ -14,7 +14,7 @@ const MAX_TRIP_LENGTH = 120 // minutes * marginal opportunities reachable in 120 minutes] */ export default function getSpectrogramData ({origin, query, stopTreeCache, grid}) { - let output = [] + const output = [] for (let i = 0; i < origin.nMinutes; i++) output.push(new Uint32Array(MAX_TRIP_LENGTH)) propagate({ @@ -35,7 +35,7 @@ export default function getSpectrogramData ({origin, query, stopTreeCache, grid} const val = grid.data[gridy * grid.width + gridx] for (let i = 0; i < travelTimesForDest.length; i++) { - let time = travelTimesForDest[i] + const time = travelTimesForDest[i] if (time === 255) continue // unreachable if (time < MAX_TRIP_LENGTH) { diff --git a/lib/propagation.js b/lib/propagation.js index 3a9ab74..fc5a90a 100644 --- a/lib/propagation.js +++ b/lib/propagation.js @@ -56,12 +56,12 @@ export default function propagate ({ query, stopTreeCache, origin, callback }) { // no need to check that travelTimeToPixel < 255 as travelTimesForDest[minute] is preinitialized to the nontransit time or 255 if (travelTimesForDest[minute] > travelTimeToPixel) { travelTimesForDest[minute] = travelTimeToPixel - let inVehicle = inVehicleTravelTimesForDest[minute] = origin.data[offset + 1] - let wait = waitTimesForDest[minute] = origin.data[offset + 2] + const inVehicle = inVehicleTravelTimesForDest[minute] = origin.data[offset + 1] + const wait = waitTimesForDest[minute] = origin.data[offset + 2] // NB when we're talking about a particular trip, then walk + wait + inVehicle == total // However if you calculate summary statistics for each of these individually, that may // not be true. So we need to calculate walk here and explicitly calculate summary stats about it. - let walkTime = travelTimeToPixel - wait - inVehicle + const walkTime = travelTimeToPixel - wait - inVehicle walkTimesForDest[minute] = walkTime } }