This project tries to visually document the training process of my first marathon (Ann Arbor Marathon on October 1st, 2023). I used Nike Running Club (NRC) to record the training for this marathon.
This project visualizes trace files (.gpx) on map using plotly and mapbox. There is native animation function in plotly. However, plotly does not support such large amount of frame, and it becomes too slow to be feasible. The animation is in stead generate by putting together many .png file, which each is generated by plotly separately.
A sample output:
This repo is implemented in Python 3 and uses Jupyter Notebook.
See required libraries in requirements.txt.
- Running files in
Data/*.gpx - Configuration file
config.yaml
- Static image of all the trace on the map.
- Animations (.gif) of trajectories on the map in the order of date.
- Gather running data in .gpx files
- All traces should be in the
Datafolder asData/*.tcx.
- All traces should be in the
- Setup configuration file
config.yaml- set input directory for .gpx if other than
Data. Set output directory if other thanImage. - Register Mapbox for certain map styles and store the Mapbox token in the key
mapbox_access_token. - Adjust
mapbox_confifor mapbox map settings such as map center and zoom. The style of the map is also set here. - Adjust
fig_layoutfor plotly figure size and layout - Adjust
animationfor settings related to animation output.SPF_plotlyis the trace duration for a frame in plotly native animation plot.SPF_gifis the trace duration for a frame in .gif outputFPS_gifis the frame rate for .gif output
- set input directory for .gpx if other than
StaticVisualization.ipynbis used to generate a static image with all traces.AnimatedVisualization.ipynbis used to generate a .gif image for all traces.
