Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,13 +21,13 @@ text = pn.pane.Markdown(instructions)
|
|
| 21 |
filter_list = pn.widgets.CheckButtonGroup(
|
| 22 |
name='Filter Options',
|
| 23 |
margin=(20, 10),
|
| 24 |
-
options=[
|
| 25 |
sizing_mode='fixed',
|
| 26 |
-
button_type
|
| 27 |
)
|
| 28 |
|
| 29 |
# "+" button to show the search options
|
| 30 |
-
add_option_button = pn.widgets.Button(icon='search', name="", icon_size='2em', width=60, height
|
| 31 |
|
| 32 |
# Create a TextInput widget to get new filter options from the user
|
| 33 |
new_option_input = pn.widgets.TextInput(sizing_mode="stretch_width", background='lightgrey')
|
|
@@ -36,7 +36,7 @@ new_option_input = pn.widgets.TextInput(sizing_mode="stretch_width", background=
|
|
| 36 |
def add_new_option(event):
|
| 37 |
new_option = new_option_input.value
|
| 38 |
if new_option:
|
| 39 |
-
filter_list.options.
|
| 40 |
new_option_input.value = ""
|
| 41 |
|
| 42 |
add_option_button.on_click(add_new_option)
|
|
@@ -45,10 +45,8 @@ add_option_button.on_click(add_new_option)
|
|
| 45 |
template = pn.template.FastListTemplate(
|
| 46 |
title="EasySciRead",
|
| 47 |
header=[pn.Row(filter_list, add_option_button, new_option_input)],
|
| 48 |
-
# header=[pn.Row(filter_list, add_option_button, new_option_input, sizing_mode='stretch_width', vertical_align='middle')],
|
| 49 |
sidebar=[buttons],
|
| 50 |
main=[
|
| 51 |
-
pn.Row(sizing_mode='stretch_width'),
|
| 52 |
pn.Column(text),
|
| 53 |
],
|
| 54 |
accent_base_color="#88d8b0",
|
|
|
|
| 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 |
)
|
| 28 |
|
| 29 |
# "+" button to show the search options
|
| 30 |
+
add_option_button = pn.widgets.Button(icon='search', name="", icon_size='2em', width=60, height=30)
|
| 31 |
|
| 32 |
# Create a TextInput widget to get new filter options from the user
|
| 33 |
new_option_input = pn.widgets.TextInput(sizing_mode="stretch_width", background='lightgrey')
|
|
|
|
| 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)
|
|
|
|
| 45 |
template = pn.template.FastListTemplate(
|
| 46 |
title="EasySciRead",
|
| 47 |
header=[pn.Row(filter_list, add_option_button, new_option_input)],
|
|
|
|
| 48 |
sidebar=[buttons],
|
| 49 |
main=[
|
|
|
|
| 50 |
pn.Column(text),
|
| 51 |
],
|
| 52 |
accent_base_color="#88d8b0",
|