☰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

Data space bounds of AnnularWedge glyph

Community Support
jragz
jragz

I’m looking to use a DoubleTap event to trigger a CDS update with AnnularWedge glyphs. DoubleTap returns the x/y coordinates for the data space, which I would like to use to determine which wedge was DoubleTap’d on.

Is there a way to access the bounds (data space) of each wedge? The methods/attributes in the docs don’t seem to expose them.

Alternatively, if another method will achieve what I’m trying to do, I’m interested in that as well (the less JS the better :slight_smile: )

Thanks!

⌁   Link to post
Bryan
Bryan

I thought the TapTool could be configured for double-taps instead of single taps, but that does not seem to be the case. That’s too bad because just using the built-in selection/hit-testing machinery would be alot easier. In any case, the data you are asking about must already be availalble to you. You would have had to supply the center coordinates x0, y0, inner/outer radius and start/end angles in the first place. You will have to use this information to determine if the x,y data coordinate from the tap tool hits any of those. If you are asking how to do the hit-test for annular wedge, then for each individual wedge, it is roughly:

  • is (x-x0)^2 + (y-y0)^2 > outer_radius**2 ? If so, not a hit
  • is (x-x0)^2 + (y-y0)^2 < inner_radius**2 ? If so, not a hit
  • is the “angle” (use atan to compute) between start_angle and end_angle ? If so, is a hit.
⌁   Link to post

End of archived discussion · Replies are disabled