Skip to content

fix(heatmap): correct tooltip display to show axis values instead of indices - #38487

Merged
yousoph merged 1 commit into
apache:masterfrom
aminghadersohi:heatmap-tooltip
Mar 9, 2026
Merged

fix(heatmap): correct tooltip display to show axis values instead of indices#38487
yousoph merged 1 commit into
apache:masterfrom
aminghadersohi:heatmap-tooltip

Conversation

@yousoph

@yousoph yousoph commented Mar 7, 2026

Copy link
Copy Markdown
Member

SUMMARY

Fixes a bug where heatmap tooltips display numeric indices (0, 1, 2...) instead of the actual axis values.

Root cause: PR #36302 changed the heatmap data structure to use axis indices for proper sorting, but the tooltip formatter was not updated to look up the actual values from the sorted arrays.

Changes:

  • Updated tooltip formatter to look up actual x/y axis values from sortedXAxisValues and sortedYAxisValues arrays using the indices
  • Fixed percentage calculation when normalizeAcross is enabled to use actual values instead of indices as lookup keys

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: Tooltip shows 0 (1) or similar numeric indices
image

After: Tooltip shows actual axis labels like Mon (Morning)
image

TESTING INSTRUCTIONS

  1. Create a heatmap chart with text labels on both axes (e.g., days of week vs. time of day)
  2. Hover over cells and verify the tooltip header shows actual axis labels, not indices
  3. Test with different sort options (X Axis Sort / Y Axis Sort):
    • Alphabetical ascending/descending
    • Metric value ascending/descending
  4. Enable "Show percentage" and verify percentages calculate correctly
  5. Test normalization mode (normalizeAcross = 'x', 'y', or 'heatmap') - tooltips should still show correct values
  6. Test with numeric and temporal axes to ensure formatters work correctly

ADDITIONAL INFORMATION

  • Changes UI
  • Has associated issue:
  • Required feature flags:
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

🤖 Generated with Claude Code

…indices

The tooltip was showing numeric indices (0, 1, 2...) instead of the actual
axis values after PR #36302 changed the data structure to use indices.

This fix looks up the actual x/y axis values from the sorted arrays before
formatting them for display in the tooltip. Also fixes percentage calculation
to use actual values instead of indices when normalizeAcross is enabled.

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

bito-code-review Bot commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #95ef6f

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: e508645..e508645
    • superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.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:heatmap Related to the Heatmap chart label Mar 7, 2026

@alexandrusoare alexandrusoare 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.

LGTM - can we also add some tests so that this won't regress in the future?

@kgabryje kgabryje added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Mar 9, 2026
@github-actions github-actions Bot added 🎪 e508645 🚦 building 🎪 ⌛ 48h Environment expires after 48 hours (default) and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Mar 9, 2026
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for e508645

@kgabryje kgabryje left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@yousoph

yousoph commented Mar 9, 2026

Copy link
Copy Markdown
Member Author

LGTM - can we also add some tests so that this won't regress in the future?

Yes, good call out. Will add these in a follow up PR

@yousoph
yousoph merged commit 577654c into apache:master Mar 9, 2026
79 of 85 checks passed
MallikarjunaReddyN pushed a commit to MallikarjunaReddyN/superset that referenced this pull request Mar 18, 2026
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
@mistercrunch mistercrunch removed the 🎪 ⌛ 48h Environment expires after 48 hours (default) label Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugins size/S viz:charts:heatmap Related to the Heatmap chart

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants