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 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.2",
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.0",
44
- "express": "^4.18.1",
45
- "gtfs": "^3.5.1",
46
- "js-beautify": "^1.14.4",
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": "^15.5.0",
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.5.1",
58
+ "yargs": "^17.6.2",
59
59
  "yoctocolors": "^1.0.0"
60
60
  },
61
61
  "devDependencies": {
62
- "eslint": "^8.20.0",
62
+ "eslint": "^8.27.0",
63
63
  "eslint-config-prettier": "^8.5.0",
64
- "eslint-config-xo": "^0.41.0",
65
- "husky": "^8.0.1",
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
 
@@ -86,7 +86,7 @@
86
86
 
87
87
  feature.properties.routes = feature.properties.routes.map(route => route.route_id)
88
88
 
89
- minifiedGeojson.features.push(feature)
89
+ minifiedGeojson.features.push(_.omit(feature, ['location_type', 'tts_stop_name']))
90
90
  }
91
91
  }
92
92