Hovertool Display Direction


I’ve scoured the internet for info on this. I have multiple hovertools (displaying water well screens and geologic description)… in my specific case it would be extremely beneficial if I could make one of the tooltips always display to the right, and the other always to the left: It would eliminate overlap for me completely and users would be able to see the well screen information and the geologic info side by side when the hover. See my screengrab below:


I’ve tried using existing html custom tooltip snippets found on the internet to try and “tell” the tooltip where to display from… rough example here:

sc_custom_tooltip = '''
        'float:left; position:right'
    <b>X: </b> $x <br>
    <b>Y: </b> $y

“float” and “position” args don’t seem to do what I want… any tips? Thanks so much.

Additional info that might help is that I’m using Rect at the moment for both these glyphs… and while “anchor” is available to assign to them (was hoping this might at least provide a workaround), it appears to not be implemented yet for Rect (https://github.com/bokeh/bokeh/issues/8981)… but is for quad. I suppose I could turn my Rect glyphs into quads and try and use the anchor property to move the two hovers out of each other’s way… but really what I’d still really like is the ability to control the direction the hovertool appears in for each.

You want to set the attachment property.

1 Like

Absolutely fantastic! Thank you so much.