私は最初のプロットのデータポイントのユーザータップにdivを動的に入力し、2番目のプロットを下に自動的に移動するプロットがあります。レイアウト上でsizing_modeを設定しようとしましたが、プロットはレンダリングされません。これは、タブウィジェットとの対話である可能性があります。これまでのところ、Pythonのコールバックはタップで正しくトリガーされていますが、Divの高さは変わらず、テキストは途切れています。次のように私は0から600まで戻っ前後本部と親はWidgetboxの高さの両方を設定しようとしていますが、プロットは更新されません見ることができるようにBokehでPythonコールバック経由でdivをサイズ変更
コールバックは、
def update_plot_points_select(attr, old, new):
#function to change Divs if points are selected
#tap can either be a tap or untap, 1 or more points
#Show chosen word in text box
if len(new['1d']['indices']) > 0:
#update search text input field
text_input_word_search_in_documents.value = source.data['term'][new['1d']['indices'][0]]
#update Div's
text_display_category_div.update(text=source.data['term'][new['1d']['indices'][0]]+'<br/>'+'line')
text_display_category_div.update(height=600)
text_display_not_category_div.update(text=source.data['term'][new['1d']['indices'][0]]+'<br/>'+'line')
text_display_not_category_div.update(height=600)
category_scatter_graph_layout.children[0].children[1].children[1].children[0].height = 600
category_scatter_graph_layout.children[0].children[1].children[1].children[1].height = 600
else:
text_input_word_search_in_documents.value = ''
text_display_category_div.update(text='')
text_display_category_div.update(height=0)
text_display_not_category_div.update(text='')
text_display_not_category_div.update(height=0)
category_scatter_graph_layout.children[0].children[1].children[1].children[0].height = 0
category_scatter_graph_layout.children[0].children[1].children[1].children[1].height = 0
です。おそらく私はこの問題をdiv.textのhtmlで解決できます。どんなアイデアも参考になるでしょう。
Divのテキストを切り取ったものを以下に示します。