holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.66k stars 396 forks source link

GridSpace with one axis renders without tools in Bokeh #6222

Open stanwest opened 2 months ago

stanwest commented 2 months ago

Software version info

Expected and observed behaviors

When rendered with the Bokeh backend, GridSpace plots that have one axis lack any tools; the toolbar shows only the Bokeh icon. The behavior I expect is for the plots to have tools, as happens with, e.g., Bokeh 2.4.3 and Holoviews 1.17.1.

Complete, minimal, self-contained example code that reproduces the issue

import holoviews
holoviews.extension("bokeh")

row_grid = holoviews.GridSpace(
    {u: holoviews.Labels([(0, 0, u)]) for u in "AB"}, kdims=["u"]
).options(holoviews.opts.Labels(toolbar=None))
row_grid

row_grid, bokeh 3 4 1, holoviews 1 18 3

(The toolbar=None option works around #6126.)

When one adds another dimension, the GridSpace renders with tools, as I expect:

col_grid = row_grid.add_dimension("t", 0, "T")
col_grid

col_grid, bokeh 3 4 1, holoviews 1 18 3

However, when one suppresses either axis of that GridSpace, the result again renders without tools:

col_grid.options(holoviews.opts.GridSpace(yaxis=None))

onlyx_col_grid, bokeh 3 4 1, holoviews 1 18 3

col_grid.options(holoviews.opts.GridSpace(xaxis=None))

onlyy_col_grid, bokeh 3 4 1, holoviews 1 18 3

(The vertical shift of the u axis is another problem.)

With Bokeh 2.4.3 and Holoviews 1.17.1, all four of the above plots have full toolbars.