holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.8k stars 519 forks source link

Show help tooltip on sliders #7499

Open Davide-sd opened 5 days ago

Davide-sd commented 5 days ago

I'm using parameterized classes and Panel to create an interactive application. I noticed that input widgets shows both a label and a useful tooltip, which display the content of the keyword argument doc of a particular parameter. However, sliders don't show this tooltip. Would it be possible to include this tooltip on sliders as well?

Here are a couple of screenshots from my application. The first one is good because if a user don't remember what a parameter does, it just hover the tooltip:

Image

The second screenshot highlights why this feature would be useful. Sometime many sliders have similar labels: a tooltip displaying further information would be very helpful.

Image

This is a minimum reproducible code:

import param
import panel as pn

class A(param.Parameterized):
    a = param.Number(1.2, bounds=(0, 2), label="a", doc="Help for a.")
    b = param.Number(1.2, label="b", doc="Help for b.")
    c = param.String("test", label="c", doc="Help for c.")

class B(A, pn.viewable.Viewer):
    def __panel__(self):
        return pn.Column(self.param.a, self.param.b, self.param.c)

B()