-
-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please add tooltips to panes and widgets #1298
Comments
Yes, that's really a classic element of a UI that is missing. |
@philippjfr it looks like tooltips are supported in Bokeh 3. Do you know if Panel will also support them once it's compatible with Bokeh 3.x? |
Yep, it's already implemented on branch-1.0, unfortunately it is not yet implemented for all widgets. |
The current status of description support for widgets is shown in the table below. I think a handful more can be checked off by giving StaticText a description and using it for composite sliders like the editable sliders.
Code usedimport datetime as dt
import pandas as pd
import panel as pn
from panel.widgets import *
from panel.widgets import __all__ as wlist
from panel.widgets.indicators import __all__ as ilist
pn.extension("codeeditor", "jsoneditor", "tabulator", "texteditor") # terminal
o = {"description": "Test"}
oo = dict(**o, options=list("ABC"))
do = dict(**o, start=dt.datetime(2020, 1, 1), end=dt.datetime(2020, 1, 2))
df = dict(**o, value=pd.DataFrame(range(10)))
widgets = (
ArrayInput(name="ArrayInput", **o),
AutocompleteInput(name="AutocompleteInput", **o),
Button(name="Button", **o),
Checkbox(name="Checkbox", **o),
CheckBoxGroup(name="CheckBoxGroup", **oo),
CheckButtonGroup(name="CheckButtonGroup", **oo),
CodeEditor(name="CodeEditor", **o),
ColorPicker(name="ColorPicker", **o),
CrossSelector(name="CrossSelector", **o),
DataFrame(name="DataFrame", **df),
DatePicker(name="DatePicker", **o),
DateRangeSlider(name="DateRangeSlider", **do),
DatetimePicker(name="DatetimePicker", **do),
DatetimeRangeSlider(name="DatetimeRangeSlider", **do),
DateSlider(name="DateSlider", **do),
DatetimeInput(name="DatetimeInput", **do),
DatetimeRangeInput(name="DatetimeRangeInput", **do),
StaticText(name="StaticText", value="Test", **o),
DatetimeRangePicker(name="DatetimeRangePicker", **do),
# Debugger(name="Debugger", **o),
DiscretePlayer(name="DiscretePlayer", **o),
DiscreteSlider(name="DiscreteSlider", **oo),
EditableFloatSlider(name="EditableFloatSlider", **o),
EditableIntSlider(name="EditableIntSlider", **o),
EditableRangeSlider(name="EditableRangeSlider", **o),
FileDownload(name="FileDownload", **o),
FileInput(name="FileInput", **o),
FileSelector(name="FileSelector", **o),
FloatInput(name="FloatInput", **o),
FloatSlider(name="FloatSlider", **o),
IntInput(name="IntInput", **o),
IntRangeSlider(name="IntRangeSlider", **o),
IntSlider(name="IntSlider", **o),
JSONEditor(name="JSONEditor", **o),
LiteralInput(name="LiteralInput", **o),
MenuButton(name="MenuButton", **o),
MultiChoice(name="MultiChoice", **o),
MultiSelect(name="MultiSelect", **o),
NumberInput(name="NumberInput", **o),
PasswordInput(name="PasswordInput", **o),
Player(name="Player", **o),
RadioBoxGroup(name="RadioBoxGroup", **oo),
RadioButtonGroup(name="RadioButtonGroup", **oo),
RangeSlider(name="RangeSlider", **o),
Select(name="Select", **o),
Spinner(name="Spinner", **o),
Tabulator(name="Tabulator", **df),
# Terminal(name="Terminal", **o),
TextAreaInput(name="TextAreaInput", **o),
TextEditor(name="TextEditor", **o),
TextInput(name="TextInput", **o),
Toggle(name="Toggle", **o),
ToggleGroup(name="ToggleGroup", **oo),
VideoStream(name="VideoStream", **o),
)
widgets = sorted(widgets, key=lambda x: x.name)
layout = []
for w in widgets:
info = f"<b>{w.name}</b><br>Description: {'description' in w.param}"
l = pn.Row(pn.pane.HTML(info, width=300), w)
layout += [l, pn.layout.Divider()]
pn.Column(*layout)
# Cell 2 - Not included
print(set(wlist) - set(ilist) - set(w.name for w in widgets))
# Cell 3 - Generate table
for w in widgets:
print(f"|{w.name}\t|{':heavy_check_mark:' if 'description' in w.param else ':x:'}|") Not included:
|
A tooltip on the button would make a big difference. Clicking the button often have the biggest impact, so it's nice to know beforehand what it's does. It should probably not have the icon though. |
Is there any hope to make showing the "description" parameter as a Tooltip for DateRangeSlider, FloatSlider, CheckBoxGroup? |
Thanks! However, when I try to show a tooltip for the Button widget it simply does not work. I am using panel version 1.2.3. The problem I initially encountered with putting a TooltipIcon into the same row is that it is not shown after the Widget name, like for other widgets. If I just allow for the space the icon needs, and the widget is in a row inside of a WidgetBox, then by default no tooltip is shown for TooltipIcons which are at the far right of the row, because, the tooltip is always shown to the right of the icon, and not automatically moved to the left in case there is no space to the right. However this can be solved by using a bokeh Tooltip inside of the TooltipIcon and specifying position "left":
|
From time to time I would really like to show a tooltip to the user. It could be on a button, an image or something third.
It's also requested by this post on discourse https://discourse.holoviz.org/t/is-it-possible-to-include-hover-information-over-a-pane/545
The text was updated successfully, but these errors were encountered: