gtfs-to-html 2.10.5 → 2.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/index.js +12 -15
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gtfs-to-html.js +12 -15
- package/dist/bin/gtfs-to-html.js.map +1 -1
- package/dist/index.js +12 -15
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/views/default/formatting_functions.pug +8 -1
- package/views/default/overview.pug +1 -1
package/dist/app/index.js
CHANGED
|
@@ -407,7 +407,7 @@ function getAgencyGeoJSON(config2) {
|
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
// package.json
|
|
410
|
-
var version = "2.10.
|
|
410
|
+
var version = "2.10.7";
|
|
411
411
|
|
|
412
412
|
// src/lib/utils.ts
|
|
413
413
|
var isTimepoint = (stoptime) => {
|
|
@@ -869,7 +869,9 @@ var getStopOrder = (timetable, config2) => {
|
|
|
869
869
|
timetable.orderedTrips,
|
|
870
870
|
config2
|
|
871
871
|
);
|
|
872
|
-
const stopIds = longestTripStoptimes.map(
|
|
872
|
+
const stopIds = longestTripStoptimes.map(
|
|
873
|
+
(stoptime) => stoptime.stop_id
|
|
874
|
+
);
|
|
873
875
|
const missingStopIds = difference(
|
|
874
876
|
uniq(
|
|
875
877
|
timetable.orderedTrips.flatMap(
|
|
@@ -880,7 +882,7 @@ var getStopOrder = (timetable, config2) => {
|
|
|
880
882
|
);
|
|
881
883
|
if (missingStopIds.length > 0) {
|
|
882
884
|
timetable.warnings.push(
|
|
883
|
-
`Timetable ${timetable.timetable_id} stops are unable to be topologically sorted and has no \`timetable_stop_order.txt\`. Falling back to using the using the stop order from trip with most stoptimes, but this does not include stop_ids ${
|
|
885
|
+
`Timetable ${timetable.timetable_id} stops are unable to be topologically sorted and has no \`timetable_stop_order.txt\`. Falling back to using the using the stop order from trip with most stoptimes, but this does not include stop_ids ${formatListForDisplay(missingStopIds)}. Try manually specifying stops with \`timetable_stop_order.txt\`. Read more at https://gtfstohtml.com/docs/timetable-stop-order`
|
|
884
886
|
);
|
|
885
887
|
}
|
|
886
888
|
return duplicateStopsForDifferentArrivalDeparture(
|
|
@@ -1458,7 +1460,7 @@ function getFormattedTimetablePage(timetablePageId, config2) {
|
|
|
1458
1460
|
route_ids: uniqueRoutes.map((route) => route.route_id),
|
|
1459
1461
|
agency_ids: uniq(compact(timetableRoutes.map((route) => route.agency_id))),
|
|
1460
1462
|
filename: timetablePage.filename ?? `${timetablePage.timetable_page_id}.html`,
|
|
1461
|
-
timetable_page_label: timetablePage.timetable_page_label ??
|
|
1463
|
+
timetable_page_label: timetablePage.timetable_page_label ?? formatListForDisplay(uniqueRoutes.map((route) => formatRouteName(route)))
|
|
1462
1464
|
};
|
|
1463
1465
|
return formattedTimetablePage;
|
|
1464
1466
|
}
|
|
@@ -1467,7 +1469,7 @@ function generateTimetableHTML(timetablePage, config2) {
|
|
|
1467
1469
|
const templateVars = {
|
|
1468
1470
|
timetablePage,
|
|
1469
1471
|
config: config2,
|
|
1470
|
-
title: `${timetablePage.timetable_page_label} | ${
|
|
1472
|
+
title: `${timetablePage.timetable_page_label} | ${formatListForDisplay(agencies.map((agency) => agency.agency_name))}`
|
|
1471
1473
|
};
|
|
1472
1474
|
return renderTemplate("timetablepage", templateVars, config2);
|
|
1473
1475
|
}
|
|
@@ -1503,11 +1505,12 @@ function generateOverviewHTML(timetablePages, config2) {
|
|
|
1503
1505
|
...first(agencies),
|
|
1504
1506
|
geojson
|
|
1505
1507
|
},
|
|
1508
|
+
// Legacy agency object
|
|
1506
1509
|
agencies,
|
|
1507
1510
|
geojson,
|
|
1508
1511
|
config: config2,
|
|
1509
1512
|
timetablePages: sortedTimetablePages,
|
|
1510
|
-
title: `${
|
|
1513
|
+
title: `${formatListForDisplay(agencies.map((agency) => agency.agency_name))} Timetables`
|
|
1511
1514
|
};
|
|
1512
1515
|
return renderTemplate("overview", templateVars, config2);
|
|
1513
1516
|
}
|
|
@@ -1573,7 +1576,7 @@ function formatStopTime(stoptime, timetable, config2) {
|
|
|
1573
1576
|
timetable.interpolatedStopSymbolUsed = true;
|
|
1574
1577
|
}
|
|
1575
1578
|
}
|
|
1576
|
-
if (stoptime.timepoint === null && stoptime.departure_time === null) {
|
|
1579
|
+
if (stoptime.timepoint === null && stoptime.departure_time === null && stoptime.stop_sequence === null) {
|
|
1577
1580
|
stoptime.skipped = true;
|
|
1578
1581
|
stoptime.classes.push("skipped");
|
|
1579
1582
|
if (timetable.noServiceSymbol !== null) {
|
|
@@ -1834,17 +1837,11 @@ var formatRouteName = (route) => {
|
|
|
1834
1837
|
}
|
|
1835
1838
|
return route.route_long_name ?? "Unknown";
|
|
1836
1839
|
};
|
|
1837
|
-
var
|
|
1838
|
-
return new Intl.ListFormat("en-US", {
|
|
1839
|
-
style: "long",
|
|
1840
|
-
type: "conjunction"
|
|
1841
|
-
}).format(routes.map((route) => formatRouteName(route)));
|
|
1842
|
-
};
|
|
1843
|
-
var formatAgencyNames = (agencies) => {
|
|
1840
|
+
var formatListForDisplay = (list) => {
|
|
1844
1841
|
return new Intl.ListFormat("en-US", {
|
|
1845
1842
|
style: "long",
|
|
1846
1843
|
type: "conjunction"
|
|
1847
|
-
}).format(
|
|
1844
|
+
}).format(list);
|
|
1848
1845
|
};
|
|
1849
1846
|
function mergeTimetablesWithSameId(timetables) {
|
|
1850
1847
|
if (timetables.length === 0) {
|