Last active
February 8, 2023 21:43
-
-
Save cfbastarz/b12aa8ddf293c264579f0ed1c1c996cf to your computer and use it in GitHub Desktop.
Print string from dropdown menu items (Holoviews Panel)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To be used in a Jupyter notebook | |
import panel as pn | |
pn.extension() | |
variable_list = ['var1', 'var2', 'var3'] | |
def get_val(variable): | |
return variable | |
variable = pn.widgets.Select(options=variable_list) | |
panel = pn.pane.Str() | |
@pn.depends(variable.param.value, watch=True) | |
def update_pane(variable): | |
panel.object = get_val(variable) | |
update_pane(variable.value) | |
pn.Row( | |
pn.Row(variable), | |
panel, | |
)#.servable() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment