-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
feat: truncate long values in table viz, a per-column setting #19383
feat: truncate long values in table viz, a per-column setting #19383
Conversation
This PR allows per-column control. I have another branch that is a table-wide setting, and then any column with a min-width setting would get truncated. I think this per-column method is probably better and more clear to the table designer. |
Codecov Report
@@ Coverage Diff @@
## master #19383 +/- ##
==========================================
- Coverage 66.43% 66.42% -0.01%
==========================================
Files 1721 1721
Lines 64571 64589 +18
Branches 6814 6826 +12
==========================================
+ Hits 42895 42901 +6
- Misses 19942 19953 +11
- Partials 1734 1735 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice feature!
.../superset-ui-chart-controls/src/shared-controls/components/ColumnConfigControl/constants.tsx
Outdated
Show resolved
Hide resolved
.../superset-ui-chart-controls/src/shared-controls/components/ColumnConfigControl/constants.tsx
Outdated
Show resolved
Hide resolved
@ktmud I need to look at the conflicts with the current master. Also I think I missed something |
@stevetracvc Great Work! Not a related issue. It looks like the description label here was placed below when hovering the button. |
Thanks! And maybe I can set width on that control... |
…#19383) * feat: truncate long values, a per-column setting * fix: lint * fix: removed width for column control * fix: removed truncate option for time, bool, and numeric columns * prevent extra div if not truncating
Hi, I was just wondering if there's any plans for this to be included in the 2.0.1. release? Thank you very much for any pointers! Martin |
I had a columns that was very wide but has no spaces in it. Like 200 short words with a , in between the words but nowhere a space. The truncate does not work in that case. In excel this does work. It just truncates on some default value when it can't fine any spaces I guess. |
Hmmm... can't see why it doesn't work. If you can make a reproducible test case that we can all try (using example data or a trumped up SQL query) then you can file that on a new issue and hopefully someone can take a look. We're also open to PRs to dial things in, if you already see a root cause. |
SUMMARY
Sometimes, the values in a table cell can be really long. This PR shortens long cells with an ellipsis, and then expands the full content when hovering over the cell. This setting uses the "min width" for a column as the max width, so it really just fully fixes the column width to this value.
BEFORE/AFTER
SCREENSHOTS OR ANIMATED GIF
ADDITIONAL INFORMATION