gtfs-to-html 2.4.2 → 2.4.3
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/CHANGELOG.md +9 -0
- package/lib/utils.js +11 -0
- package/package.json +10 -10
- package/public/js/timetable-map.js +11 -0
- package/views/default/formatting_functions.pug +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.4.3] - 2022-11-10
|
|
9
|
+
|
|
10
|
+
### Updated
|
|
11
|
+
|
|
12
|
+
- Initialize Map with bounds padding
|
|
13
|
+
- Omit unneeded fields from geojson
|
|
14
|
+
- Remove adjacent stoptimes with the same stop_id
|
|
15
|
+
- Dependency updates
|
|
16
|
+
|
|
8
17
|
## [2.4.2] - 2022-07-26
|
|
9
18
|
|
|
10
19
|
### Updated
|
package/lib/utils.js
CHANGED
|
@@ -984,6 +984,17 @@ const addTripContinuation = async (trip, timetable) => {
|
|
|
984
984
|
const filterTrips = (timetable) => {
|
|
985
985
|
let filteredTrips = timetable.orderedTrips;
|
|
986
986
|
|
|
987
|
+
// Remove adjacent stoptimes with the same stop_id
|
|
988
|
+
for (const trip of filteredTrips) {
|
|
989
|
+
trip.stoptimes = trip.stoptimes.filter((stoptime, index) => {
|
|
990
|
+
if (index === 0) {
|
|
991
|
+
return true;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
return stoptime.stop_id !== trip.stoptimes[index - 1].stop_id;
|
|
995
|
+
});
|
|
996
|
+
}
|
|
997
|
+
|
|
987
998
|
// Remove stoptimes for stops not used in timetable
|
|
988
999
|
const timetableStopIds = new Set(timetable.stops.map((stop) => stop.stop_id));
|
|
989
1000
|
for (const trip of filteredTrips) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gtfs-to-html",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
|
|
6
6
|
"keywords": [
|
|
@@ -40,29 +40,29 @@
|
|
|
40
40
|
"archiver": "^5.3.1",
|
|
41
41
|
"cli-table": "^0.3.11",
|
|
42
42
|
"copy-dir": "^1.3.0",
|
|
43
|
-
"csv-stringify": "^6.2.
|
|
44
|
-
"express": "^4.18.
|
|
45
|
-
"gtfs": "^3.
|
|
46
|
-
"js-beautify": "^1.14.
|
|
43
|
+
"csv-stringify": "^6.2.1",
|
|
44
|
+
"express": "^4.18.2",
|
|
45
|
+
"gtfs": "^3.6.1",
|
|
46
|
+
"js-beautify": "^1.14.7",
|
|
47
47
|
"lodash-es": "^4.17.21",
|
|
48
48
|
"moment": "^2.29.4",
|
|
49
49
|
"morgan": "^1.10.0",
|
|
50
50
|
"pretty-error": "^4.0.0",
|
|
51
51
|
"pug": "^3.0.2",
|
|
52
|
-
"puppeteer": "^
|
|
52
|
+
"puppeteer": "^19.2.2",
|
|
53
53
|
"sanitize-filename": "^1.6.3",
|
|
54
54
|
"sqlstring": "^2.3.3",
|
|
55
55
|
"timer-machine": "^1.1.0",
|
|
56
56
|
"toposort": "^2.0.2",
|
|
57
57
|
"untildify": "^4.0.0",
|
|
58
|
-
"yargs": "^17.
|
|
58
|
+
"yargs": "^17.6.2",
|
|
59
59
|
"yoctocolors": "^1.0.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"eslint": "^8.
|
|
62
|
+
"eslint": "^8.27.0",
|
|
63
63
|
"eslint-config-prettier": "^8.5.0",
|
|
64
|
-
"eslint-config-xo": "^0.
|
|
65
|
-
"husky": "^8.0.
|
|
64
|
+
"eslint-config-xo": "^0.43.1",
|
|
65
|
+
"husky": "^8.0.2",
|
|
66
66
|
"prettier": "^2.7.1",
|
|
67
67
|
"pretty-quick": "^3.1.3"
|
|
68
68
|
},
|
|
@@ -82,6 +82,17 @@ function createMap(id, geojson, routes) {
|
|
|
82
82
|
preserveDrawingBuffer: true,
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
+
map.initialize = () =>
|
|
86
|
+
map.fitBounds(bounds, {
|
|
87
|
+
padding: {
|
|
88
|
+
top: 40,
|
|
89
|
+
bottom: 40,
|
|
90
|
+
left: 20,
|
|
91
|
+
right: 40,
|
|
92
|
+
},
|
|
93
|
+
duration: 0,
|
|
94
|
+
});
|
|
95
|
+
|
|
85
96
|
map.scrollZoom.disable();
|
|
86
97
|
map.addControl(new mapboxgl.NavigationControl());
|
|
87
98
|
|