fix: metric range voronoi clip#787
Merged
Merged
Conversation
|
madelineluke
approved these changes
May 8, 2026
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.



Description
When a
MetricRangechild hashoverPoint: trueand its metric values fall outside the y-axis domain (e.g. forecast values on a chart wherescaleAxisToFitis false), hovering over the chart caused continuous flickering.Two fixes:
Voronoi y-encoding clamp —
getVoronoiYEncodingnow clamps metric range seed points to[0, height]usingclamp(scale(...), 0, height). An unclamped out-of-domain value (e.g. y = -600) produced a voronoi cell that dominated the entire chart area, causing every mouse movement to trigger a hover → layout recalculation loop.Domain filter on
filteredTableForTooltip—getFilteredTooltipDatanow accepts an optional list of metric range hover metrics and excludes rows where the metric maps outside[0, height]on the y scale. This prevents tooltips and popovers from firing on rows that have no visible representation in the chart.Related Issue
Motivation and Context
When
MetricRangedata is outside of the y domain, andscaleAxisToFit: false(the default), those values are not included in the y scale, and the resulting out-of-domain voronoi seeds caused the chart to flicker continuously on hover.How Has This Been Tested?
WithHoverPointsOutsideDomainunderRSC/MetricRange) with forecast rows whose metric values (5000–9500) far exceed the historical y domain (~200–3738). Manually verified no flickering and no tooltips on the out-of-domain forecast points.WithHoverPointsAtDomainBoundary) where the first forecast metric value sits exactly at the top of the y domain (4000). Manually verified that the hover point renders fully and is not clipped.lineMarkUtils.test.tsto assert the clamped voronoi signal expression.scatterSpecBuilder.test.tsto assert the domain-check filter expression onfilteredTableForTooltip.Screenshots (if appropriate):
Types of changes
Checklist: