Making Toolbar 'HelpTool' behave like 'HelpButton' widget

I’m wondering if it’s possible to make the HelpTool (tools — Bokeh 3.3.0 Documentation) behave like the HelpButton widget (Widgets and DOM elements — Bokeh 3.3.0 Documentation) to display HTML content?

At the moment, it seems like it’s only possible to add strings like ‘Click the question mark to learn more about Bokeh tools.’ with a re-direct URL, that directs to something like ’ Plot tools — Bokeh 3.3.0 Documentation’.

It would be really useful if this can be made to behave like the ‘HelpButton’ where we can add quick to access information like we can with the ‘HelpButton’ widget below.

If anyone has an idea how this can be done, it would be much appreciated!

Thanks!

AFAIK This is not possible. The HelpTool predates the separate help button tooltip work by a decade or more and has not really changed much in all that time.

cc @mateusz

That’s unfortunate but wonder if it would be a useful update in the future.

On the other hand, is there a way to disable the re-direct behaviour on the ‘HelpTool’ so that clicking doesn’t do anything?

Currently the HelpTool action just does this unconditionally:

redirect is not nullable, so the best you could do is set it to an empty string. I am not sure what calling window.open on an empty string does, however, and it may be browser-dependent in any case.

Another option would be to not use the HelpTool at all, and use a CustomAction instead. You can have the configured CustomJS code do whatever you like.

That’s unfortunate but wonder if it would be a useful update in the future.

There are always lot of competing priorities. The most likely route for that to happen quickly would be for an interested new contributor to make a PR for it [1], especially given that CustomAction exists as an alternative.


  1. e.g. making redirect be nullable and then conditioning the window.open on that would be a straightforward change. ↩︎

Thanks @Bryan for pointing me to the CustomAction tool - it looks like that could be a solution.

There are always lot of competing priorities. The most likely route for that to happen quickly would be for an interested new contributor to make a PR for it [1], especially given that CustomAction exists as an alternative.

Yep, undestand. Thanks again for the quick reply!

1 Like

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