gtfs-to-html 2.3.2 → 2.3.5
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 +19 -0
- package/app/index.js +1 -0
- package/lib/log-utils.js +2 -2
- package/package.json +15 -15
- package/public/js/timetable-map.js +5 -5
- package/views/default/formatting_functions.pug +31 -0
- package/views/default/timetablepage.pug +2 -5
- package/www/package.json +4 -4
- package/www/yarn.lock +2275 -2210
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,25 @@ 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.3.5] - 2022-04-26
|
|
9
|
+
|
|
10
|
+
### Updated
|
|
11
|
+
|
|
12
|
+
- Dependency updates
|
|
13
|
+
|
|
14
|
+
## [2.3.4] - 2022-04-09
|
|
15
|
+
|
|
16
|
+
### Updated
|
|
17
|
+
|
|
18
|
+
- Remove route info from map geojson
|
|
19
|
+
- Dependency updates
|
|
20
|
+
|
|
21
|
+
## [2.3.3] - 2022-01-21
|
|
22
|
+
|
|
23
|
+
### Updated
|
|
24
|
+
|
|
25
|
+
- Dependency updates
|
|
26
|
+
|
|
8
27
|
## [2.3.2] - 2021-12-28
|
|
9
28
|
|
|
10
29
|
### Updated
|
package/app/index.js
CHANGED
package/lib/log-utils.js
CHANGED
|
@@ -205,12 +205,12 @@ export function progressBar(formatString, barTotal, config) {
|
|
|
205
205
|
config.log(renderProgressString(), true);
|
|
206
206
|
|
|
207
207
|
return {
|
|
208
|
-
interrupt
|
|
208
|
+
interrupt(text) {
|
|
209
209
|
// Log two lines to avoid overwrite by progress bar
|
|
210
210
|
config.logWarning(text);
|
|
211
211
|
config.logWarning('');
|
|
212
212
|
},
|
|
213
|
-
increment
|
|
213
|
+
increment() {
|
|
214
214
|
barProgress += 1;
|
|
215
215
|
config.log(renderProgressString(), true);
|
|
216
216
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gtfs-to-html",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
|
|
6
6
|
"keywords": [
|
|
@@ -37,33 +37,33 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@turf/helpers": "^6.5.0",
|
|
39
39
|
"@turf/simplify": "^6.5.0",
|
|
40
|
-
"archiver": "^5.3.
|
|
41
|
-
"chalk": "^5.0.
|
|
40
|
+
"archiver": "^5.3.1",
|
|
41
|
+
"chalk": "^5.0.1",
|
|
42
42
|
"cli-table": "^0.3.11",
|
|
43
43
|
"copy-dir": "^1.3.0",
|
|
44
|
-
"csv-stringify": "^6.0.
|
|
45
|
-
"express": "^4.
|
|
46
|
-
"gtfs": "^3.
|
|
47
|
-
"js-beautify": "^1.14.
|
|
44
|
+
"csv-stringify": "^6.0.5",
|
|
45
|
+
"express": "^4.18.0",
|
|
46
|
+
"gtfs": "^3.3.0",
|
|
47
|
+
"js-beautify": "^1.14.3",
|
|
48
48
|
"lodash-es": "^4.17.21",
|
|
49
|
-
"moment": "^2.29.
|
|
49
|
+
"moment": "^2.29.3",
|
|
50
50
|
"morgan": "^1.10.0",
|
|
51
51
|
"pretty-error": "^4.0.0",
|
|
52
52
|
"pug": "^3.0.2",
|
|
53
|
-
"puppeteer": "^13.0
|
|
53
|
+
"puppeteer": "^13.6.0",
|
|
54
54
|
"sanitize-filename": "^1.6.3",
|
|
55
|
-
"sqlstring": "^2.3.
|
|
55
|
+
"sqlstring": "^2.3.3",
|
|
56
56
|
"timer-machine": "^1.1.0",
|
|
57
57
|
"toposort": "^2.0.2",
|
|
58
58
|
"untildify": "^4.0.0",
|
|
59
|
-
"yargs": "^17.
|
|
59
|
+
"yargs": "^17.4.1"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"eslint": "^8.
|
|
63
|
-
"eslint-config-prettier": "^8.
|
|
64
|
-
"eslint-config-xo": "^0.
|
|
62
|
+
"eslint": "^8.14.0",
|
|
63
|
+
"eslint-config-prettier": "^8.5.0",
|
|
64
|
+
"eslint-config-xo": "^0.40.0",
|
|
65
65
|
"husky": "^7.0.4",
|
|
66
|
-
"prettier": "^2.
|
|
66
|
+
"prettier": "^2.6.2",
|
|
67
67
|
"pretty-quick": "^3.1.3"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
@@ -24,8 +24,8 @@ function formatRoute(route) {
|
|
|
24
24
|
return html.prop('outerHTML');
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function formatStopPopup(feature) {
|
|
28
|
-
const
|
|
27
|
+
function formatStopPopup(feature, routes) {
|
|
28
|
+
const routeIds = JSON.parse(feature.properties.routes);
|
|
29
29
|
const html = $('<div>');
|
|
30
30
|
|
|
31
31
|
$('<div>')
|
|
@@ -41,7 +41,7 @@ function formatStopPopup(feature) {
|
|
|
41
41
|
|
|
42
42
|
$('<div>').text('Routes Served:').appendTo(html);
|
|
43
43
|
|
|
44
|
-
$(html).append(
|
|
44
|
+
$(html).append(routeIds.map((routeId) => formatRoute(routes[routeId])));
|
|
45
45
|
|
|
46
46
|
return html.prop('outerHTML');
|
|
47
47
|
}
|
|
@@ -61,7 +61,7 @@ function getBounds(geojson) {
|
|
|
61
61
|
return bounds;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
function createMap(id, geojson) {
|
|
64
|
+
function createMap(id, geojson, routes) {
|
|
65
65
|
const defaultRouteColor = '#FF4728';
|
|
66
66
|
|
|
67
67
|
if (!geojson || geojson.features.length === 0) {
|
|
@@ -228,7 +228,7 @@ function createMap(id, geojson) {
|
|
|
228
228
|
|
|
229
229
|
new mapboxgl.Popup()
|
|
230
230
|
.setLngLat(feature.geometry.coordinates)
|
|
231
|
-
.setHTML(formatStopPopup(feature))
|
|
231
|
+
.setHTML(formatStopPopup(feature, routes))
|
|
232
232
|
.addTo(map);
|
|
233
233
|
});
|
|
234
234
|
|
|
@@ -65,3 +65,34 @@
|
|
|
65
65
|
};
|
|
66
66
|
}), timetableGroup => timetableGroup.agency.agency_name.toLowerCase());
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
function prepareMapData(timetable) {
|
|
70
|
+
const routes = {}
|
|
71
|
+
const minifiedGeojson = {
|
|
72
|
+
type: 'FeatureCollection',
|
|
73
|
+
features: []
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
for (const feature of timetable.geojson.features) {
|
|
77
|
+
if (feature.geometry.type === 'LineString') {
|
|
78
|
+
feature.properties = {
|
|
79
|
+
route_color: feature.properties.route_color
|
|
80
|
+
}
|
|
81
|
+
minifiedGeojson.features.push(feature)
|
|
82
|
+
} else if (feature.geometry.type === 'Point') {
|
|
83
|
+
for (const route of feature.properties.routes) {
|
|
84
|
+
routes[route.route_id] = route
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
feature.properties.routes = feature.properties.routes.map(route => route.route_id)
|
|
88
|
+
|
|
89
|
+
minifiedGeojson.features.push(feature)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
id: `timetable_id_${formatHtmlId(timetable.timetable_id)}`,
|
|
95
|
+
routes,
|
|
96
|
+
geojson: minifiedGeojson
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -24,13 +24,10 @@ include formatting_functions.pug
|
|
|
24
24
|
|
|
25
25
|
if config.showMap
|
|
26
26
|
.map(id=`map_timetable_id_${formatHtmlId(timetable.timetable_id)}`)
|
|
27
|
-
|
|
28
|
-
//- Use #{variable} format to inject values from pug to client side js
|
|
29
27
|
script.
|
|
30
28
|
(function() {
|
|
31
|
-
const id =
|
|
32
|
-
|
|
33
|
-
createMap(id, geojson);
|
|
29
|
+
const { id, geojson, routes } = !{JSON.stringify(prepareMapData(timetable))};
|
|
30
|
+
createMap(id, geojson, routes);
|
|
34
31
|
})();
|
|
35
32
|
|
|
36
33
|
if timetable.orientation === 'horizontal'
|
package/www/package.json
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"deploy": "docusaurus deploy"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@docusaurus/core": "^2.0.0-beta.
|
|
13
|
-
"@docusaurus/preset-classic": "^2.0.0-beta.
|
|
12
|
+
"@docusaurus/core": "^2.0.0-beta.18",
|
|
13
|
+
"@docusaurus/preset-classic": "^2.0.0-beta.18",
|
|
14
14
|
"clsx": "^1.1.1",
|
|
15
|
-
"react": "^
|
|
16
|
-
"react-dom": "^
|
|
15
|
+
"react": "^18.0.0",
|
|
16
|
+
"react-dom": "^18.0.0"
|
|
17
17
|
},
|
|
18
18
|
"browserslist": {
|
|
19
19
|
"production": [
|