You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
It is not exactly a bug nor a feature request.
It is more an error in the documentation I would say that does not cover a special case and took me some time to find the correct way to do.
There is also some inconsistencies.
I use Holoviews with Bokeh, I don't know if those "inconsistencies" exist because of other optional backend such as Plotly.
ALL software version info
Python 3.9
bokeh 2.4.2
holoviews 1.14.8
Description of expected behavior and the observed behavior
From the Holoviews User Guide, I expected the tools to be deactivated by default (that's why we have an active_tools setting), I see that a set of tools are defined as default (default_tools ['save', 'pan', 'wheel_zoom', 'box_zo...) but that we can overwrite it with anything, and the tools setting feels like a duplicate setting with default_tools. I expected to have only the tools setting with the default value of default_tools
Without specifying any active_tools, we get by default de "pan" tool active. While I think this is a good default, this is a bit inconsistent with the option active_tools which, according to the help (I used hv.help(hv.Curve)) is an empty list.
By reading the documentation of Bokeh I understand that the underlying setting is set to "auto" in Bokeh and that's how it behave. But as a user of Holoviews, I believe it makes more sense to have it set to "None" by default in Bokeh and have a sensitive default (like ["pan"]) for active_tools.
If a user set tools with tools that are already presents in the default_tools, we get duplicated widget such as this:
While I don't think it is necessary for Holoviews/Bokeh to add logic to remove duplicate, (in the case a user explicitly write tools = ["box_zoom", "box_zoom"] for exemple), I do think that we have a duplicate of settings here, the tools and default_tools are basically the same, so I think default_tools should be removed and instead tools should have a default value.
While I throught that unless I set active_tools the tool would not be active by default, I tried to set "box_zoom" active and it worked, then I added to tools the "hover" and when I added it to the list of active_tools, I an error with a whole traceback and was quiet hard for me to understand what I did wrong.
And I understood that for inspect tools, I need to specify a list, so the correct way to do is:
This was confusing and think it should either be documented or Holoviews should still expect a list and parse it itself for this case before passing it on to Bokeh.
This is a consequence from point 1, how do I add tools without having it active by default such a "hover" from Holoviews ?
Complete, minimal, self-contained example code that reproduces the issue
importnumpyasnpimportpandasaspdimportholoviewsashvfromholoviewsimportoptshv.extension('bokeh')
x=np.arange(100)
y=np.random.rand(100)
df=pd.DataFrame({"x": x, "y": y})
curve_opts=hv.opts.Curve(
title="My title",
color="red",
line_width=1.50,
show_grid=True,
xrotation=0,
# Play arround with the tools and active_tools linestools=["hover"],
# tools=["box_zoom", "hover"],active_tools=["box_zoom", "wheel_zoom", "hover"],
# active_tools=["box_zoom", "wheel_zoom", "hover"],min_height=225,
min_width=400,
responsive=True,
)
hv.Curve(data=df, kdims="x", vdims="y").opts(curve_opts)
The text was updated successfully, but these errors were encountered:
Hi,
It is not exactly a bug nor a feature request.
It is more an error in the documentation I would say that does not cover a special case and took me some time to find the correct way to do.
There is also some inconsistencies.
I use Holoviews with Bokeh, I don't know if those "inconsistencies" exist because of other optional backend such as Plotly.
ALL software version info
Python 3.9
bokeh 2.4.2
holoviews 1.14.8
Description of expected behavior and the observed behavior
From the Holoviews User Guide, I expected the tools to be deactivated by default (that's why we have an
active_tools
setting), I see that a set of tools are defined as default (default_tools ['save', 'pan', 'wheel_zoom', 'box_zo...
) but that we can overwrite it with anything, and thetools
setting feels like a duplicate setting withdefault_tools
. I expected to have only thetools
setting with the default value ofdefault_tools
active_tools
, we get by default de "pan" tool active. While I think this is a good default, this is a bit inconsistent with the optionactive_tools
which, according to the help (I usedhv.help(hv.Curve)
) is an empty list.By reading the documentation of Bokeh I understand that the underlying setting is set to "auto" in Bokeh and that's how it behave. But as a user of Holoviews, I believe it makes more sense to have it set to "None" by default in Bokeh and have a sensitive default (like ["pan"]) for
active_tools
.tools
with tools that are already presents in thedefault_tools
, we get duplicated widget such as this:While I don't think it is necessary for Holoviews/Bokeh to add logic to remove duplicate, (in the case a user explicitly write
tools = ["box_zoom", "box_zoom"]
for exemple), I do think that we have a duplicate of settings here, thetools
anddefault_tools
are basically the same, so I thinkdefault_tools
should be removed and insteadtools
should have a default value.active_tools
the tool would not be active by default, I tried to set "box_zoom" active and it worked, then I added totools
the "hover" and when I added it to the list ofactive_tools
, I an error with a whole traceback and was quiet hard for me to understand what I did wrong.I found the solution in the Bokeh documentation
And I understood that for inspect tools, I need to specify a list, so the correct way to do is:
This was confusing and think it should either be documented or Holoviews should still expect a list and parse it itself for this case before passing it on to Bokeh.
Complete, minimal, self-contained example code that reproduces the issue
The text was updated successfully, but these errors were encountered: