vulture-wasm 0.1.0 → 0.2.0
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/README.md +6 -1
- package/package.json +9 -5
- package/vulture_wasm.d.ts +1 -1
- package/vulture_wasm.js +1 -1
- package/vulture_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -47,7 +47,8 @@ const tt = new VultureTimetable(
|
|
|
47
47
|
- `tt.nStops()`, `tt.nRoutes()` — counts.
|
|
48
48
|
- `tt.stopIdx(gtfsId)` — GTFS stop id → opaque `StopIdx`, or `undefined`.
|
|
49
49
|
- `tt.stopName(stopIdx)`, `tt.stopCoords(stopIdx)`, `tt.routeName(routeIdx)`, `tt.routeAgency(routeIdx)` — display-data accessors.
|
|
50
|
-
- `tt.allStops()
|
|
50
|
+
- `tt.allStops()` — bulk catalogue of `{idx, id, name, lat, lon}` per stop.
|
|
51
|
+
- `tt.allRoutes()` — bulk catalogue of `{idx, id, name, agency, route_type, route_color}` per route. `route_type` is the GTFS integer (0=tram, 1=metro, 2=rail, 3=bus, 4=ferry, 5=cable, 6=aerial, 7=funicular, …); `route_color` is `"#rrggbb"` or `null`.
|
|
51
52
|
- `tt.withWalkingFootpaths(maxDistMeters, walkSpeedMetersPerSec)` — replace the footpath set with one derived from stop coordinates.
|
|
52
53
|
- `tt.resetFootpaths()` — restore the original `transfers.txt` set.
|
|
53
54
|
|
|
@@ -56,6 +57,8 @@ Free functions:
|
|
|
56
57
|
- `runArrival(tt, originStops, targetStops, maxTransfers, departSeconds, requireWheelchair)` — single-departure query. Returns an array of journeys with timed legs.
|
|
57
58
|
- `runRange(tt, origin, target, maxTransfers, departures, requireWheelchair)` — depart-in-window Pareto profile. Returns `[{depart, journey}]` where each `journey` has the same shape as a `runArrival` entry (`origin`, `target`, `arrival`, `legs`).
|
|
58
59
|
|
|
60
|
+
Each leg in `journey.legs` is `{board_stop, alight_stop, route, trip, route_id, depart, arrive, shape}`. `shape` is a `[lat, lon][]` polyline for that leg's segment of the trip's `shapes.txt` geometry, or `null` if the feed has no shape for the trip.
|
|
61
|
+
|
|
59
62
|
`originStops` / `targetStops` / `departures` are `Uint32Array`s; times are seconds since midnight on the service date. Full type signatures are in the bundled `vulture_wasm.d.ts`.
|
|
60
63
|
|
|
61
64
|
## Examples
|
|
@@ -212,3 +215,5 @@ node vulture-wasm/tests/smoke.mjs
|
|
|
212
215
|
## Demo page
|
|
213
216
|
|
|
214
217
|
`docs/demo/` is a vanilla-JS / vanilla-CSS demo with three panels – stop-to-stop, departure window, walking-footpath comparison – running entirely client-side against the bundled Delhi Metro feed. Live at <https://urschrei.github.io/vulture/>.
|
|
218
|
+
|
|
219
|
+
The demo also renders each journey on a MapLibre dark basemap, using `leg.shape` from `runArrival` / `runRange` for the polyline geometry and `route.route_color` / `route.route_type` for the per-mode colour. See `docs/demo/app.js` (`drawJourney`) for the rendering wiring — roughly 80 lines of GeoJSON sources + circle/line layers with a halo+stroke pattern for legibility on the dark tiles.
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vulture-wasm",
|
|
3
|
+
"type": "module",
|
|
3
4
|
"collaborators": [
|
|
4
5
|
"Stephan Hügel <urschrei@gmail.com>"
|
|
5
6
|
],
|
|
6
7
|
"description": "WebAssembly bindings for vulture (RAPTOR transit routing)",
|
|
7
|
-
"version": "0.
|
|
8
|
+
"version": "0.2.0",
|
|
8
9
|
"license": "Apache-2.0",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
@@ -15,10 +16,8 @@
|
|
|
15
16
|
"vulture_wasm.js",
|
|
16
17
|
"vulture_wasm.d.ts"
|
|
17
18
|
],
|
|
18
|
-
"module": "vulture_wasm.js",
|
|
19
|
-
"types": "vulture_wasm.d.ts",
|
|
20
|
-
"type": "module",
|
|
21
19
|
"main": "vulture_wasm.js",
|
|
20
|
+
"types": "vulture_wasm.d.ts",
|
|
22
21
|
"exports": {
|
|
23
22
|
".": "./vulture_wasm.js",
|
|
24
23
|
"./vulture_wasm_bg.wasm": "./vulture_wasm_bg.wasm"
|
|
@@ -26,5 +25,10 @@
|
|
|
26
25
|
"homepage": "https://urschrei.github.io/vulture/",
|
|
27
26
|
"bugs": {
|
|
28
27
|
"url": "https://github.com/urschrei/vulture/issues"
|
|
29
|
-
}
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"gtfs",
|
|
31
|
+
"routing",
|
|
32
|
+
"raptor"
|
|
33
|
+
]
|
|
30
34
|
}
|
package/vulture_wasm.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export class VultureTimetable {
|
|
|
13
13
|
[Symbol.dispose](): void;
|
|
14
14
|
/**
|
|
15
15
|
* Returns the entire synthetic-route catalogue as a JS array of
|
|
16
|
-
* `{idx, id, name, agency}` objects.
|
|
16
|
+
* `{idx, id, name, agency, route_type, route_color}` objects.
|
|
17
17
|
*/
|
|
18
18
|
allRoutes(): any;
|
|
19
19
|
/**
|
package/vulture_wasm.js
CHANGED
package/vulture_wasm_bg.wasm
CHANGED
|
Binary file
|