gtfs_realtime_viz v0.3.0 GTFSRealtimeViz View Source
GTFSRealtimeViz is an OTP app that can be run by itself or as part of another application. You can send it protobuf VehiclePositions.pb files, in sequence, and then output them as an HTML fragment, to either open in a browser or embed in another view.
Example usage as stand alone:
$ iex -S mix
iex(1)> proto = File.read!("filename.pb")
iex(2)> GTFSRealtimeViz.new_message(:prod, proto, "first protobuf file")
iex(3)> File.write!("output.html", GTFSRealtimeViz.visualize(:prod))
Link to this section Summary
Functions
Send protobuf files to the app’s GenServer. The app can handle a series of files, belonging to different groupings (e.g., test, dev, and prod). When sending the file, you must also provide a comment (perhaps a time stamp or other information about the file), which will be displayed along with the visualization
Renders the received protobuf files and comments into an HTML fragment that can either be opened directly in a browser or embedded within the HTML layout of another app
Renders an HTML fragment that displays the vehicle differences between two pb files
Link to this section Types
Link to this section Functions
new_message(term(), GTFSRealtimeViz.Proto.raw(), String.t()) :: :ok
Send protobuf files to the app’s GenServer. The app can handle a series of files, belonging to different groupings (e.g., test, dev, and prod). When sending the file, you must also provide a comment (perhaps a time stamp or other information about the file), which will be displayed along with the visualization.
visualize(term(), route_opts()) :: String.t()
Renders the received protobuf files and comments into an HTML fragment that can either be opened directly in a browser or embedded within the HTML layout of another app.
visualize_diff(term(), term(), route_opts()) :: String.t()
Renders an HTML fragment that displays the vehicle differences between two pb files.