Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ rasterm
/scripted_plotting/playground.ipynb
/scripted_plotting/sandbox
/scripted_plotting/animal_6_analysis/explore.ipynb
/scripted_plotting/animal_6_analysis/interval_decoding_runs
.claude
Binary file removed Deprecate/dashexample/.DS_Store
Binary file not shown.
20 changes: 20 additions & 0 deletions assets/sessionwise_controls.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.compact-event-dropdown .Select-control {
max-height: 96px;
overflow-y: auto;
}

.compact-event-dropdown .Select-multi-value-wrapper {
max-height: 72px;
overflow-y: auto;
padding-right: 4px;
}

.compact-event-dropdown .Select-value {
margin-top: 2px;
margin-bottom: 2px;
font-size: 10px;
}

.compact-event-dropdown .Select-menu-outer {
z-index: 1000;
}
8 changes: 4 additions & 4 deletions dashsrc/components/dashvis_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ def get_all_viss_req_data():
LATE_REWARD_LOCATION_COLOR = 'rgba(190,190,190, 1)'

R1_CHOICE_CMAP = {
1: convert_colors_to_same_type('#2ceaf2')[0][0], # stopped at R1
0: convert_colors_to_same_type("#92d6d7")[0][0], # skipped R1
1: convert_colors_to_same_type('#0072B2')[0][0], # stopped at R1
0: convert_colors_to_same_type("#D55E00")[0][0], # skipped R1
}
R2_CHOICE_CMAP = {
1: convert_colors_to_same_type("#2c82f2")[0][0], # stopped at R2
0: convert_colors_to_same_type("#7ca4d9")[0][0], # skipped R2
1: convert_colors_to_same_type("#009E73")[0][0], # stopped at R2
0: convert_colors_to_same_type("#CC79A7")[0][0], # skipped R2
}

TRIAL_COL_MAP = px.colors.sequential.Viridis
Expand Down
17 changes: 17 additions & 0 deletions dashsrc/components/data_loading_controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,23 @@ def _exclude_sessions_with_less_than_n_trials(data, min_trials: int = 10):
else:
return data

if 'unity_trial_n_rows' in data.columns:
session_trial_counts = pd.DataFrame({
'session_id': np.asarray(session_values),
'trial_count': np.asarray(data['unity_trial_n_rows']),
}).dropna(subset=['session_id', 'trial_count']).drop_duplicates(subset=['session_id'])

if session_trial_counts.empty:
return data

valid_sessions = session_trial_counts.loc[
session_trial_counts['trial_count'] >= min_trials, 'session_id'
]

if 'session_id' in index_names:
return data[data.index.get_level_values('session_id').isin(valid_sessions)]
return data[np.isin(np.asarray(data['session_id']), valid_sessions)]

if 'trial_id' in data.columns:
trial_values = data['trial_id']
elif 'trial_id' in index_names:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,8 @@ def _mark_label(label):
style = {'writing-mode': 'vertical-rl', 'white-space': 'nowrap'}
if mark_label_style is not None:
style = mark_label_style
return {'label': str(label), 'style': style}
label_text = str(label).split("_", 1)[0]
return {'label': label_text, 'style': style}

# sessions for the selected animal
sessions = _get_sessions_for_animal(data, selected_animal)
Expand Down
Loading