-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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: Making bar graphs in Table viz from fixed-size divs instead of calculated gradients #21482
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21482 +/- ##
==========================================
+ Coverage 66.66% 66.74% +0.07%
==========================================
Files 1791 1801 +10
Lines 68498 69252 +754
Branches 7286 7554 +268
==========================================
+ Hits 45666 46221 +555
- Misses 20962 21121 +159
- Partials 1870 1910 +40
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
/testenv up |
@geido Ephemeral environment spinning up at http://54.203.213.47:8080. Credentials are |
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.
LGTM. Left some non-blocking suggestions.
superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
Outdated
Show resolved
Hide resolved
Ephemeral environment shutdown and build artifacts deleted. |
…tead of calculated gradients (apache#21482)" This reverts commit 135909f.
SUMMARY
The Table viz allows users to have little histogram/bar chart cells which can be gray, red when negative, or colorized via conditional formatting. Previously, these were implemented as the CSS background of the table cells, and a gradient was used to draw the bars, with gradient stops to set bar widths. This was problematic as people could not customized these with CSS, and it was also a potentially difficult to understand implementation from a maintenance standpoint.
In this revised approach, divs are conditionally added to table cells to act as these bars, and they're positioned behind the text content. They use a few small functions to calculate width, offset, and color for their display. They're also rendered with a
cell-bar
class and (when applicable) anegative
orpositive
class to indicate if they're positive or negative, for further customization options.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
No visual changes here - just representing what was changed. But, this is the "after" FWIW.
TESTING INSTRUCTIONS
Test example tables, and throw different formatting options at the table. I think this covers all the use cases, but there's always a chance I missed something!
ADDITIONAL INFORMATION