gtfs-to-html 2.4.2 → 2.4.4
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 +17 -0
- package/lib/utils.js +20 -0
- package/package.json +11 -11
- package/public/js/timetable-map.js +11 -0
- package/views/default/formatting_functions.pug +1 -1
- package/www/package.json +2 -2
- package/www/src/pages/index.js +4 -7
- package/www/src/pages/styles.module.css +15 -7
- package/www/yarn.lock +1228 -1149
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ 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.4] - 2022-12-22
|
|
9
|
+
|
|
10
|
+
### Updated
|
|
11
|
+
|
|
12
|
+
- Use adjacent duplicate stoptimes as arrival/depart if different times
|
|
13
|
+
- Updates to gtfstohtml.com documentation website dependencies
|
|
14
|
+
- Dependency updates
|
|
15
|
+
|
|
16
|
+
## [2.4.3] - 2022-11-10
|
|
17
|
+
|
|
18
|
+
### Updated
|
|
19
|
+
|
|
20
|
+
- Initialize Map with bounds padding
|
|
21
|
+
- Omit unneeded fields from geojson
|
|
22
|
+
- Remove adjacent stoptimes with the same stop_id
|
|
23
|
+
- Dependency updates
|
|
24
|
+
|
|
8
25
|
## [2.4.2] - 2022-07-26
|
|
9
26
|
|
|
10
27
|
### Updated
|
package/lib/utils.js
CHANGED
|
@@ -984,6 +984,26 @@ const addTripContinuation = async (trip, timetable) => {
|
|
|
984
984
|
const filterTrips = (timetable) => {
|
|
985
985
|
let filteredTrips = timetable.orderedTrips;
|
|
986
986
|
|
|
987
|
+
// Combine adjacent stoptimes with the same `stop_id`
|
|
988
|
+
for (const trip of filteredTrips) {
|
|
989
|
+
const combinedStoptimes = [];
|
|
990
|
+
|
|
991
|
+
for (const [index, stoptime] of trip.stoptimes.entries()) {
|
|
992
|
+
if (
|
|
993
|
+
index === 0 ||
|
|
994
|
+
stoptime.stop_id !== trip.stoptimes[index - 1].stop_id
|
|
995
|
+
) {
|
|
996
|
+
combinedStoptimes.push(stoptime);
|
|
997
|
+
} else {
|
|
998
|
+
// The `stoptime` is the same as previous, use `arrival_time` from previous and `departure_time` from this stoptime
|
|
999
|
+
combinedStoptimes[combinedStoptimes.length - 1].departure_time =
|
|
1000
|
+
stoptime.departure_time;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
trip.stoptimes = combinedStoptimes;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
987
1007
|
// Remove stoptimes for stops not used in timetable
|
|
988
1008
|
const timetableStopIds = new Set(timetable.stops.map((stop) => stop.stop_id));
|
|
989
1009
|
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.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
|
|
6
6
|
"keywords": [
|
|
@@ -40,30 +40,30 @@
|
|
|
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.3",
|
|
44
|
+
"express": "^4.18.2",
|
|
45
|
+
"gtfs": "^3.8.0",
|
|
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.4.1",
|
|
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.30.0",
|
|
63
63
|
"eslint-config-prettier": "^8.5.0",
|
|
64
|
-
"eslint-config-xo": "^0.
|
|
65
|
-
"husky": "^8.0.
|
|
66
|
-
"prettier": "^2.
|
|
64
|
+
"eslint-config-xo": "^0.43.1",
|
|
65
|
+
"husky": "^8.0.2",
|
|
66
|
+
"prettier": "^2.8.1",
|
|
67
67
|
"pretty-quick": "^3.1.3"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
@@ -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
|
|
package/www/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"deploy": "docusaurus deploy"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@docusaurus/core": "^2.
|
|
13
|
-
"@docusaurus/preset-classic": "^2.
|
|
12
|
+
"@docusaurus/core": "^2.2.0",
|
|
13
|
+
"@docusaurus/preset-classic": "^2.2.0",
|
|
14
14
|
"clsx": "^1.2.1",
|
|
15
15
|
"react": "^18.2.0",
|
|
16
16
|
"react-dom": "^18.2.0"
|
package/www/src/pages/index.js
CHANGED
|
@@ -48,7 +48,7 @@ function Feature({ imageUrl, title, description }) {
|
|
|
48
48
|
<div className={clsx('col col--4', styles.feature)}>
|
|
49
49
|
{imgUrl && (
|
|
50
50
|
<div className="text--center">
|
|
51
|
-
<img className={styles
|
|
51
|
+
<img className={styles['feature-image']} src={imgUrl} alt="" />
|
|
52
52
|
</div>
|
|
53
53
|
)}
|
|
54
54
|
<h3>{title}</h3>
|
|
@@ -65,7 +65,7 @@ function Home() {
|
|
|
65
65
|
title="GTFS-to-HTML"
|
|
66
66
|
description="GTFS-to-HTML creates human-readable, user-friendly transit timetables in HTML format directly from GTFS transit data."
|
|
67
67
|
>
|
|
68
|
-
<header className={clsx('hero hero--dark', styles
|
|
68
|
+
<header className={clsx('hero hero--dark', styles['hero-banner'])}>
|
|
69
69
|
<div className="container">
|
|
70
70
|
<div className="row">
|
|
71
71
|
<div className="col col--4">
|
|
@@ -88,7 +88,7 @@ function Home() {
|
|
|
88
88
|
<Link
|
|
89
89
|
className={clsx(
|
|
90
90
|
'button button--outline button--secondary button--lg',
|
|
91
|
-
styles
|
|
91
|
+
styles['hero-button']
|
|
92
92
|
)}
|
|
93
93
|
to={useBaseUrl('docs/')}
|
|
94
94
|
>
|
|
@@ -112,10 +112,7 @@ function Home() {
|
|
|
112
112
|
</section>
|
|
113
113
|
)}
|
|
114
114
|
|
|
115
|
-
<section
|
|
116
|
-
style={{ backgroundColor: 'hsl(0, 0%, 85%)' }}
|
|
117
|
-
className="padding--lg"
|
|
118
|
-
>
|
|
115
|
+
<section className={clsx('padding--lg', styles['gray-section'])}>
|
|
119
116
|
<div className="container">
|
|
120
117
|
<div className="row">
|
|
121
118
|
<div className="col"></div>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* and scoped locally.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
.
|
|
8
|
+
.hero-banner {
|
|
9
9
|
padding: 4rem 0;
|
|
10
10
|
text-align: center;
|
|
11
11
|
position: relative;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
@media screen and (max-width: 966px) {
|
|
16
|
-
.
|
|
16
|
+
.hero-banner {
|
|
17
17
|
padding: 2rem;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -24,12 +24,20 @@
|
|
|
24
24
|
justify-content: center;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.
|
|
28
|
-
color: #
|
|
27
|
+
.hero-button {
|
|
28
|
+
color: #ffffff !important;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.
|
|
32
|
-
color: #333!important;
|
|
31
|
+
.hero-button:hover {
|
|
32
|
+
color: #333 !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.gray-section {
|
|
36
|
+
background-color: hsl(0, 0%, 85%);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[data-theme='dark'] .gray-section {
|
|
40
|
+
background-color: rgb(94, 94, 94);
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
.features {
|
|
@@ -39,7 +47,7 @@
|
|
|
39
47
|
width: 100%;
|
|
40
48
|
}
|
|
41
49
|
|
|
42
|
-
.
|
|
50
|
+
.feature-image {
|
|
43
51
|
height: 200px;
|
|
44
52
|
width: 200px;
|
|
45
53
|
}
|