Hi,
maybe I am a little bit confused, but I struggle building up a simple Text with a variable that is updated by running a method or input widget.
I thought about just taking a pn.pane.Markdown like this
import param
import holoviews as hv
import panel as pn
hv.extension('bokeh')
pn.extension()
class UpdateText(param.Parameterized):
someinput = param.ObjectSelector(default = '0', objects=['0','1','2','3','4','5','6'])
def dchg_explanation(self):
text = pn.pane.Markdown("""
###Selectet Discharge
The selected discharge is: self.someinput ausgewählt.
Some more text.""")
return text
test = UpdateText()
pn.Row(test.param, test.dchg_explanation)
Maybe I just don’t know how to handle Markdown…
Maybe anyone can give me a hint.
Sorry for the necropost, but Google still surfaces this post and I wanted to add an alternative usage. I work mainly with pn.widgets.*. Based on the above, I discovered that the following syntax is also valid:
import panel as pn
pn.extension()
some_input = pn.widgets.Select(
name='Some Input',
options=list(range(7))
)
@pn.depends(some_input)
def dchg_explanation(some_input):
return pn.pane.Markdown(
f"""
### Selected discharge
The selected discharge is: {some_input} ausgewählt.
Some more text.
"""
)
pn.Row(some_input, dchg_explanation)