From 2cca1000ca6409cc662b17ae542cd60ada98f08a Mon Sep 17 00:00:00 2001 From: Sven Geboers Date: Sun, 29 Mar 2026 19:43:13 +0200 Subject: [PATCH] refactor: move _render_axis_motions to module level --- explorer.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/explorer.py b/explorer.py index d8ca142..41393fe 100644 --- a/explorer.py +++ b/explorer.py @@ -212,6 +212,19 @@ def _swap_axes( return new_positions, new_ax +def _render_axis_motions(label: str, conf_pct: str, top: dict) -> None: + st.markdown(f"**{label}**{conf_pct}") + for sign, icon in (("+", "➕"), ("-", "➖")): + titles = top.get(sign, []) + if titles: + st.markdown( + "  " + + icon + + " " + + " · ".join(f"{t} ({d})" for t, d in titles[:3]) + ) + + @st.cache_data(show_spinner="2D posities berekenen (kan even duren)…") def load_positions( db_path: str, window_size: str = "quarterly" @@ -1037,18 +1050,6 @@ def build_compass_tab(db_path: str, window_size: str) -> None: evr = axis_def.get("explained_variance_ratio", [None, None]) evr0 = evr[0] if evr else None - def _render_axis_motions(label: str, conf_pct: str, top: dict) -> None: - st.markdown(f"**{label}**{conf_pct}") - for sign, icon in (("+", "➕"), ("-", "➖")): - titles = top.get(sign, []) - if titles: - st.markdown( - "  " - + icon - + " " - + " · ".join(f"{t} ({d})" for t, d in titles[:3]) - ) - _has_motion_data = bool( x_top.get("+") or x_top.get("-") or y_top.get("+") or y_top.get("-") )