You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Column header names are truncated based on an estimated width in GridRenderer.drawColumnHeader. This is problematic since column headers do not use a monospaced font. If there are many wide characters in a name, it can overflow the bounds instead of truncating.
mattrunyon
changed the title
Column header names do not truncate based on text measurement
Column header names do not truncate properly with wide characters
Nov 11, 2024
- Improved logic for calculating the range to truncate a string, based
on the width of the assumed largest character and smallest character for
a given font. This fixes the observed issue of wide strings not being
truncated.
- Changed column width calculation to calculate text width by iterating
through the text and adding up individual character widths which are
cached. This approach size columns more precisely than estimating based
on a single character's width and the length of the string, and does not
appear to have a significant performance impact.
Test snippet used to see if column width calculation works as expected;
resize columns to observe truncation behaviour
```
from deephaven import new_table
from deephaven.column import string_col
a = new_table([string_col("allllllllllllllllllllllllllllllllllllllllllllllll", ["a"])])
b = new_table([string_col("ammmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", ["b"])])
c = new_table([string_col("c", ["allllllllllllllllllllllllllllllllllllllllllllllll"])])
d = new_table([string_col("d", ["ammmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm"])])
```
Closes#2288
Description
Column header names are truncated based on an estimated width in
GridRenderer.drawColumnHeader
. This is problematic since column headers do not use a monospaced font. If there are many wide characters in a name, it can overflow the bounds instead of truncating.Steps to reproduce
Expected results
The long column name with "M" (wide character) is truncated
Actual results
Versions
Engine Version: 0.37.0-SNAPSHOT
Web UI Version: 0.97.0
Java Version: 17.0.12
Barrage Version: 0.6.0
Browser Name: Chrome 130
OS Name: Linux
@deephaven/js-plugin-ui: 0.22.0
@deephaven/js-plugin-plotly-express: 0.11.2
@deephaven/js-plugin-matplotlib: 0.5.0
The text was updated successfully, but these errors were encountered: