Custommizing toolbar

I’m working on a solution that is making use of multiple bokeh graphs.
For one area, I need to create one or multiple rect figures. for these I need zoom, hover, reset and pan functionality, which all work.
the issue I’m facing is that I need to limit the toolbar to only displaying the reset tool, or if that is not working to display the reset tool as the top most tool. The graph is has to be very shallow on the y axis, so I only have room for one symbol. There is no intention to allow unselecting the pan, zoom and hover functionality, so I don’t need these symbols / buttons accessible.
Hence my question: How can I re-order the tool bar to the sequence that works for my application?

Thanks and all the Best!

If I understand the ask correctly, this is not currently possible, at least not with any built in APIs. Every tool that is added to a plot will show up the toolbar, regardless of whether it is active or not. It seems like a reasonable feature request so I’d encourage you to open a Github Issue about it (ideally with a complete small example that illustrates what you would like to be able to do). In the mean time, all I can suggest is that the toolbar elements are DOM elements, so you might have some luck trying to explicitly target them with CSS that hides them. YMMV

Thank you Bryan,
adding a display:none to the bk-tool-icon-xxx classes in my application css solved the problem. (so no tinkering with the bokeh files necessary)
I’ll open a github issue and will be asking two functionalities that should be able to be added at the same time: Hiding certain icons and defining the sequence by the order the tools are added to the toolbar.
Kudos for the quick reply!

1 Like