This is a data visualization project about bus arrivals in Ljubljana (LPP). It was developed as seminar work as part of a computer science course on data design and interactivity.
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.toml
topreparation/data/configuration.toml
and fill out any required fields. - Build the project in release mode: run
cargo build --release
inside thepreparation
directory. - To download data for the current day, run
cargo run --release -- --run-mode once
and 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_station
andtotal_stations
fields 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 family from here and extract the files
into the visualization/public/fonts/Roboto
directory.
The file visualization/public/fonts/Roboto/Roboto-Regular.ttf
, among other variants, should now exist.
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 dev
if you want to develop with hot reloading).
If you built the project properly, you'll find all the required files inside the visualization/dist
directory.
You're done; you need to serve only these files.