Skip to content

Commit

Permalink
minor tweak of sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhou committed Dec 5, 2024
1 parent b6a6a69 commit 784f06b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion code/pages/1_Basic behavior analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from sklearn.preprocessing import StandardScaler
from streamlit_plotly_events import plotly_events
from util.aws_s3 import load_data
from util.streamlit import add_session_filter, data_selector
from util.streamlit import add_session_filter, data_selector, add_footnote
from scipy.stats import gaussian_kde
import streamlit_nested_layout

Expand Down Expand Up @@ -126,6 +126,7 @@ def app():
with st.sidebar:
add_session_filter(if_bonsai=True)
data_selector()
add_footnote()

if not hasattr(ss, "df"):
st.write("##### Data not loaded yet, start from Home:")
Expand Down
9 changes: 5 additions & 4 deletions code/util/streamlit.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,13 +691,14 @@ def add_dot_property_mapper():

def data_selector():

with st.expander(f'Session selector', expanded=True):
# --- add a download button ---
_add_download_filtered_session()

with st.expander(f'Session selector', expanded=True):
with st.expander(f"Filtered: {len(st.session_state.df_session_filtered)} sessions, "
f"{len(st.session_state.df_session_filtered.h2o.unique())} mice", expanded=False):
st.dataframe(st.session_state.df_session_filtered)

# --- add a download button ---
with st.columns([1, 10])[1]:
_add_download_filtered_session()

# cols = st.columns([4, 1])
# with cols[0].expander(f"From dataframe: {len(st.session_state.df_selected_from_dataframe)} sessions", expanded=False):
Expand Down

0 comments on commit 784f06b

Please sign in to comment.