Panel | Tutorial 9 Linking(Unfinished)

2023/02/19 11:38 AM posted in  Coding Notes   comments
Tags:  #Panel

  • convenient high-level API to link objects via Python calls
  • powerful but lower-level Python API provided by param
  • obj.jslink: high-level API to link objects via JS code
  • obj.jscallback: a lower-level API to define arbitrary Javascript callbacks

Python Link Using Link Method

markdown = pn.pane.Markdown("Some text")
text_input = pn.widgets.TextInput(value=markdown.object), value='object')

pn.Row(text_input, markdown)

Link + Callback

m = pn.pane.Markdown("")
t = pn.widgets.TextInput()

def callback(target, event):
    target.object = + '!!!', callbacks={'value': callback})
t.value="Some text"

pn.Row(t, m)