h2oai / wave

Realtime Web Apps and Dashboards for Python and R
https://wave.h2o.ai
Apache License 2.0
3.9k stars 323 forks source link

Implemented the tooltip for table column headers #2349

Open nivzx opened 2 weeks ago

nivzx commented 2 weeks ago

The PR fulfills these requirements: (check all the apply)

Closes #1792

Added a optional tooltip parameter to table_column

ui.table(name='table', columns=[
            ui.table_column(name='col1', label='Column 1', tooltip="I am a tooltip"),
            ui.table_column(name='col2', label='Column 2'),
        ]

The column header with tooltip property is displayed with a tooltip icon and the tooltip content is displayed when it's hovered. image

cc @mturoci

nivzx commented 2 weeks ago

Fixed the styling issues. Will update the tests. Meanwhile please let me know your thoughts. cc: @mturoci

[x] The tooltip is too far away from the icon. [x] Hovering over icon shouldn't bring up pointer cursor since clicking the info icon triggers no action. [x] The table column styling should remain intact. [] Please add a unit tests to verify that the info button with tooltip is only rendered when tooltip prop is specified on a col. Columns without the prop should not render the info icon.

image