I have a bokeh rect and a tooltip which shows some information about each cell in the rect. I would like to click on a cell and the tooltip should stay as long as I click on another cell in the rect. I guess it could work with JS but I do not know how to implement it.
My tooltip function looks like:
from bokeh.models import HoverTool
def hovertool():
tooltips = """
<div>
<style>
.city {
background-color: tomato;
width:550px!important;
max-height:900px!important;
overflow-y:auto;
}
</style>
<div class="city">
<h2>Paris</h2>
<div>
<span style="font-size: 18px; font-weight: bold; color:black; background-color: white;"> Test </span>
</div>
</div>
</div>
"""
TOOLTIPS = HoverTool(tooltips = tooltips)
return TOOLTIPS
In my main function I use it like:
TOOLTIPS = hovertool()
p.add_tools(TOOLTIPS)
show(p)
Thanks for any hints!