This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
WorkoutAnimationConfig
marcjulianschwarz edited this page Feb 16, 2022
·
1 revision
class watchlib.animation.WorkoutAnimationConfig(data, config)
You can use WorkoutAnimationConfig
to customize/configure a WorkoutAnimation.
from watchlib.data_handler import DataLoader
from watchlib.animation import WorkoutAnimation, WorkoutAnimationConfig
dl = DataLoader("path/to/apple_health_export")
routes = dl.load_routes()
config = WorkoutAnimationConfig(
fig_size=(8,8),
color_on="speed",
resolution=0.5
)
wa = WorkoutAnimation(route=routes[0], config=config)
animation = wa.animate()
animation.save("route_animation.mp4")
- interval : int = 25
- fig_size : Tuple[int, int] = (10,10)
- resolution : float = 0.08
- color_on : str = "elevation"
- rotate: bool = True
The color_on
parameter can take following values:
- "speed"
- "elevation"
- "vAcc" -> vertical acceleration
- "hAcc" -> horizontal acceleration
- "course"
You can access these constants like this:
from watchlib.animation import WORKOUT_OPTIONS
WORKOUT_OPTIONS["color_on"]
# Returns:
# ["speed", "elevation", "vAcc", "hAcc", "course"]