Spaces:
Runtime error
Runtime error
remove clear button
Browse files
app.py
CHANGED
@@ -122,18 +122,10 @@ def area():
|
|
122 |
# vals = set([name2id(var, n) for n in names])
|
123 |
with st.form("form2"):
|
124 |
container = st.container()
|
125 |
-
|
126 |
-
with col1:
|
127 |
-
all = st.form_submit_button("Select all")
|
128 |
-
with col2:
|
129 |
-
clear = st.form_submit_button("Clear all")
|
130 |
-
|
131 |
if all:
|
132 |
names = container.multiselect(f"Select one or more {var} values to display:",
|
133 |
get_unique(var), [v for k, v in DATA_META[var]['codes'].items() if k != -1])
|
134 |
-
elif clear:
|
135 |
-
names = container.multiselect(f"Select one or more {var} values to display:",
|
136 |
-
get_unique(var), [])
|
137 |
else:
|
138 |
names = container.multiselect(f"Select one or more {var} values to display:",
|
139 |
get_unique(var),
|
@@ -142,8 +134,7 @@ def area():
|
|
142 |
'Chemists'] if var == 'OCC1950' else ['Drugs and medicines',
|
143 |
'Fisheries',
|
144 |
'Glass and glass products', ])
|
145 |
-
|
146 |
-
st.form_submit_button("Apply")
|
147 |
|
148 |
df = get_area_data(var, filters)
|
149 |
df = df[df[var].isin(names)]
|
|
|
122 |
# vals = set([name2id(var, n) for n in names])
|
123 |
with st.form("form2"):
|
124 |
container = st.container()
|
125 |
+
all = st.form_submit_button("Select all")
|
|
|
|
|
|
|
|
|
|
|
126 |
if all:
|
127 |
names = container.multiselect(f"Select one or more {var} values to display:",
|
128 |
get_unique(var), [v for k, v in DATA_META[var]['codes'].items() if k != -1])
|
|
|
|
|
|
|
129 |
else:
|
130 |
names = container.multiselect(f"Select one or more {var} values to display:",
|
131 |
get_unique(var),
|
|
|
134 |
'Chemists'] if var == 'OCC1950' else ['Drugs and medicines',
|
135 |
'Fisheries',
|
136 |
'Glass and glass products', ])
|
137 |
+
st.form_submit_button("Apply")
|
|
|
138 |
|
139 |
df = get_area_data(var, filters)
|
140 |
df = df[df[var].isin(names)]
|