Skip to content

fix(s2-line): prevent fixed metric axis hover collapse - #1014

Draft
madelineluke wants to merge 4 commits into
mainfrom
fix/sparse-fixed-metric-axis-hover
Draft

madelineluke wants to merge 4 commits into
mainfrom
fix/sparse-fixed-metric-axis-hover

Conversation

@madelineluke

@madelineluke madelineluke commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

When an Axis range  puts line data mostly outside the plot (for example sparse data below the range), off-plot geometry changed the chart's measured size. The plot then flickered and collapsed to zero height on hover. Hover could also show crosshairs for points you can't see.

Changes (S2 only, and only when a metric axis range is fixed):

• Line paths and their hover-overlay copies are clipped to the plot. Points and labels are not clipped.
• Off-plot static points, point annotations and direct labels are hidden.
• Off-plot points can't be hovered, so no crosshairs appear for invisible data.
• The axis baseline is clipped only when its value is outside the axis domain, for example a 0 baseline with a range of [400k, 550k].

Charts without a fixed metric axis range are unchanged.

Testing: runtime Vega tests check that the plot size stays stable through hover across these cases: data above or below the range, lines crossing it, points on the range edges, a range crossing zero, ranges excluding zero, static points and labels, and Combo. There are also unit tests for the clip and filter logic. Regression stories are under Line → Regressions → Fixed Metric Axis, and the dashboard has a variation for it.

Description

Related Issue

Motivation and Context

Fixes collapsing Line chart when the metric axis is fixed and the data is outside of that.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

madelineluke and others added 2 commits October 14, 2026 16:29
Contain out-of-range line marks, exclude invisible hover candidates, and keep axis baselines within the plot. Add runtime regressions and sparse-data Storybook coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace baseline clamping with clipping and cover preserved scale positions, plot bounds, and negative fixed-range hover behavior. Rename the dashboard example to Fixed metric axis.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@madelineluke
madelineluke marked this pull request as draft October 16, 2026 20:31
madelineluke and others added 2 commits October 16, 2026 15:36
Clip only line paths when a metric axis range is fixed, filter off-plot static
points and direct labels, clip the baseline only when outside the axis domain,
and rename FixedMetricRange to FixedMetricAxis.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Route main's draw-in Voronoi data through the fixed-axis visible hover data.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant