Skip to content
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

Tabulator add support for column header tooltip #4138

Closed
RaphaelRosset opened this issue Nov 18, 2022 · 6 comments · Fixed by #7241
Closed

Tabulator add support for column header tooltip #4138

RaphaelRosset opened this issue Nov 18, 2022 · 6 comments · Fixed by #7241
Labels
component: tabulator Related to the Tabulator widget type: enhancement Minor feature or improvement to an existing feature
Milestone

Comments

@RaphaelRosset
Copy link

Tabulator javascript handle column header tooltips: https://tabulator.info/docs/5.4/menu#tooltips

Pass a dictionary {column: tooltip_string} as optional parameter to Tabulator constructor
Update the javascript columns array accordingly.

User case: limited space to display table, so using short acronyms as column headers but would like to exposed full name in tooltips.

@maximlt maximlt added type: enhancement Minor feature or improvement to an existing feature component: tabulator Related to the Tabulator widget labels Dec 19, 2022
@RaphaelRosset
Copy link
Author

RaphaelRosset commented Feb 22, 2023

I just realized that it is in fact already possible to setup a tooltip easily to any text displayed in the tabulator by passing an html string with a tooltip setup:
"header/cell text" => "header/cell text"

@dslemusp
Copy link

Hi @RaphaelRosset, Could you elaborate a bit more on how to do this? (Perhaps with a bit of sample code). I am interested on doing this but cannot understand quite well what you mean.

Thx

@RaphaelRosset
Copy link
Author

RaphaelRosset commented Aug 18, 2023

Hi @dslemusp,
Yes my answer was indeed very unclear, below is an example where second column header is modified through html.
The title keyword allows to pass a tooltip string

df = pd.DataFrame(
          {
              "int": [1, 2, 3],
              "<span style='background-color:beige;' title='Tooltip text'>header</span>": [
                  True,
                  False,
                  True,
              ],
          },
          index=[1, 2, 3],
      )
      tabulator = pn.widgets.Tabulator(df)

@CTPassion
Copy link
Contributor

I second this as a requirement :)

@hmijail
Copy link

hmijail commented Sep 4, 2024

Thirded :)

@ahuang11
Copy link
Contributor

ahuang11 commented Sep 8, 2024

Would anyone be interested in contributing to implement this feature? I can provide guidance if needed.

Something around here:
https://github.com/holoviz/panel/blob/main/panel/models/tabulator.ts#L721

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tabulator Related to the Tabulator widget type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants