-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Columns not auto sizing correctly (#2359)
- 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
- Loading branch information
Showing
246 changed files
with
444 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.