1
我想在具有自動完成功能的jupyter筆記本中使用文本輸入小部件。因此我使用bokeh.models.widgets.inputs
的AutocompleteInput()
。從jupyter筆記本中的散景小部件訪問數據
from bokeh.models.widgets.inputs import AutocompleteInput
from bokeh.io import output_notebook
from bokeh.plotting import show
output_notebook()
txt_input = AutocompleteInput(completions=['val1', 'val2'])
show(txt_input)
Displaying the widget and autocompletion works fine,但是如何在更改時訪問輸入小部件的值? txt_input.value
只返回默認值(一個空字符串)。
不錯的破解!我可能值得注意的是,需要執行'from bokeh.models import CustomJS'另外 – joergd
我在代碼中添加了答案 – bigreddot