Skip to content

fix(deck.gl): scatterplot stops rendering points with empty value of categorical color#39430

Open
DamianPendrak wants to merge 3 commits intoapache:masterfrom
DamianPendrak:damianpendrak4778/sc-99443/deck-gl-scatterplot-stops-rendering-points
Open

fix(deck.gl): scatterplot stops rendering points with empty value of categorical color#39430
DamianPendrak wants to merge 3 commits intoapache:masterfrom
DamianPendrak:damianpendrak4778/sc-99443/deck-gl-scatterplot-stops-rendering-points

Conversation

@DamianPendrak
Copy link
Copy Markdown
Member

SUMMARY

Include empty results for categorical color column in Scatterplot and Arc charts.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before
image

After
Screenshot 2026-04-17 at 09 14 00

TESTING INSTRUCTIONS

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

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 17, 2026

Code Review Agent Run #b1d836

Actionable Suggestions - 0
Review Details
  • Files reviewed - 7 · Commit Range: b2db09a..4098659
    • superset-frontend/plugins/preset-chart-deckgl/src/components/Legend.test.tsx
    • superset-frontend/plugins/preset-chart-deckgl/src/components/Legend.tsx
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Arc/transformProps.test.ts
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Arc/transformProps.ts
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.test.ts
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.ts
    • superset-frontend/plugins/preset-chart-deckgl/src/utils.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot bot added the viz:charts:deck.gl Related to deck.gl charts label Apr 17, 2026
Comment on lines 91 to +94
const formatCategoryLabel = (k: string) => {
if (k === NULL_CATEGORY_KEY) {
return t('N/A');
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟠 Architect Review — HIGH

NULL_CATEGORY_KEY is mapped to the user-facing label "N/A" only when rendering the legend, while Scatter and Arc tooltips still display the raw cat_color value; for points with null/undefined category this results in "NULL" being shown on hover instead of "N/A", creating an inconsistent and implementation-leaking user experience.

Suggestion: Centralize category label formatting (including NULL_CATEGORY_KEY → "N/A") and reuse it in the Scatter and Arc tooltip renderers (e.g., via tooltipUtils.CommonTooltipRows.category) so all user-facing category displays are consistent.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/plugins/preset-chart-deckgl/src/components/Legend.tsx
**Line:** 91:94
**Comment:**
	*HIGH: NULL_CATEGORY_KEY is mapped to the user-facing label "N/A" only when rendering the legend, while Scatter and Arc tooltips still display the raw cat_color value; for points with null/undefined category this results in "__NULL__" being shown on hover instead of "N/A", creating an inconsistent and implementation-leaking user experience.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

@bito-code-review
Copy link
Copy Markdown
Contributor

The flagged issue is correct. NULL_CATEGORY_KEY ('NULL') is mapped to 'N/A' only in the Legend component's formatCategoryLabel function, but Scatter and Arc tooltips display the raw cat_color value, showing 'NULL' for null/undefined categories. This creates inconsistency.

superset-frontend/plugins/preset-chart-deckgl/src/utils.ts

export const NULL_CATEGORY_KEY = '__NULL__';

export const formatCategoryLabel = (k: string) => {
  if (k === NULL_CATEGORY_KEY) {
    return t('N/A');
  }
  return k;
};

superset-frontend/plugins/preset-chart-deckgl/src/components/Legend.tsx

import { NULL_CATEGORY_KEY, formatCategoryLabel } from '../utils';

// Remove local formatCategoryLabel and use the imported one

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.53%. Comparing base (db7a2bd) to head (4098659).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #39430      +/-   ##
==========================================
+ Coverage   64.49%   64.53%   +0.03%     
==========================================
  Files        2557     2557              
  Lines      133097   133104       +7     
  Branches    30910    30915       +5     
==========================================
+ Hits        85846    85903      +57     
+ Misses      45761    45711      -50     
  Partials     1490     1490              
Flag Coverage Δ
javascript 66.41% <100.00%> (+0.07%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant