Skip to content

Conversation

sadpandajoe
Copy link
Member

@sadpandajoe sadpandajoe commented Sep 15, 2025

SUMMARY

  • Fixed critical regression where legends disappeared in deck.gl Polygon charts between Superset 5.0 and 6.0
  • Affected charts using linear_palette (default) and fixed_color schemes when displaying metrics
  • Single-line conditional logic fix with comprehensive test coverage

Root Cause

The bucket generation logic incorrectly treated any truthy colorSchemeType as requiring color breakpoints:

before:

const buckets = colorSchemeType
? getColorBreakpointsBuckets(formData.color_breakpoints)
: getBuckets(formData, payload.data.features, accessor);

after:

const buckets = colorSchemeType === COLOR_SCHEME_TYPES.color_breakpoints
? getColorBreakpointsBuckets(formData.color_breakpoints)
: getBuckets(formData, payload.data.features, accessor);

When colorSchemeType was "linear_palette" or "fixed_color", it incorrectly called getColorBreakpointsBuckets() with undefined color_breakpoints, returning empty buckets and causing legends to disappear.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

11 comprehensive tests covering all scenarios:

  • Bucket generation logic for all color scheme types
  • Error handling and edge cases
  • Legend integration testing
  • Utility function validation

Manual test:

  1. open up a workspace
  2. go to the polygon chart
  3. verify legend shows up

ADDITIONAL INFORMATION

…alette and fixed color schemes

Fixes a regression in version 6.0 where legends were not displayed for deck.gl Polygon charts
when using linear_palette or fixed_color color schemes. The issue was caused by incorrect
conditional logic that treated any truthy colorSchemeType as requiring color breakpoints.

Changes:
- Fix bucket generation logic in Polygon.tsx to specifically check for color_breakpoints scheme
- Add comprehensive test suite covering all color scheme types and edge cases
- Ensure backward compatibility and preserve existing functionality

Fixes: #34822

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@sadpandajoe sadpandajoe added the AI 🤖 generated by AI label Sep 15, 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/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.tsx

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

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@dosubot dosubot bot added the viz:charts:deck.gl Related to deck.gl charts label Sep 15, 2025
@msyavuz msyavuz added the review:checkpoint Last PR reviewed during the daily review standup label Sep 15, 2025
….0 compatibility

Expands test suite from 7 to 11 tests with comprehensive coverage of all color scheme
scenarios and edge cases to ensure complete 5.0→6.0 functionality compatibility.

Changes:
- Fix failing legend test by removing redundant assertion in bucket generation logic test
- Add categorical_palette color scheme test (unsupported scheme fallback)
- Add error handling tests for empty data, missing breakpoints, and null positions
- Improve test organization with dedicated error handling test suite
- Minor code formatting improvements from linter

Test Results: All 11 tests passing, 45 total deck.gl tests passing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@sadpandajoe sadpandajoe force-pushed the fix/deck.gl-missing-legend branch from 1701be8 to 254da16 Compare September 15, 2025 17:50
@msyavuz msyavuz self-requested a review September 16, 2025 17:18
@msyavuz msyavuz merged commit fb840b8 into master Sep 16, 2025
81 of 83 checks passed
@msyavuz msyavuz deleted the fix/deck.gl-missing-legend branch September 16, 2025 17:20
@msyavuz msyavuz removed the review:checkpoint Last PR reviewed during the daily review standup label Sep 16, 2025
@sadpandajoe sadpandajoe added the v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch label Sep 16, 2025
sadpandajoe added a commit that referenced this pull request Sep 16, 2025
…alette and fixed color schemes (#35142)

Co-authored-by: Claude <[email protected]>
(cherry picked from commit fb840b8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI 🤖 generated by AI plugins size/L v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch viz:charts:deck.gl Related to deck.gl charts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disappeared features in the representations of deck.gl in the version of Superset 6.0.0
2 participants