Skip to content

Add support for BoxAnnotation.inverted#13810

Merged
mattpap merged 2 commits intobranch-3.5from
mattpap/13646_BoxAnnotation_inverted
Apr 9, 2024
Merged

Add support for BoxAnnotation.inverted#13810
mattpap merged 2 commits intobranch-3.5from
mattpap/13646_BoxAnnotation_inverted

Conversation

@mattpap
Copy link
Contributor

@mattpap mattpap commented Apr 5, 2024

Screencast.from.05.04.2024.23.49.22.webm
Code
import numpy as np

from bokeh.plotting import figure, show

N = 4000
x = np.random.random(size=N) * 100
y = np.random.random(size=N) * 100
radii = np.random.random(size=N) * 1.5
colors = np.array([(r, g, 150) for r, g in zip(50+2*x, 30+2*y)], dtype="uint8")

TOOLS="hover,crosshair,pan,wheel_zoom,zoom_in,zoom_out,box_zoom,undo,redo,reset,tap,save,poly_select,lasso_select,examine,help"

p = figure(tools=TOOLS, width=400, height=400)

from bokeh.models import BoxSelectTool
box_select = BoxSelectTool(persistent=True)
box_select.overlay.inverted = True
box_select.overlay.border_radius = 20
p.add_tools(box_select)

p.circle(x, y, radius=radii, fill_color=colors, fill_alpha=0.6, line_color=None)

show(p)

addresses #13646

@codecov
Copy link

codecov bot commented Apr 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.64%. Comparing base (69bddb5) to head (dc2ef81).
Report is 1 commits behind head on branch-3.5.

❗ Current head dc2ef81 differs from pull request most recent head d49459d. Consider uploading reports for the commit d49459d to get more accurate results

Additional details and impacted files
@@              Coverage Diff               @@
##           branch-3.5   #13810      +/-   ##
==============================================
- Coverage       92.65%   92.64%   -0.01%     
==============================================
  Files             326      326              
  Lines           20736    20735       -1     
==============================================
- Hits            19212    19209       -3     
- Misses           1524     1526       +2     

@mattpap mattpap force-pushed the mattpap/13646_BoxAnnotation_inverted branch from dc2ef81 to 027daeb Compare April 8, 2024 21:15
@mattpap mattpap merged commit e61219b into branch-3.5 Apr 9, 2024
@mattpap mattpap deleted the mattpap/13646_BoxAnnotation_inverted branch April 9, 2024 23:49
@droumis droumis added the grant: CZI R5 Funded by CZI Round 5 grant label Apr 30, 2024
Chiemezuo pushed a commit to Chiemezuo/bokeh that referenced this pull request Aug 27, 2024
* Add support for `BoxAnnotation.inverted`

* Add release notes
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants