Open MarcSkovMadsen opened 4 years ago
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.
Type | Support description |
---|---|
ArrayInput | :heavy_check_mark: |
AutocompleteInput | :heavy_check_mark: |
Button | :heavy_check_mark: |
CheckBoxGroup | :x: |
CheckButtonGroup | :x: |
Checkbox | :x: |
CodeEditor | :x: |
ColorPicker | :heavy_check_mark: |
CrossSelector | :heavy_check_mark: |
DataFrame | :x: |
DatePicker | :heavy_check_mark: |
DateRangeSlider | :x: |
DateSlider | :x: |
DatetimeInput | :heavy_check_mark: |
DatetimePicker | :heavy_check_mark: |
DatetimeRangeInput | :x: |
DatetimeRangePicker | :heavy_check_mark: |
DatetimeRangeSlider | :x: |
DiscretePlayer | :x: |
DiscreteSlider | :x: |
EditableFloatSlider | :x: |
EditableIntSlider | :x: |
EditableRangeSlider | :x: |
FileDownload | :heavy_check_mark: |
FileInput | :heavy_check_mark: |
FileSelector | :x: |
FloatInput | :heavy_check_mark: |
FloatSlider | :x: |
IntInput | :heavy_check_mark: |
IntRangeSlider | :x: |
IntSlider | :x: |
JSONEditor | :x: |
LiteralInput | :heavy_check_mark: |
MenuButton | :x: |
MultiChoice | :heavy_check_mark: |
MultiSelect | :heavy_check_mark: |
NumberInput | :heavy_check_mark: |
PasswordInput | :heavy_check_mark: |
Player | :x: |
RadioBoxGroup | :x: |
RadioButtonGroup | :x: |
RangeSlider | :x: |
Select | :heavy_check_mark: |
Spinner | :heavy_check_mark: |
StaticText | :x: |
Tabulator | :x: |
TextAreaInput | :heavy_check_mark: |
TextEditor | :x: |
TextInput | :heavy_check_mark: |
Toggle | :x: |
ToggleGroup | :x: |
VideoStream | :x: |
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? Is there a workaround for how to do it myself until then?
I have run my code again, and Button now has a description on hover pn.widgets.Button(name='Test', description='Text')
A way to add tooltips to widgets that do not have description
is to use pn.widgets.TooltipIcon
and play a bit around with margins.
pn.Row(
pn.widgets.DatetimeRangeSlider(name="DatetimeRangeSlider", **do),
pn.widgets.TooltipIcon(value="Test", styles={"margin-top": "20px"}),
)
Type | Support description |
---|---|
ArrayInput | :heavy_check_mark: |
AutocompleteInput | :heavy_check_mark: |
Button | :heavy_check_mark: |
CheckBoxGroup | :x: |
CheckButtonGroup | :heavy_check_mark: |
Checkbox | :x: |
CodeEditor | :x: |
ColorPicker | :heavy_check_mark: |
CrossSelector | :heavy_check_mark: |
DataFrame | :x: |
DatePicker | :heavy_check_mark: |
DateRangeSlider | :x: |
DateSlider | :x: |
DatetimeInput | :heavy_check_mark: |
DatetimePicker | :heavy_check_mark: |
DatetimeRangeInput | :x: |
DatetimeRangePicker | :heavy_check_mark: |
DatetimeRangeSlider | :x: |
DiscretePlayer | :x: |
DiscreteSlider | :x: |
EditableFloatSlider | :x: |
EditableIntSlider | :x: |
EditableRangeSlider | :x: |
FileDownload | :heavy_check_mark: |
FileInput | :heavy_check_mark: |
FileSelector | :x: |
FloatInput | :heavy_check_mark: |
FloatSlider | :x: |
IntInput | :heavy_check_mark: |
IntRangeSlider | :x: |
IntSlider | :x: |
JSONEditor | :x: |
LiteralInput | :heavy_check_mark: |
MenuButton | :x: |
MultiChoice | :heavy_check_mark: |
MultiSelect | :heavy_check_mark: |
NumberInput | :heavy_check_mark: |
PasswordInput | :heavy_check_mark: |
Player | :x: |
RadioBoxGroup | :x: |
RadioButtonGroup | :heavy_check_mark: |
RangeSlider | :x: |
Select | :heavy_check_mark: |
Spinner | :heavy_check_mark: |
StaticText | :x: |
Tabulator | :x: |
TextAreaInput | :heavy_check_mark: |
TextEditor | :x: |
TextInput | :heavy_check_mark: |
Toggle | :x: |
ToggleGroup | :heavy_check_mark: |
VideoStream | :x: |
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":
date_range_tt = pn.widgets.TooltipIcon(
value=Tooltip(
content="the content .... ",
position="left",),
styles={"margin-top": "20px"},
width=10,
)
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