Before you can use the visualisation, you need to request some timetable and station data from the LPP API.
To do this, you need to run the "recording" server inside preparation. You'll need Rust for this.
The steps are as follows:
- Copy
preparation/data/configuration.TEMPLATE.tomltopreparation/data/configuration.tomland fill out any required fields. - Build the project in release mode: run
cargo build --releaseinside thepreparationdirectory. - To download data for the current day, run
cargo run --release -- --run-mode onceand wait for completion. This might take around half an hour or maybe up to an hour - you can monitor the current progress by looking at thecurrent_stationandtotal_stationsfields in the logs. For any other available options, seecargo run --release -- --help. At the very end you may see quite a few "errors" in the console - this is normal, the program just displays warning and/or errors when encountering abandoned or invalid bus lines and stations. They will simply be filtered out of the output files. - After the program exits successfully, you'll find the "recordings" in the configured output directory.
Copy the
route-details-*andstation-details-*bare files tovisualization/public/data(create the directory if needed).
Download the Roboto font from here into the visualization/public/fonts/Roboto directory
(the file visualization/public/fonts/Roboto/Roboto-Regular.ttf should now exist, among others).
Inside the visualization/src directory, copy the data.TEMPLATE.ts to data.ts and fill out the filenames of the available
data files. If, for example, you have the file visualization/public/data/route-details_2023-11-05_19-11-53.567+UTC.json,
add route-details_2023-11-05_19-11-53.567+UTC.json to the allRouteSnapshots array in the file. Do the same for station files.
Inside the visuzalization/src directory, copy the secrets.TEMPLATE.ts to secrets.ts and fill out the required fields.
You can get the API key for the Ljubljana map by signing up over at JawgMaps and getting your
access token here.
You're now ready to build the visualization. You'll need Node 18+ and Yarn.
The steps are as follows:
- In
visualization: runyarn install - In
visualization: runyarn build(oryarn devif you want to develop with hot reloading).
If you built the project properly, you'll find the required files inside the visualization/dist directory. You're done!