I have this code:
tooltips = [('Pressure', '@y'), ('Force', '@x')]
fig = figure(tooltips=tooltips)
if show_line == 'yes':
fig.line(x, y, color='red')
if show_vertices == 'yes':
source = ColumnDataSource(data={'x': vertex_x, 'y': vertex_y, 'desc': ['name_1', 'name_2', ''name_3]})
tooltips.insert(0, ('Point', '@desc'))
fig.scatter(x='x', y='y', color='blue', source=source)
I have one figure with both line and points on that line. When the line is shown on the figure I need the hover tool only shows X an Y coordinates. When the vertices are added to the figure I need the hover tool to show a description for each point. What I thought I could do is to insert an extra element in tooltips list under the second IF condition. But this approach didn’t work. The figure in both conditions is showing only [(‘Pressure’, ‘@y’), (‘Force’, ‘@x’)] and not this [(‘Point’, ‘@desc’), (‘Pressure’, ‘@y’), (‘Force’, ‘@x’)]
Is it possible to solve it without CustomJS?
Thanks

