How can I configure the TapTool so it does not hide other data points when clicked?

877 views Asked by At

At the moment when a data point is clicked, all other data points are shaded. Is there a way to prevent this?

fig = fig.circle(x, y)

Ideally, I would like to increase size of the selected circle instead. Is there an easy why to do so?

Update

Seems we cannot change size... according to here:

Only the visual properties of selection_glyph and nonselection_glyph are considered when renderering. Changing positions, sizes, etc. will have no effect.

However, we can simulate it using line_width property, it becomes more fun if I combine it with line_dish.

2

There are 2 answers

3
bigreddot On BEST ANSWER

As of Bokeh 0.12.15, you can set nonselection_glyph=None when you call a glyph method, for example:

p.circle(x, y, radius=radii, fill_color="navy", 
         line_color=None, fill_alpha=0.6, 

         # this is the new part
         nonselection_glyph=None) 
0
Soltius On

Using bokeh 2.4.3, bigreddot's answer doesn't work for me, I got "unexpected attribute" when using nonselection_glyph directly in circle's call.

The following snippet worked however :

renderer = p.circle(x, y, radius=radii, fill_color="navy", line_color=None, fill_alpha=0.6) 
renderer.nonselection_glyph = None