☰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

Drag with constraints

Community Support
maxclac
maxclac

Hello!

I was thinking that it would be nice to program a pendulum with bokeh, where one can drag the tip of the pendulum and release.
Now, I would like to focus on the dragging part, ignoring the physics part of the problem for the moment.
So, I have one point that I can drag around with the constraint that it must stay at the same distance of some other point. Is it in principle possible to have this in bokeh?

Thanks a lot!

⌁   Link to post
Bryan
Bryan

Definitely. You have access to x, y positions in the drag event callback. It’s most typical to set the glyph positions to be these same values to follow the mouse anywhere, but you can update the glyph positions differently in any way you need according to your needs.

⌁   Link to post
Bryan
Bryan

From what you have described I don’t think the PointDrawTool is what you want. It’s a high level tool that has many of its behaviors baked in. I think you want to define your own callbacks for discrete pan events.

⌁   Link to post

End of archived discussion · Replies are disabled