fix(webui): timeline embedding landscape — sort points chronologically
The animated t-SNE landscape delivered points in embedding-dict order, not chronological order. The front-end cumulative filter (p.month <= frame) then inserted new points mid-array between frames, so Plotly's index-based frame transition animated existing markers flying to other drafts' coordinates. Visible symptom: a couple of points jumping around instead of a growing map. Sorting points by (month, name) makes each frame's per-category marker list an append-only prefix of the next, so transitions only add markers. Verified on the live DB: 188 non-append-only frame transitions before, 0 after.
This commit is contained in:
@@ -559,6 +559,12 @@ def _compute_timeline_animation_data(db: Database) -> dict:
|
|||||||
"month": month,
|
"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)
|
months = sorted(month_set)
|
||||||
# Convert defaultdict to plain dict for JSON
|
# Convert defaultdict to plain dict for JSON
|
||||||
cat_monthly_plain = {m: dict(cats) for m, cats in category_monthly.items()}
|
cat_monthly_plain = {m: dict(cats) for m, cats in category_monthly.items()}
|
||||||
|
|||||||
Reference in New Issue
Block a user