Skip to content

feat(explore): enable heat map tooltips on click#115413

Merged
nikkikapadia merged 4 commits into
masterfrom
nikki/feat/heat-map-click-tooltip
May 14, 2026
Merged

feat(explore): enable heat map tooltips on click#115413
nikkikapadia merged 4 commits into
masterfrom
nikki/feat/heat-map-click-tooltip

Conversation

@nikkikapadia
Copy link
Copy Markdown
Member

this just enables the tooltip on heat map charts and shows the tooltip on click instead of on hover. I have to make the formatter for the tooltip so it's showing the default for now. Here's a demo of it working:

Screen.Recording.2026-05-12.at.3.55.21.PM.mov

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.52%

@nikkikapadia nikkikapadia marked this pull request as ready for review May 12, 2026 20:29
@nikkikapadia nikkikapadia requested a review from a team as a code owner May 12, 2026 20:29
@nikkikapadia nikkikapadia requested a review from gggritso May 12, 2026 20:29
Comment on lines 68 to +73
tooltip={{
show: false,
show: true,
axisPointer: {
show: false,
},
triggerOn: 'click',
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.

Bug: The heatmap tooltip formatter is not customized for 3D data, causing it to display the Y-axis label instead of the Z-axis count as the series value.
Severity: MEDIUM

Suggested Fix

Provide a custom formatter function in the tooltip configuration for the heatmap chart. This formatter should correctly access the Z-axis value from the 3D series data at index 2 (e.g., params.value[2]) to display the correct count in the tooltip.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location:
static/app/views/dashboards/widgets/heatMapWidget/heatMapWidgetVisualization.tsx#L68-L73

Potential issue: The `tooltip` configuration for the heatmap chart in
`heatMapWidgetVisualization.tsx` lacks a custom `formatter`. Consequently, the default
formatter from `tooltip.tsx` is used, which is designed for 2D data and extracts the
value from index 1 of the series data (`getSeriesValue(serie, 1)`). For heatmap series,
which are 3D (`[xAxis, yAxis, zAxis]`), index 1 holds the Y-axis bucket label (e.g.,
'p95'), while the actual count is at index 2. This results in the tooltip incorrectly
displaying the Y-axis label as the metric value, misleading users about the data.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ya ya later problem

Comment on lines 68 to +73
tooltip={{
show: false,
show: true,
axisPointer: {
show: false,
},
triggerOn: 'click',
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.

Bug: The heatmap tooltip incorrectly displays a single timestamp instead of a time range because bucketSize is calculated as 0 due to the data structure.
Severity: LOW

Suggested Fix

Adjust the bucketSize calculation in BaseChart to handle heatmap data structures correctly. This could involve finding the first two data points with distinct x-axis values to compute the interval, rather than assuming the first two points in the series are sufficient.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location:
static/app/views/dashboards/widgets/heatMapWidget/heatMapWidgetVisualization.tsx#L68-L73

Potential issue: In `BaseChart`, the `bucketSize` for time-series charts is calculated
by subtracting the x-axis values of the first two data points. For heatmaps, the data is
structured such that multiple points share the same x-axis timestamp, leading to a
`bucketSize` of `0`. When this `bucketSize` is passed to the tooltip formatter, the
condition `!bucketSize` evaluates to true. This causes the tooltip to render a single,
uninformative timestamp instead of the correct time range for the data bucket, failing
to accurately represent the aggregated data in the heatmap.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

doing this in a different pr

<BaseChart
autoHeightResize
// will be grouped by date as we only support time as the x-axis right now.
// this will change later and we'll pass in what kind of x-axis we have
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.

Nit: leave a TODO w/ author name for the comments to follow this pattern

@nikkikapadia nikkikapadia merged commit 1da1ec8 into master May 14, 2026
74 checks passed
@nikkikapadia nikkikapadia deleted the nikki/feat/heat-map-click-tooltip branch May 14, 2026 19:42
nikkikapadia added a commit that referenced this pull request May 14, 2026
…s bucket (#115560)

I've changed the tooltip for heat maps to use the y-axis time bucket and
the z-axis value side by side. I've also gotten rid of the marker and
series name on the tooltip because they're not needed for heat maps.
Here's what it looks like:

| Before (using y-axis value without units) | After (using y-axis bucket
and z-axis value) |
|--------|--------|
| <img width="870" height="401" alt="image"
src="https://github.com/user-attachments/assets/64606c37-7972-45f0-b2b1-55a00e66e434"
/> | <img width="853" height="463" alt="image"
src="https://github.com/user-attachments/assets/e5db0bdf-5cb7-426c-b97d-8503a007b8f4"
/> |

must be merged after #115413
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants