Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(Chart): Add Column-Based Coloring Feature with Optional Header & Total Row #32425

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ERGO1995
Copy link

SUMMARY

Implemented a new Column Coloring feature that allows users to apply fixed background colors to selected metric columns in the Pivot Table.
Integrated a color picker for enhanced usability.
Added an optional "Apply color to headers & total rows" checkbox to extend the column coloring to headers and total cells.
Ensured seamless integration with existing Conditional Formatting, preserving its functionality.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Capture d’écran 2025-02-28 à 15 21 42

Capture d’écran 2025-02-28 à 15 21 54

Capture d’écran 2025-02-28 à 15 22 14

Capture d’écran 2025-02-28 à 15 22 23

TESTING INSTRUCTIONS

In the Customization tab, locate the Column Coloring section.
Click "Add new color formatter".
Select a Metric column from the dropdown.
Pick a color using the color picker or manually enter a HEX color code.
Click Apply.
Expected Result: The selected metric column should be highlighted with the chosen background color.

Enable the "Apply color to headers & total rows" checkbox.
Expected Result: The column headers and total row for the selected metric should match the column’s background color.
Disable the checkbox.
Expected Result: The header and total row should return to the default styling.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added the viz:charts:pivot Related to the Pivot Table charts label Feb 28, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've completed my review and didn't find any issues.

Files scanned
File Path Reviewed
superset-frontend/src/explore/components/controls/ColumnColoringControl/index.ts
superset-frontend/src/explore/components/controls/ColumnColoringControl/types.ts
superset-frontend/plugins/plugin-chart-pivot-table/src/types.ts
superset-frontend/src/explore/components/controls/ColumnColoringControl/ColoringPopover.tsx
superset-frontend/src/explore/components/controls/index.js
superset-frontend/src/explore/components/controls/ColumnColoringControl/ColoringPopoverContent.tsx
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts
superset-frontend/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts
superset-frontend/src/explore/components/controls/ColumnColoringControl/ColumnColoringControl.tsx
superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx
superset-frontend/packages/superset-ui-chart-controls/src/types.ts
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx
superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Current Korbit Configuration

General Settings
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions
Issue Categories
Category Enabled
Documentation
Logging
Error Handling
Readability
Design
Performance
Security
Functionality

Feedback and Support

Note

Korbit Pro is free for open source projects 🎉

Looking to add Korbit to your team? Get started with a free 2 week trial here

@sadpandajoe sadpandajoe added the review:checkpoint Last PR reviewed during the daily review standup label Feb 28, 2025
@@ -176,6 +176,7 @@
"react-ace": "^10.1.0",
"react-checkbox-tree": "^1.8.0",
"react-color": "^2.13.8",
"react-colorful": "^5.6.1",
Copy link
Member

@kgabryje kgabryje Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the antd color picker instead?

Copy link

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.45%. Comparing base (76d897e) to head (6704af6).
Report is 1506 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #32425       +/-   ##
===========================================
+ Coverage   60.48%   83.45%   +22.97%     
===========================================
  Files        1931      546     -1385     
  Lines       76236    39102    -37134     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    32634    -13480     
+ Misses      28017     6468    -21549     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.52% <ø> (-0.65%) ⬇️
javascript ?
mysql 75.87% <ø> (?)
postgres 75.93% <ø> (?)
presto 53.05% <ø> (-0.76%) ⬇️
python 83.45% <ø> (+19.97%) ⬆️
sqlite 75.43% <ø> (?)
unit 61.12% <ø> (+3.49%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rusackas rusackas removed the review:checkpoint Last PR reviewed during the daily review standup label Mar 3, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants