0
我希望能夠從Bokeh圖中的任何選擇工具(方框選擇工具,水龍頭工具等)返回選定點的列表。我怎麼做?這是我如何創建劇情的一個例子。謝謝!如何返回Bokeh中選定點的列表?
from bokeh.io import vform
from bokeh.models import CustomJS
from bokeh.models import ColumnDataSource
from bokeh.models.widgets import Select
from bokeh.plotting import figure, output_notebook, show
import pandas as pd
from bokeh.models import OpenURL, CustomJS, ColumnDataSource, HoverTool, Div, WheelZoomTool, TapTool, BoxSelectTool, BoxZoomTool, PanTool, ResetTool, SaveTool
output_notebook()
# Create Column Data Source that will be used by the plot
source = ColumnDataSource(data=dict(x=[1,2,3], y=[1,2,3]))
# Create figure
p = figure(plot_height=600, plot_width=700, title='', tools = [TapTool(), BoxSelectTool()])
p.circle(x='x', y='y', source=source, size=8, fill_alpha=0.33, line_color=None)
# Display data
show(p, notebook_handle=True);