bryan-stearns
commited on
Commit
·
9df3688
1
Parent(s):
9bedfdd
Now resets display when filters change
Browse files- Inspect_Logic.py +4 -1
Inspect_Logic.py
CHANGED
@@ -21,6 +21,9 @@ def get_smem_root_from_file(smem_file):
|
|
21 |
parser.parse_file(tokens)
|
22 |
return parser.get_context_root()
|
23 |
|
|
|
|
|
|
|
24 |
## DEFINE THE FILE UPLOADER ELEMENT
|
25 |
|
26 |
if "col_obj_list" not in st.session_state:
|
@@ -55,7 +58,7 @@ filters_cols = filters_expander.columns(min(len(features_dict), 5)) # Show 5 fil
|
|
55 |
filters_dict = {}
|
56 |
for i,key in enumerate(features_dict):
|
57 |
col = filters_cols[i % len(filters_cols)]
|
58 |
-
filters_dict[key] = col.multiselect(label=key, options=["(none)"]+sorted(features_dict[key]))
|
59 |
|
60 |
|
61 |
## DEFINE THE KNOWLEDGE INSPECTOR COLUMNS
|
|
|
21 |
parser.parse_file(tokens)
|
22 |
return parser.get_context_root()
|
23 |
|
24 |
+
def reset_cols():
|
25 |
+
st.session_state.col_obj_list = [None if i > 0 else x for i,x in enumerate(st.session_state.col_obj_list)]
|
26 |
+
|
27 |
## DEFINE THE FILE UPLOADER ELEMENT
|
28 |
|
29 |
if "col_obj_list" not in st.session_state:
|
|
|
58 |
filters_dict = {}
|
59 |
for i,key in enumerate(features_dict):
|
60 |
col = filters_cols[i % len(filters_cols)]
|
61 |
+
filters_dict[key] = col.multiselect(label=key, options=["(none)"]+sorted(features_dict[key]), on_change=reset_cols)
|
62 |
|
63 |
|
64 |
## DEFINE THE KNOWLEDGE INSPECTOR COLUMNS
|