0
여러 필터를 기반으로 테이블을 표시하려고합니다.Bokeh DataTable 다중 입력/위젯/필터
def update():
current = df[(df['nb_words'] >= slider.value[0]) & (df['nb_words'] <= slider.value[1])].dropna()
source.data = {
'id' : current.id,
'author' : current.author,
'nb_words' : current.nb_words,
'text' : current.text,
'topic' : current.topic,
'national' : current.national
}
nb_words = RangeSlider(title="Min nb employees", start=0, end=1000, value=(0, 1000), step=10, format="0,0")
topic = CheckboxButtonGroup(labels=list(df.topic.unique()))
national = RadioButtonGroup(labels=['Yes', 'No'], active=0)
text = TextInput()
nb_words.on_change('value', lambda attr, old, new: update())
data_table = DataTable(source=source, columns=columns, width=1000, fit_columns=False)
controls = widgetbox(nb_words, button)
table = widgetbox(data_table)
여기서 업데이트는 nb_words
의 슬라이더가 변경된 경우에만 적용됩니다.
그러나 한 번에 여러 개의 선택을 허용하고 싶습니다. 사용자가 어떻게 여러 위젯을 사용하여 테이블을 업데이트 할
- 20 <= nb_words <= 200
- topic = ["topic1", "topic2"]
- national = 1
- and text that contains the word "fantastic"
로 행을 선택하는 경우 예를 들어
이 표는 적절하게 업데이트 할 것입니다?