Skip to content

fix: recalculate labelAlign and labelBaseline after repositioning dual axes#9825

Open
datananda wants to merge 1 commit into
vega:mainfrom
datananda:mef/3773-recalculate-orient-label-props-for-opposite-orient
Open

fix: recalculate labelAlign and labelBaseline after repositioning dual axes#9825
datananda wants to merge 1 commit into
vega:mainfrom
datananda:mef/3773-recalculate-orient-label-props-for-opposite-orient

Conversation

@datananda
Copy link
Copy Markdown
Contributor

Fixes #3773

When parseLayerAxes() repositions a second axis to the opposite orient, labelAlign and labelBaseline (already computed for the original orient) were stale. Resolve labelAngle from all sources (axis or config) using getLabelAngle (matching parseAxis), then recompute both properties for the new orient.

Using the example from the reported issue:

before (config labelAngle 0)
image

after
Screenshot 2026-04-10 at 5 08 08 PM
Screenshot 2026-04-10 at 5 08 40 PM

PR Description

Checklist

  • This PR is atomic (i.e., it fixes one issue at a time).
  • The title is a concise semantic commit message (e.g. "fix: correctly handle undefined properties").
  • npm test runs successfully
  • For new features:
    • Has unit tests.
    • Has documentation under site/docs/ + examples.

Tips:

…al-axis layers (vega#3773)

When parseLayerAxes() repositions a second axis to the opposite orient,
labelAlign and labelBaseline (already computed for the original orient)
were stale. Resolve labelAngle from all sources using getLabelAngle
(matching parseAxis), then recompute both properties for the new orient.

Co-Authored-By: Claude <noreply@anthropic.com>
@datananda datananda requested a review from a team as a code owner April 11, 2026 01:37
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.

Labels overlap y2 axis when labelAngle: 0 set

1 participant