Multiple issues with gridplot toolbar/tools

I want to make a gridplot with an inner toolbar and my defined tools, but I encounter multiple issues. The MRE below shows that inner toolbar option set to figure is not working and save/copy/fullscreen tools are not as my defined tools but as default ones. Is it possible to fix these issues? Thanks.

from bokeh.plotting import figure, show, gridplot, output_notebook
from bokeh.models import ColumnDataSource
from bokeh.models.tools import Toolbar, WheelZoomTool, FullscreenTool, CopyTool, SaveTool
output_notebook()

wheel_zoom_tool = WheelZoomTool(description='This is a wheel zoom tool', icon='maximize')
fullscreen_tool = FullscreenTool(description='This is a fullscreen tool', icon='maximize')
copy_tool = CopyTool(description='This is a copy tool', icon='maximize')
save_tool = SaveTool(description='This is a save tool', icon='maximize')

p = figure(
    tools=[wheel_zoom_tool, fullscreen_tool, copy_tool, save_tool],
    toolbar_inner=True,
)
p.line(x=[1, 2, 3], y=[1, 2, 3], color='red')

p2 = figure(tools='')
p2.line(x=[1, 2, 3], y=[2, 3, 4], color='blue')

show(gridplot(
    children=[[p2], [p]],
    merge_tools=True,
    toolbar_location='right',
    # toolbar_options={'tools': [wheel_zoom_tool, fullscreen_tool, copy_tool, save_tool]},
))

In addition, I took a look at the code here https://docs.bokeh.org/en/latest/_modules/bokeh/layouts.html#gridplot and I noticed some things:

  • toolbar_inner option provided to figure doesn’t work (toolbar_inner is not available as an option for gridplot)
  • toolbar_options provided to gridplot does not use tools option
  • SaveTool, CopyTool, ExamineTool and FullscreenTool tools have special treatment in the merge function

It’s not correct to say that it is not working, since the feature has never existed at all for gridplots in the first place. You can open a GitHub Issue to proposed this feature for future development.

toolbar_options provided to gridplot does not use tools option

I don’t understand what this means

SaveTool, CopyTool, ExamineTool and FullscreenTool tools have special treatment in the merge function

They do, necessarily, because there are significant differences between how a single plot works (one HTML canvas) vs a grid plot (multiple HTML canvases to coordinate). But it’s possible the situation with description can be improved, please feel free to file a bug report.

Is it possible to fix these issues?

Development is always ongoing, but like most OSS projects, limited resources means prioritization is unavoidable. I can’t promise anything about when/if things get looked at.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.