Hello,
I am trying to recreate selected-and-unselected-glyphs example, but using patch instead of circle marker.
There is a topic (sorry, can’t put more than 2 links since I am a new user) that is called ‘selecting image glyps’ with a very similar issue, but it doesn’t help
So, selection wouldn’t work for patches, or I am doing something wrong? Is there a way to overcome it?
My code:
from bokeh.models import Patch
import bokeh.plotting as bpl
from bokeh.io import show
p = bpl.figure(x_range=(0, 50), y_range=(0, 50), tools="tap,box_select,box_zoom,lasso_select,reset")
cord = [[27. , 29.80286528],
[26.69512804, 30. ],
[26.60664111, 31. ],
[26. , 31.34281636],
[25. , 31.78470131],
[24. , 31.81387118],
[23. , 31.84046742],
[22.4306812 , 32. ],
[22. , 32.31383552],
[21. , 32.03974069]]
renderer = p.patch([coord[0] for coord in cord], [coord[1] for coord in cord],
# set visual properties for selected glyphs
selection_color="firebrick",
# set visual properties for non-selected glyphs
nonselection_fill_color="blue")
renderer = p.circle([41, 56], [27, 43], size=50,
# set visual properties for selected glyphs
selection_color="firebrick",
# set visual properties for non-selected glyphs
nonselection_fill_color="blue")
show(p)
The result: Patch can’t be selected, circle can