Skip to content

ref(explore): Extract heat map bucket-sizing helpers to a shared util#117576

Closed
gggritso wants to merge 4 commits into
masterfrom
georgegritsouk/extract-heatmap-bucket-helpers
Closed

ref(explore): Extract heat map bucket-sizing helpers to a shared util#117576
gggritso wants to merge 4 commits into
masterfrom
georgegritsouk/extract-heatmap-bucket-helpers

Conversation

@gggritso

Copy link
Copy Markdown
Member

What: extracts the two pure bucket-sizing helpers (getHeatmapYBuckets and getHeatmapXBucketInterval) out of the Explore metrics MetricPanel into a shared util under dashboards/widgets/heatMapWidget/utils. MetricPanel now imports them and passes the container height (STACKED_GRAPH_HEIGHT) in as a parameter instead of having it hardcoded inside the helper.

Why: enables reuse by the upcoming dashboards heat map widget. This is a behavior-preserving refactor split out from the larger Heat Map work.

Refs DAIN-1654

Move getHeatmapYBuckets and getHeatmapXBucketInterval out of the Explore
metrics MetricPanel into a shared module under
dashboards/widgets/heatMapWidget/utils so they can be reused by the
upcoming dashboards heat map widget. The container height is now a
parameter (MetricPanel passes STACKED_GRAPH_HEIGHT) instead of being
hardcoded. No behavior change.

Refs DAIN-1654
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gggritso gggritso requested review from a team as code owners June 12, 2026 21:26
@linear-code

linear-code Bot commented Jun 12, 2026

Copy link
Copy Markdown

DAIN-1654

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 12, 2026
@gggritso gggritso marked this pull request as draft June 12, 2026 23:52
The constant is only used internally by getHeatmapXBucketInterval, so
exporting it tripped knip's unused-export check. Make it module-private.

Refs DAIN-1654
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Put getHeatmapYBuckets and getHeatmapXBucketInterval in their own modules
(each with its own spec) instead of a single getHeatmapBuckets file.

Refs DAIN-1654
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rename getHeatmapXBucketInterval -> getHeatmapXAxisBucketInterval and
getHeatmapYBuckets -> getHeatmapYAxisBucketCount (with matching files and
specs) to make the time-interval vs value-count distinction clearer.

Refs DAIN-1654
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gggritso gggritso closed this Jun 15, 2026
@gggritso gggritso deleted the georgegritsouk/extract-heatmap-bucket-helpers branch June 15, 2026 20:34
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.

1 participant