gtfs-to-chart 2.0.1 → 2.0.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 +14 -0
- package/README.md +24 -10
- package/docs/images/gtfs-to-chart-logo.svg +18 -0
- package/lib/file-utils.js +1 -0
- package/lib/gtfs-to-chart.js +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
### Updated
|
|
9
|
+
- Dependency updates
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- Fixed charts path in generated index.html
|
|
13
|
+
|
|
14
|
+
## [2.0.1] - 2021-08-17
|
|
15
|
+
### Updated
|
|
16
|
+
- Dependency updates
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- Fixes for no shape_dist_traveled
|
|
20
|
+
|
|
7
21
|
## [2.0.0] - 2021-05-14
|
|
8
22
|
### Breaking Changes
|
|
9
23
|
- Converted to ES6 Module
|
package/README.md
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
➡️
|
|
3
|
+
<a href="#installation">Installation</a> |
|
|
4
|
+
<a href="#quick-start">Quick Start</a> |
|
|
5
|
+
<a href="#configuration">Configuration</a>
|
|
6
|
+
⬅️
|
|
7
|
+
<br /><br />
|
|
8
|
+
<img src="docs/images/gtfs-to-chart-logo.svg" alt="GTFS-to-Chart" />
|
|
9
|
+
<br /><br />
|
|
10
|
+
<a href="https://www.npmjs.com/package/gtfs-to-chart" rel="nofollow"><img src="https://img.shields.io/npm/v/gtfs-to-chart.svg?style=flat" style="max-width: 100%;"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/gtfs-to-chart" rel="nofollow"><img src="https://img.shields.io/npm/dm/gtfs-to-chart.svg?style=flat" style="max-width: 100%;"></a>
|
|
12
|
+
<a href="https://github.com/BlinkTagInc/gtfs-to-chart/actions?query=workflow%3A%22Node+CI%22"><img src="https://img.shields.io/github/workflow/status/BlinkTagInc/gtfs-to-chart/Node%20CI.svg" alt="CircleCI" style="max-width: 100%;"></a>
|
|
13
|
+
<img src="https://img.shields.io/badge/License-MIT-yellow.svg">
|
|
14
|
+
<br /><br />
|
|
15
|
+
Generate stringline charts from GTFS transit data.
|
|
16
|
+
<br /><br />
|
|
17
|
+
<a href="https://nodei.co/npm/gtfs-to-chart/" rel="nofollow"><img src="https://nodei.co/npm/gtfs-to-chart.png?downloads=true" alt="NPM" style="max-width: 100%;"></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<hr>
|
|
9
21
|
|
|
10
22
|
`gtfs-to-chart` creates stringline charts showing all vehicles on a transit route from GTFS data.
|
|
11
23
|
|
|
@@ -52,11 +64,13 @@ If you would like to use this library as a command-line utility, you can install
|
|
|
52
64
|
|
|
53
65
|
If you are using this as a node module as part of an application, you can include it in your project's `package.json` file.
|
|
54
66
|
|
|
55
|
-
##
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
### Command-line example
|
|
56
70
|
|
|
57
71
|
gtfs-to-chart --configPath /path/to/your/custom-config.json
|
|
58
72
|
|
|
59
|
-
|
|
73
|
+
### Code example
|
|
60
74
|
|
|
61
75
|
```js
|
|
62
76
|
import gtfsToChart from 'gtfs-to-chart';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg width="280" height="311" viewBox="0 0 280 311" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M279.142 216.458V95.0263C279.142 82.9559 272.684 71.822 262.162 65.7868L156.951 5.01874C146.43 -1.01645 133.617 -1.01645 123.096 5.01874L17.8843 65.6828C7.36319 71.718 0.904663 82.8518 0.904663 95.0263V216.458C0.904663 228.529 7.36319 239.663 17.8843 245.698L123.096 306.362C133.617 312.397 146.43 312.397 156.951 306.362L262.267 245.594C272.684 239.663 279.142 228.529 279.142 216.458Z" fill="#B46030"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M140.076 292.21C137.471 292.21 134.867 291.482 132.471 290.233L27.2597 229.465C22.572 226.76 19.6553 221.765 19.6553 216.354V95.0263C19.6553 89.6154 22.572 84.6208 27.1555 81.9154L132.471 21.1473C134.763 19.7945 137.367 19.1702 140.076 19.1702C142.784 19.1702 145.284 19.8986 147.68 21.1473L252.996 81.9154C257.683 84.6208 260.6 89.6154 260.6 95.0263V216.458C260.6 221.869 257.683 226.864 252.996 229.569L147.68 290.337C145.284 291.482 142.68 292.21 140.076 292.21Z" fill="#61A8FC"/>
|
|
4
|
+
<mask id="mask0_4_65" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="10" y="133" width="259" height="61">
|
|
5
|
+
<path d="M10.6458 133.301H268.646V193.301H10.6458V133.301Z" fill="white"/>
|
|
6
|
+
</mask>
|
|
7
|
+
<g mask="url(#mask0_4_65)">
|
|
8
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.6458 34.2317H268.646V292.232H10.6458V34.2317Z" fill="#B46030"/>
|
|
9
|
+
</g>
|
|
10
|
+
<mask id="mask1_4_65" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="122" y="244" width="36" height="35">
|
|
11
|
+
<path d="M122 244H157.139V278.037H122V244Z" fill="white"/>
|
|
12
|
+
</mask>
|
|
13
|
+
<g mask="url(#mask1_4_65)">
|
|
14
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M144.917 255.167L157.139 256.912L148.335 265.657L150.471 277.948L139.523 272.186L128.621 278.037L130.658 265.73L121.785 257.056L133.993 255.212L139.41 244L144.917 255.167Z" fill="white"/>
|
|
15
|
+
</g>
|
|
16
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M178.87 65.8803C178.87 64.6713 178.312 63.7413 177.289 63.0903C177.103 62.9973 176.824 62.8113 176.638 62.7183C176.638 59.6494 176.545 56.4875 176.359 53.3256C175.987 46.0718 172.174 42.5378 165.013 42.4448C158.782 42.4448 152.551 42.4448 146.32 42.4448C136.183 42.4448 126.139 42.3518 116.002 42.5378C106.702 42.7238 102.982 46.6297 102.982 55.9295C102.982 58.1614 102.982 60.3934 102.982 62.7183C102.424 62.9043 101.959 63.3693 101.587 63.8343C100.936 64.3923 100.75 65.2293 100.75 66.1592C100.75 70.4371 100.75 74.715 100.75 79.0859C100.75 80.3879 101.215 81.4109 102.331 82.0618C102.61 82.2478 102.796 82.3408 103.075 82.4338C103.075 91.6406 103.075 100.754 103.075 109.961C103.075 111.263 102.889 112.751 103.54 113.867C104.935 116.099 104.656 118.517 104.749 120.935C104.842 123.911 106.795 125.957 109.771 126.05C111.91 126.143 114.049 126.143 116.188 126.05C119.257 125.957 121.21 124.19 121.303 121.121C121.396 119.819 121.582 119.354 123.07 119.354C134.23 119.447 145.483 119.447 156.643 119.354C158.038 119.354 158.41 119.726 158.41 121.121C158.503 124.376 160.456 126.05 163.711 126.05C165.571 126.05 167.431 126.05 169.291 126.05C173.104 126.05 174.964 124.097 175.057 120.284C175.057 118.796 174.592 117.122 175.429 115.727C176.452 113.867 176.731 112.007 176.731 109.961C176.731 101.312 176.731 92.6636 176.731 82.4338C177.382 82.3408 177.94 81.7829 178.312 81.2249C178.777 80.6669 178.963 79.9229 178.963 79.1789C178.87 74.808 178.87 70.3441 178.87 65.8803ZM124.279 49.1407C129.859 49.1407 135.439 49.1407 140.926 49.1407C146.32 49.1407 151.714 49.1407 157.201 49.1407C159.619 49.1407 159.898 49.5127 159.991 52.3026C159.991 55.3715 159.712 55.8365 157.387 55.8365C146.32 55.8365 135.253 55.8365 124.279 55.8365C121.861 55.8365 121.396 55.2785 121.396 52.4886C121.303 49.6987 121.768 49.1407 124.279 49.1407ZM117.304 111.077C114.049 111.077 111.352 108.38 111.352 105.125C111.445 101.963 114.142 99.3594 117.211 99.3594C120.466 99.3594 122.884 101.87 122.884 105.218C122.977 108.473 120.466 111.077 117.304 111.077ZM116.467 90.9896C112.933 90.9896 111.352 89.3157 111.352 85.6888C111.352 79.1789 111.352 72.6691 111.352 66.1592C111.352 62.5323 112.84 61.0444 116.467 61.0444C124.279 61.0444 131.998 61.0444 139.81 61.0444C147.436 61.0444 155.062 61.0444 162.688 61.0444C166.78 61.0444 168.175 62.4393 168.175 66.4382C168.175 72.6691 168.175 78.8999 168.175 85.1308C168.175 88.8507 166.129 90.8966 162.409 90.9896C147.157 90.9896 131.812 90.9896 116.467 90.9896ZM162.409 111.077C159.247 111.077 156.736 108.566 156.643 105.311C156.643 101.963 159.061 99.4524 162.316 99.4524C165.571 99.4524 168.268 102.149 168.268 105.404C168.175 108.38 165.571 111.077 162.409 111.077Z" fill="white"/>
|
|
17
|
+
<path d="M43.9456 179.45C41.5456 179.45 39.7156 178.775 38.4556 177.425C37.1956 176.045 36.5656 174.08 36.5656 171.53V154.97C36.5656 152.42 37.1956 150.47 38.4556 149.12C39.7156 147.74 41.5456 147.05 43.9456 147.05C46.3456 147.05 48.1756 147.74 49.4356 149.12C50.6956 150.47 51.3256 152.42 51.3256 154.97V157.67H46.6456V154.655C46.6456 152.585 45.7906 151.55 44.0806 151.55C42.3706 151.55 41.5156 152.585 41.5156 154.655V171.89C41.5156 173.93 42.3706 174.95 44.0806 174.95C45.7906 174.95 46.6456 173.93 46.6456 171.89V165.725H44.1706V161.225H51.3256V171.53C51.3256 174.08 50.6956 176.045 49.4356 177.425C48.1756 178.775 46.3456 179.45 43.9456 179.45ZM58.3737 152H53.1987V147.5H68.4987V152H63.3237V179H58.3737V152ZM70.8953 147.5H83.9903V152H75.8453V160.775H82.2353V165.275H75.8453V179H70.8953V147.5ZM92.799 179.45C90.399 179.45 88.584 178.775 87.354 177.425C86.124 176.045 85.509 174.08 85.509 171.53V169.73H90.189V171.89C90.189 173.93 91.044 174.95 92.754 174.95C93.594 174.95 94.224 174.71 94.644 174.23C95.094 173.72 95.319 172.91 95.319 171.8C95.319 170.48 95.019 169.325 94.419 168.335C93.819 167.315 92.709 166.1 91.089 164.69C89.049 162.89 87.624 161.27 86.814 159.83C86.004 158.36 85.599 156.71 85.599 154.88C85.599 152.39 86.229 150.47 87.489 149.12C88.749 147.74 90.579 147.05 92.979 147.05C95.349 147.05 97.134 147.74 98.334 149.12C99.564 150.47 100.179 152.42 100.179 154.97V156.275H95.499V154.655C95.499 153.575 95.289 152.795 94.869 152.315C94.449 151.805 93.834 151.55 93.024 151.55C91.374 151.55 90.549 152.555 90.549 154.565C90.549 155.705 90.849 156.77 91.449 157.76C92.079 158.75 93.204 159.95 94.824 161.36C96.894 163.16 98.319 164.795 99.099 166.265C99.879 167.735 100.269 169.46 100.269 171.44C100.269 174.02 99.624 176 98.334 177.38C97.074 178.76 95.229 179.45 92.799 179.45ZM102.211 161H112.111V165.5H102.211V161ZM115.634 152H110.459V147.5H125.759V152H120.584V179H115.634V152ZM135.135 179.45C132.705 179.45 130.845 178.76 129.555 177.38C128.265 176 127.62 174.05 127.62 171.53V154.97C127.62 152.45 128.265 150.5 129.555 149.12C130.845 147.74 132.705 147.05 135.135 147.05C137.565 147.05 139.425 147.74 140.715 149.12C142.005 150.5 142.65 152.45 142.65 154.97V171.53C142.65 174.05 142.005 176 140.715 177.38C139.425 178.76 137.565 179.45 135.135 179.45ZM135.135 174.95C136.845 174.95 137.7 173.915 137.7 171.845V154.655C137.7 152.585 136.845 151.55 135.135 151.55C133.425 151.55 132.57 152.585 132.57 154.655V171.845C132.57 173.915 133.425 174.95 135.135 174.95ZM145.278 161H155.178V165.5H145.278V161ZM165.102 179.45C162.732 179.45 160.917 178.775 159.657 177.425C158.427 176.075 157.812 174.17 157.812 171.71V154.79C157.812 152.33 158.427 150.425 159.657 149.075C160.917 147.725 162.732 147.05 165.102 147.05C167.472 147.05 169.272 147.725 170.502 149.075C171.762 150.425 172.392 152.33 172.392 154.79V158.12H167.712V154.475C167.712 152.525 166.887 151.55 165.237 151.55C163.587 151.55 162.762 152.525 162.762 154.475V172.07C162.762 173.99 163.587 174.95 165.237 174.95C166.887 174.95 167.712 173.99 167.712 172.07V167.255H172.392V171.71C172.392 174.17 171.762 176.075 170.502 177.425C169.272 178.775 167.472 179.45 165.102 179.45ZM175.353 147.5H180.303V160.325H185.613V147.5H190.563V179H185.613V164.825H180.303V179H175.353V147.5ZM198.075 147.5H204.78L209.91 179H204.96L204.06 172.745V172.835H198.435L197.535 179H192.945L198.075 147.5ZM203.475 168.56L201.27 152.99H201.18L199.02 168.56H203.475ZM212.311 147.5H219.646C222.196 147.5 224.056 148.1 225.226 149.3C226.396 150.47 226.981 152.285 226.981 154.745V156.68C226.981 159.95 225.901 162.02 223.741 162.89V162.98C224.941 163.34 225.781 164.075 226.261 165.185C226.771 166.295 227.026 167.78 227.026 169.64V175.175C227.026 176.075 227.056 176.81 227.116 177.38C227.176 177.92 227.326 178.46 227.566 179H222.526C222.346 178.49 222.226 178.01 222.166 177.56C222.106 177.11 222.076 176.3 222.076 175.13V169.37C222.076 167.93 221.836 166.925 221.356 166.355C220.906 165.785 220.111 165.5 218.971 165.5H217.261V179H212.311V147.5ZM219.061 161C220.051 161 220.786 160.745 221.266 160.235C221.776 159.725 222.031 158.87 222.031 157.67V155.24C222.031 154.1 221.821 153.275 221.401 152.765C221.011 152.255 220.381 152 219.511 152H217.261V161H219.061ZM234.243 152H229.068V147.5H244.368V152H239.193V179H234.243V152Z" fill="white"/>
|
|
18
|
+
</svg>
|
package/lib/file-utils.js
CHANGED
|
@@ -27,6 +27,7 @@ export async function prepDirectory(exportPath) {
|
|
|
27
27
|
const staticAssetPath = path.join(fileURLToPath(import.meta.url), '../../public');
|
|
28
28
|
await rm(exportPath, { recursive: true, force: true });
|
|
29
29
|
await mkdir(exportPath, { recursive: true });
|
|
30
|
+
await mkdir(path.join(exportPath, 'charts'), { recursive: true });
|
|
30
31
|
await copy(path.join(staticAssetPath, 'css'), path.join(exportPath, 'css'));
|
|
31
32
|
await copy(path.join(staticAssetPath, 'js'), path.join(exportPath, 'js'));
|
|
32
33
|
}
|
package/lib/gtfs-to-chart.js
CHANGED
|
@@ -58,7 +58,7 @@ const gtfsToChart = async initialConfig => {
|
|
|
58
58
|
|
|
59
59
|
try {
|
|
60
60
|
const html = await generateChartHTML(config, route.route_id);
|
|
61
|
-
const htmlPath = path.join(exportPath, sanitize(`${formatRouteName(route)}.html`));
|
|
61
|
+
const htmlPath = path.join(exportPath, 'charts', sanitize(`${formatRouteName(route)}.html`));
|
|
62
62
|
await writeFile(htmlPath, html);
|
|
63
63
|
} catch (error) {
|
|
64
64
|
config.logWarning(error.message);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gtfs-to-chart",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Generate stringline charts of a transit routes from GTFS",
|
|
6
6
|
"keywords": [
|
|
@@ -44,28 +44,28 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"better-copy": "^1.0.4",
|
|
47
|
-
"chalk": "^
|
|
47
|
+
"chalk": "^5.1.2",
|
|
48
48
|
"connect-slashes": "^1.4.0",
|
|
49
|
-
"express": "^4.
|
|
50
|
-
"gtfs": "^3.
|
|
51
|
-
"js-beautify": "^1.14.
|
|
49
|
+
"express": "^4.18.2",
|
|
50
|
+
"gtfs": "^3.6.0",
|
|
51
|
+
"js-beautify": "^1.14.7",
|
|
52
52
|
"lodash-es": "^4.17.21",
|
|
53
|
-
"moment": "^2.29.
|
|
53
|
+
"moment": "^2.29.4",
|
|
54
54
|
"morgan": "^1.10.0",
|
|
55
55
|
"progress": "^2.0.3",
|
|
56
56
|
"pug": "^3.0.2",
|
|
57
57
|
"sanitize-filename": "^1.6.3",
|
|
58
|
-
"simplify-geojson": "^1.0.
|
|
59
|
-
"sqlstring": "^2.3.
|
|
58
|
+
"simplify-geojson": "^1.0.5",
|
|
59
|
+
"sqlstring": "^2.3.3",
|
|
60
60
|
"timer-machine": "^1.1.0",
|
|
61
61
|
"untildify": "^4.0.0",
|
|
62
|
-
"yargs": "^17.
|
|
62
|
+
"yargs": "^17.6.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"xo": "^0.
|
|
65
|
+
"xo": "^0.52.4"
|
|
66
66
|
},
|
|
67
67
|
"engines": {
|
|
68
|
-
"node": ">=
|
|
68
|
+
"node": ">= 14.x"
|
|
69
69
|
},
|
|
70
70
|
"false": {}
|
|
71
71
|
}
|