Skip to content

HoverTool model callback property #12739

Discussion options

You must be logged in to vote

Thanks for the response. Yeah, chaining callbacks gets messy in a hurry.

FYI my workaround was simply to add js_on_event('mousemove',cb) to the figure holding the hovertool, and then cb was something like:

cb=CustomJS(args= dict( src=src,...), code=```
if (src.inspected.indices.length>0){
    //do stuff
    }

I figured since the Hovertool.callback hits on every mousemove anyway, I might as well just mimic it on the figure with an if statement checking for inspection. This works fine, I can add n callbacks this way without needing them executing inside each other.

I do agree it'd be good to modernize the HoverTool callback, one way or another.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by gmerritt123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants