Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,14 +17,11 @@ of cross-filtering.
|
|
| 17 |
|
| 18 |
text = pn.pane.Markdown(instructions)
|
| 19 |
|
| 20 |
-
# List to store the entered options
|
| 21 |
-
entered_options = []
|
| 22 |
-
|
| 23 |
# Add filter list row with spacing
|
| 24 |
filter_list = pn.widgets.CheckButtonGroup(
|
| 25 |
name='Filter Options',
|
| 26 |
margin=(20, 10),
|
| 27 |
-
options=
|
| 28 |
sizing_mode='fixed',
|
| 29 |
button_type='default'
|
| 30 |
)
|
|
@@ -37,9 +34,9 @@ new_option_input = pn.widgets.TextInput(sizing_mode="stretch_width", background=
|
|
| 37 |
|
| 38 |
# Callback for the "+" button to add the new option to the filter list
|
| 39 |
def add_new_option(event):
|
| 40 |
-
new_option = new_option_input.value
|
| 41 |
if new_option:
|
| 42 |
-
|
| 43 |
new_option_input.value = ""
|
| 44 |
|
| 45 |
add_option_button.on_click(add_new_option)
|
|
|
|
| 17 |
|
| 18 |
text = pn.pane.Markdown(instructions)
|
| 19 |
|
|
|
|
|
|
|
|
|
|
| 20 |
# Add filter list row with spacing
|
| 21 |
filter_list = pn.widgets.CheckButtonGroup(
|
| 22 |
name='Filter Options',
|
| 23 |
margin=(20, 10),
|
| 24 |
+
options=[],
|
| 25 |
sizing_mode='fixed',
|
| 26 |
button_type='default'
|
| 27 |
)
|
|
|
|
| 34 |
|
| 35 |
# Callback for the "+" button to add the new option to the filter list
|
| 36 |
def add_new_option(event):
|
| 37 |
+
new_option = new_option_input.value
|
| 38 |
if new_option:
|
| 39 |
+
filter_list.options = new_option_input.value.split(',') # Split the comma-separated input into a list
|
| 40 |
new_option_input.value = ""
|
| 41 |
|
| 42 |
add_option_button.on_click(add_new_option)
|