refactor: move _render_axis_motions to module level

main
Sven Geboers 1 month ago
parent ab9b91e4a8
commit 2cca1000ca
  1. 25
      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("-")
)

Loading…
Cancel
Save