refactor: move _render_axis_motions to module level
This commit is contained in:
+13
-12
@@ -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("-")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user