Skip to content

Implements Individual Tool Visibility in Toolbar - #13593

Merged
mattpap merged 14 commits into
bokeh:branch-3.4from
jlindstrom12:branch-3.4
Feb 16, 2024
Merged

mattpap merged 14 commits into
bokeh:branch-3.4from
jlindstrom12:branch-3.4

Conversation

@zoeangell

Copy link
Copy Markdown
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

@codecov

codecov Bot commented Dec 11, 2023 •

Copy link
Copy Markdown

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

mattpap commented Dec 21, 2023

Copy link
Copy Markdown
Contributor

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

mattpap commented Feb 16, 2024

Copy link
Copy Markdown
Contributor

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
@mattpap

mattpap commented Feb 16, 2024

Copy link
Copy Markdown
Contributor

@zoeangell, thanks.

Chiemezuo pushed a commit to Chiemezuo/bokeh that referenced this pull request Aug 27, 2024
* Initial experimentation

* Implemented visibility toggle to all tools

* Edited comment for visible attribute in tools.py

* added basic unit tests for visible

* fixed lint errors

* Added unit tests for visible and toggleable featuer

* adding integration testing

* fixed linter errors

* fixed linter errors

* Refine the implementation

* Deprecate InspectTool.toggleable

* Properly initialize aliased properties

* Don't use toggleable, but rely on visible

* Add release notes

---------

Co-authored-by: Jacky Gao <jackygao02@andrew.cmu.edu>
Co-authored-by: Mateusz Paprocki <mattpap@gmail.com>
@github-actions

Copy link
Copy Markdown

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.

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

2 participants