@Bryan I took your example from one of the pages @nmasnadi pointed to. It works OK with the circle example you give. And also with scatter, but it doesn’t seem to work with line (unless the point you need to click is really hard to locate and I haven’t managed it). Is there a way to get it to work for line?
from bokeh.layouts import column
from bokeh.plotting import figure, curdoc
from bokeh.models.sources import ColumnDataSource
from bokeh.models import CustomJS, LabelSet, TapTool
p = figure()
points = ColumnDataSource(data=dict(x=[1,2,3,4,5], y=[2,6,3,9,7], extra=list("abcde")))
#p.circle(x='x', y='y', source=points, size=20, alpha=0.5) # works
#p.line(x='x', y='y', source=points) # does not work
p.scatter(x='x', y='y', source=points) # works
labels = ColumnDataSource(data=dict(x=[], y=[], t=[], ind=[]))
p.add_layout(LabelSet(x='x', y='y', text='t', y_offset=10, x_offset=10, source=labels))
code = """
const data = labels.data
for (let i=0; i<points.selected.indices.length; i++) {
const ind = points.selected.indices[i]
data.x.push(points.data.x[ind])
data.y.push(points.data.y[ind])
data.t.push(points.data.extra[ind])
data.ind.push(ind)
}
labels.change.emit()
"""
callback=CustomJS(args=dict(points=points, labels=labels), code=code)
p.add_tools(TapTool(callback=callback))
# add column - need to run this with bokeh serve --show
curdoc().add_root(column(p))