diff --git a/src/webui/data/analysis.py b/src/webui/data/analysis.py index 155ece0..71c30cd 100644 --- a/src/webui/data/analysis.py +++ b/src/webui/data/analysis.py @@ -559,6 +559,12 @@ def _compute_timeline_animation_data(db: Database) -> dict: "month": month, }) + # Deliver points in chronological order so the front-end's cumulative + # filter (p.month <= frame) is append-only. Otherwise new points get + # inserted mid-array and Plotly's index-based frame transition animates + # existing markers flying to other drafts' coordinates ("jumping points"). + points.sort(key=lambda p: (p["month"], p["name"])) + months = sorted(month_set) # Convert defaultdict to plain dict for JSON cat_monthly_plain = {m: dict(cats) for m, cats in category_monthly.items()}