Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements Individual Tool Visibility in Toolbar #13593

Merged
merged 14 commits into from
Feb 16, 2024

Conversation

zoeangell
Copy link
Contributor

Added the ability to set a tool's visibility in the toolbar. This was done by adding the visible property to the Python Tool Class and Tool module in bokehjs. We modeled the functionality and implementation of this feature after the toggleable property for InspectTools (e.g. CrosshairTool and HoverTool).

Setting visible=False for a tool will make it not show up in the toolbar, but it will still have its functionality.

To test our feature we wrote Javascript unit tests and integration tests.

Graph with box_edit = BoxEditTool(visible = True)
Screenshot 2023-12-11 at 1 37 11 PM

Graph with box_edit = BoxEditTool(visible = False)
Screenshot 2023-12-11 at 1 38 50 PM

Resolves #8153

Copy link

codecov bot commented Dec 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a9b4d0f) 92.58% compared to head (a786b5b) 92.58%.

Additional details and impacted files
@@             Coverage Diff             @@
##           branch-3.4   #13593   +/-   ##
===========================================
  Coverage       92.58%   92.58%           
===========================================
  Files             325      325           
  Lines           20728    20729    +1     
===========================================
+ Hits            19191    19192    +1     
  Misses           1537     1537           

@mattpap mattpap added this to the 3.4 milestone Dec 21, 2023
@mattpap
Copy link
Contributor

mattpap commented Dec 21, 2023

I need to think about this approach in the context of other ongoing work (e.g. PR #13571), i.e. whether it makes sense for tools to be visible or whether it's their UI representation that should carry this setting.

@mattpap mattpap self-requested a review December 21, 2023 11:15
@mattpap
Copy link
Contributor

mattpap commented Feb 16, 2024

I did a little clean up of this PR, deprecated toggleable in favor of the new visible property and fixed aliased properties in bokehjs (previously they didn't allow correct initialization).

@mattpap mattpap merged commit e5e6e2d into bokeh:branch-3.4 Feb 16, 2024
30 checks passed
@mattpap
Copy link
Contributor

mattpap commented Feb 16, 2024

@zoeangell, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Hide some (but not all) tools from toolbar
2 participants