Skip to content

fix(plugin-chart-echarts): preserve null radar metric values as gaps (#30270)#41962

Open
rusackas wants to merge 7 commits into
masterfrom
tdd/issue-30270-radar-missing-values
Open

fix(plugin-chart-echarts): preserve null radar metric values as gaps (#30270)#41962
rusackas wants to merge 7 commits into
masterfrom
tdd/issue-30270-radar-missing-values

Conversation

@rusackas

@rusackas rusackas commented Jul 11, 2026

Copy link
Copy Markdown
Member

SUMMARY

Fixes #30270 — "Wrong visualization of missing values in radar charts".

A missing (null) metric value was rendered as a real 0 pinned to the center of the radar instead of being left out as a gap. The root cause is in the Radar transformProps normalization: normalizeArray divides each value by the per-series max, and null / max coerces the null to 0, so a gap silently became a genuine zero.

The fix preserves null/non-finite values through normalization (returning null so ECharts renders a gap) instead of dividing them, and excludes nulls when computing the per-series max. Valid numeric values are untouched.

This ships with the regression test that reproduces the bug — red on master, green with the fix.

BEFORE/AFTER

  • Before: a null metric normalized to 0 and drew a point at the center of the radar as if it were a real zero.
  • After: a null metric stays null through normalization and renders as a gap; real zeros still render at the center as before.

TESTING INSTRUCTIONS

cd superset-frontend
npx jest plugins/plugin-chart-echarts/test/Radar/transformProps.test.ts

The missing (null) values › preserves a null metric instead of plotting it as 0 case passes, along with all pre-existing Radar transformProps tests (10 total).

ADDITIONAL INFORMATION

🤖 Generated with Claude Code

…30270)

Radar transformProps normalizes each value with null / max, coercing a
missing (null) metric into 0 so it is plotted at the center instead of
left as a gap. Adds a regression test asserting nulls are preserved.

Closes #30270

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dosubot dosubot Bot added the viz:charts:radar Related to the Radar chart label Jul 11, 2026
@bito-code-review

bito-code-review Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #b076f3

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: b94aa33..b94aa33
    • superset-frontend/plugins/plugin-chart-echarts/test/Radar/transformProps.test.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ 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

Radar transformProps normalized each series value with value / max in
normalizeArray. A null (missing) metric coerced to 0 in that division, so
a missing data point was plotted at the center of the radar as a real
zero instead of being left out as a gap (#30270).

Preserve null/non-finite values through normalization so ECharts renders
them as gaps, and exclude nulls when computing the per-series max.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rusackas rusackas changed the title test(plugin-chart-echarts): reproduce radar null values plotted as 0 (#30270) fix(plugin-chart-echarts): preserve null metrics in radar normalization (#30270) Jul 12, 2026
@bito-code-review

Copy link
Copy Markdown
Contributor

The suggestion to replace the single-case describe() block with a standalone test() is correct and aligns with standard testing best practices to avoid unnecessary nesting. You can resolve this by removing the describe('missing (null) values', () => { ... }) wrapper and renaming the inner test to describe the scenario more comprehensively, such as test('Radar chart preserves null metric values instead of plotting them as 0', () => { ... }).

Would you like me to implement this change for you? I can also check the rest of the PR for similar instances if you would like me to proceed with a broader cleanup.

superset-frontend/plugins/plugin-chart-echarts/test/Radar/transformProps.test.ts

test('Radar chart preserves null metric values instead of plotting them as 0', () => {
  // ... setup code ...
  const result = transformProps(missingValueProps as EchartsRadarChartProps);
  // ... assertions ...
});

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.60870% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.78%. Comparing base (df209ce) to head (9826ce9).
⚠️ Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
...s/plugin-chart-echarts/src/Radar/transformProps.ts 78.94% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #41962   +/-   ##
=======================================
  Coverage   64.78%   64.78%           
=======================================
  Files        2742     2742           
  Lines      153316   153330   +14     
  Branches    35143    35151    +8     
=======================================
+ Hits        99323    99339   +16     
+ Misses      52095    52093    -2     
  Partials     1898     1898           
Flag Coverage Δ
javascript 69.81% <82.60%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@rusackas rusackas changed the title fix(plugin-chart-echarts): preserve null metrics in radar normalization (#30270) fix(plugin-chart-echarts): preserve null radar metric values as gaps (#30270) Jul 12, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bito-code-review

bito-code-review Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #b01528

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: b94aa33..8c959a3
    • superset-frontend/plugins/plugin-chart-echarts/src/Radar/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/test/Radar/transformProps.test.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

… not NaN

The null-preservation fix for #30270 kept a missing metric out of the
denormalization map, so label/tooltip lookups fell through to
Number("null") and rendered "NaN" instead of a gap. Record an explicit
null entry and skip formatting it in the label and tooltip renderers.
Also convert the single-case describe() block to standalone tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pull-request-size pull-request-size Bot added size/L and removed size/M labels Jul 12, 2026

@bito-code-review bito-code-review Bot left a comment

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.

Code Review Agent Run #9ecb3f

Actionable Suggestions - 1
  • superset-frontend/plugins/plugin-chart-echarts/src/Radar/utils.ts - 1
Review Details
  • Files reviewed - 5 · Commit Range: 8c959a3..53076ec
    • superset-frontend/plugins/plugin-chart-echarts/src/Radar/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/src/Radar/types.ts
    • superset-frontend/plugins/plugin-chart-echarts/src/Radar/utils.ts
    • superset-frontend/plugins/plugin-chart-echarts/test/Radar/transformProps.test.ts
    • superset-frontend/plugins/plugin-chart-echarts/test/Radar/utils.test.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

Comment thread superset-frontend/plugins/plugin-chart-echarts/src/Radar/utils.ts Outdated
rusackas and others added 2 commits July 12, 2026 04:12
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bito-code-review

bito-code-review Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #94af26

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 53076ec..c346fba
    • superset-frontend/plugins/plugin-chart-echarts/src/Radar/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

…ation

@superset-ui/core no longer exports t, so Radar/utils.ts failed to
type-check and its test threw "t is not a function". Import t the
same way the sibling Radar files (index.ts, controlPanel.tsx) already
do.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bito-code-review

bito-code-review Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #f943de

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: c346fba..9826ce9
    • superset-frontend/plugins/plugin-chart-echarts/src/Radar/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

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.

Wrong visualization of missing values in radar charts

2 participants