☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Trigger HoverTool on hover text string in Div

Community Support
gmerritt123
gmerritt123

Wondering if it’s possible for me to trigger a hovertool when hovering over a specific text string in a Div object. My text in the div is fairly technical jargon and I’d like to give users the ability to hover over a particular phrase/word and get a hovertool “definition” of that thing.

My other thought/idea for this would be to somehow trigger a js callback either on hover or on click of a specific text string within the div - which would update another div (say, on the side of the plot or something) with the definition lookup.

Any thoughts/help much appreciated. Thanks!

⌁   Link to post
gmerritt123
gmerritt123

Wow talk about a fast response! Thanks. What about option 2? Can I embed some html/css syntax in the div text to have it “recognize” certain words and trigger a callback when clicked? According to the documentation I can trigger js_event_callbacks on the whole div object… but not on specific text within the div itself eh?

⌁   Link to post
Bryan
Bryan

Yes, Bokeh JS callbacks only pertain to property values, e.g. the entire text of the Div. I won’t say it’s impossible to imagine some way to do what you are suggesting, but it would require running your own JS code outside Bokeh, and I am afraid I don’t really have any concrete suggestions beyond that.

⌁   Link to post

End of archived discussion · Replies are disabled