ref(explore): Extract heat map bucket-sizing helpers to a shared util#117576
Closed
gggritso wants to merge 4 commits into
Closed
ref(explore): Extract heat map bucket-sizing helpers to a shared util#117576gggritso wants to merge 4 commits into
gggritso wants to merge 4 commits into
Conversation
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: extracts the two pure bucket-sizing helpers (
getHeatmapYBucketsandgetHeatmapXBucketInterval) out of the Explore metricsMetricPanelinto a shared util underdashboards/widgets/heatMapWidget/utils.MetricPanelnow 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