New Tooltip in bokeh 3.3.0

The position of the tooltip in 3.3.0 changed from absolute to fixed

I used to position my tooltip on the right of the figure (showing the value of a crosshair) by adjusting the left parameter of a customised tooltip


–tooltip-arrow-color: black;
–tooltip-arrow-half-height: 0px;
–tooltip-arrow-width: 0px;
–tooltip-color: {background_fill_color};
–tooltip-text: {text_color};
font-size: 1em;
margin : 0px;
border : 0px;
padding : 0px;
opacity: 1;
left : {p.width}px !important;
div.bk-tooltip-content > div > div:not(:first-child) {{
display: none !important;

when inner_width was changed:

p.on_change(‘inner_width’, update_hover_y)

the issue is that now that the position is fixed, if my figure is in a plotgrid, not top left of it, the position is incorrect.

Is there a way to know the fixed position of the figure (left and top) within the page, so i can update my toolltip using something like
p.on_change(‘left_position’, update_hover_y)


I’m afraid don’t know the answer to this question. There was a recent issue that is fixed in upcoming 3.3.1

Resolve tooltip positioning issue with `contain: strict` by mattpap · Pull Request #13431 · bokeh/bokeh · GitHub

But it’s unclear whether you are seeing that issue or whether you will simply need to adapt your code somehow to the new fixed position internal implementation of tooltips. For this specific technical question you might have better luck posing a new development discussion on GitHub:

bokeh/bokeh · Discussions · GitHub

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.