deephaven / deephaven-plugins

Deephaven Plugins
11 stars 15 forks source link

Support display names for columns #105

Open rbasralian opened 12 months ago

rbasralian commented 12 months ago

It would be helpful to allow display names for columns in the UI that are different from the actual column names, such as displaying a ChangePct column as Chg% in the UI. We should support names that are not valid Java identifiers too (such as names including spaces or symbols like %/&/etc.)

If you hover over the column headers, you should be able to see the underlying real column name.

Even better would be if multiple column names could be specified, with the UI using the longest name that fits the column's current width in the UI. So as you make a column narrower, its name would update to use a shorter name that fits (so we can avoid truncating and adding ...):

Example of what happens now: image

This would be helpful because longer and more descriptive column names are really helpful when familiarizing yourself with a table and figuring out what you want in a dashboard, but once you generally know what's in a table, you want to make the columns as narrow as possible so that you can fit the most data possible on the screen. (Somewhat related to https://github.com/deephaven/web-client-ui/issues/1486.)

vbabich commented 12 months ago

This is something we can add to the ui.table.

t = ui.table(
    my_table,
    column_display_names={colA: ['My Long Name', 'Shorter Name', 'Shrt'], colB: 'Short Name'}
)