Skip to content

Commit

Permalink
lint config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
morganherlocker committed Nov 6, 2019
1 parent e608835 commit c5e250f
Show file tree
Hide file tree
Showing 6 changed files with 58,360 additions and 33 deletions.
58,335 changes: 58,333 additions & 2 deletions example/example.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/simulate.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ console.log("running simulations...");
for (var day = 1; day <= days; day++) {
console.log(day + " / " + days);
console.log("- - -");
const time = (start + day * 86400000) + 21600;
const time = start + day * 86400000 + 21600;

for (let provider of providers) {
console.log(" " + provider);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobility-metrics",
"version": "3.0.2",
"version": "4.0.0",
"description": "tools for aggregating mobility data",
"bin": "./src/cli.js",
"scripts": {
Expand Down
4 changes: 1 addition & 3 deletions src/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ const cache = async function(
return config.providers[provider].enabled;
});

const start = Math.round(
+startDay.subtract(config.lost, "days").format("X")
);
const start = Math.round(+startDay.subtract(config.lost, "days").format("X"));
const stop = Math.round(+endDay.format("X"));

const cacheDayPath = path.join(cachePath, reportDay.format("YYYY-MM-DD"));
Expand Down
48 changes: 23 additions & 25 deletions templates/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -991,32 +991,32 @@ <h3 class="info has-text-grey">🔒 $signature$</h3>
});

function render() {
if(!summary["Unique Vehicles"]) {
$("#totalVehiclesDiv").remove()
if (!summary["Unique Vehicles"]) {
$("#totalVehiclesDiv").remove();
}
if(!summary["Active Vehicles"]) {
$("#totalActiveVehiclesDiv").remove()
if (!summary["Active Vehicles"]) {
$("#totalActiveVehiclesDiv").remove();
}
if(!summary["Total Trips"]) {
$("#totalTripsDiv").remove()
if (!summary["Total Trips"]) {
$("#totalTripsDiv").remove();
}
if(!summary["Total Trip Distance"]) {
$("#totalDistanceDiv").remove()
if (!summary["Total Trip Distance"]) {
$("#totalDistanceDiv").remove();
}
if(!summary["Distance Per Vehicle"]) {
$("#avgDistancePerVehicleDiv").remove()
if (!summary["Distance Per Vehicle"]) {
$("#avgDistancePerVehicleDiv").remove();
}
if(!summary["Trips Per Active Vehicle"]) {
$("#tripsPerActiveVehicleDiv").remove()
if (!summary["Trips Per Active Vehicle"]) {
$("#tripsPerActiveVehicleDiv").remove();
}
if(!summary["Avg Trip Distance"]) {
$("#avgTripDistanceDiv").remove()
if (!summary["Avg Trip Distance"]) {
$("#avgTripDistanceDiv").remove();
}
if(!summary["Avg Trip Duration"]) {
$("#avgTripDurationDiv").remove()
if (!summary["Avg Trip Duration"]) {
$("#avgTripDurationDiv").remove();
}
if(!summary["Vehicle Utilization"]) {
$("#avgVehicleUtilizationDiv").remove()
if (!summary["Vehicle Utilization"]) {
$("#avgVehicleUtilizationDiv").remove();
}

if (!data) {
Expand Down Expand Up @@ -1234,7 +1234,7 @@ <h3 class="info has-text-grey">🔒 $signature$</h3>
}
}
if ($("#trip-volume-zones").prop("checked")) {
debugger
debugger;
if (data.tripVolumes.zones[timeLevel][time]) {
geojson["trip-volume"] = JSON.parse(
JSON.stringify(data.geometry.zones)
Expand Down Expand Up @@ -1416,12 +1416,10 @@ <h3 class="info has-text-grey">🔒 $signature$</h3>
geojson["pickups"].features.forEach(f => {
f.properties.value = 0;
});
Object.keys(data.pickups.zones[timeLevel][time]).forEach(
zone => {
geojson["pickups"].features[zone].properties.value =
data.pickups.zones[timeLevel][time][zone];
}
);
Object.keys(data.pickups.zones[timeLevel][time]).forEach(zone => {
geojson["pickups"].features[zone].properties.value =
data.pickups.zones[timeLevel][time][zone];
});
categorize(geojson["pickups"]);
maps["pickups-map"]
.getSource("zones")
Expand Down

0 comments on commit c5e250f

Please sign in to comment.