☰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

Add drag event to plot (part2)

Community Supportbokeh
Bryan
Bryan

Bokeh drag events only apply to the canvas and AFAICT the drag handle is outside the canvas.

Do plot.width and plot.height not generate change events? There may be some reason that they don’t in responsive sizing modes (I don’t know for sure, offhand), but that’s what I would start with.

Edit: actually plot.inner_height and plot.inner_width might be better options to try, I think they should trigger regardless. Their values subtract any toolbar and other extra extents… they report the dimensions of the “plot frame”, i.e the axes, inside the canvas, which is actually what I think you want given that you are computing an angle…

⌁   Link to post
RickD
RickD

when I use
p.inner_width.js_on_event(‘tap’, callback) or p.width

i get
AttributeError: ‘int’ object has no attribute ‘js_on_event’

perhaps replace ‘tap’ with something else?

⌁   Link to post
Bryan
Bryan

“event” callbacks are for UX events. I was suggesting a property change callback:

plot.js_on_change("inner_width", callback)

These properties should get updated internally by BokehJS whenever the dimensions change.

You want to get rid of the requirement for the user to tap, and have it update automatically, or did I misunderstand?

⌁   Link to post

End of archived discussion · Replies are disabled