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

Autohide toolbar #8284

Closed
jbednar opened this Issue Sep 27, 2018 · 5 comments

Comments

4 participants
@jbednar
Copy link
Contributor

jbednar commented Sep 27, 2018

Right now, when a Bokeh plot has a toolbar, the toolbar is always visible. This helps people see the tools that are available, but it is distracting when one is primarily reading through a long document, looking at several plots and not wishing to interact with any one of them.

To support this usage, I'd prefer that the default behavior is that the tools are visible only when the mouse is actually inside the plot area, and otherwise they are silently hidden (which would then also apply on export, providing a cleaner exported figure). Presumably the tools could be set to be invisible (alpha=0) whenever the mouse is outside the plot area?

An implementation of this would be to add an option autohide to Toolbar, and once supported we could debate whether it should be True or False by default.

@bryevdv

This comment has been minimized.

Copy link
Member

bryevdv commented Sep 27, 2018

Just an FYI noting that it is expected @jsignell to work on this after #8085 is merged

@mattpap

This comment has been minimized.

Copy link
Contributor

mattpap commented Sep 27, 2018

This will require more work than just adding an option to a toolbar. Currently toolbar, as a part of a plot, can be only located in side panels, in which case any kind of hiding doesn't make sense. There is no way to add a toolbar to the center layout. In #8085 I stared implementing "anchor layout" to allow this, but this is far from being finished.

@mattpap mattpap added this to Triage in Focus: Layout Sep 27, 2018

@bryevdv

This comment has been minimized.

Copy link
Member

bryevdv commented Sep 27, 2018

@mattpap the example upon which this is based, simply hides the toolbar without altering the layout. That is expressly all that is wanted or being asked for. The toolbar does not need to be in the center layout, it just needs to allocate space as if it were going to draw, but then not actually draw (unless the cursor is inside w hit region).

For that matter, we could even flip things: we could have a div on top of the toolbar that fades to and from transparent (instead of having the toolbar itself fade to and from opaque)

@jbednar

This comment has been minimized.

Copy link
Contributor Author

jbednar commented Sep 27, 2018

Not actually drawing it is fine, but it's also fine to draw it but using transparent pixels; whatever is easier. Hopefully we wouldn't have to resort to a div on top of the toolbar, because that would interfere with a page where the background isn't a solid color.

But yes, ideally the layout would be unchanged regardless of whether the tools are visible or not; it would be very distracting to have the plot jump around and resize when the mouse enters the area.

@jsignell

This comment has been minimized.

Copy link
Contributor

jsignell commented Sep 28, 2018

@mattpap, are you worried about how the tool bar should show up when the mouse is over the plot? Is it hard for an event from the center layout to have an effect in the toolbar?

@jsignell jsignell referenced this issue Oct 11, 2018

Merged

Autohide toolbar #8318

3 of 3 tasks complete

@bryevdv bryevdv modified the milestones: short-term, 1.0 Oct 15, 2018

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