Skip to content

fix: Keep Cartesian traces aligned with axes after automargin - #7958

Draft
gokul-debugger wants to merge 2 commits into
plotly:masterfrom
gokul-debugger:fix/title-automargin-slider-alignment
Draft

fix: Keep Cartesian traces aligned with axes after automargin#7958
gokul-debugger wants to merge 2 commits into
plotly:masterfrom
gokul-debugger:fix/title-automargin-slider-alignment

Conversation

@gokul-debugger

Copy link
Copy Markdown

Summary

Fixes #7750.

When an automargin-enabled plot title was displayed together with sliders or update menus, the title margin was calculated after the Cartesian plot layer had already been positioned. The axes used the updated margin, but the traces retained the earlier position.

This change draws the title during the existing margin-pusher phase so the title, controls, axes, and traces all use the same final plot dimensions.

A Jasmine regression test reproduces the reported slider and button configuration and verifies that the trace remains aligned with its corresponding y-axis tick.

Testing

  • npm run pretest
  • npm run lint
  • npm run test-syntax
  • npm run test-jasmine -- titles --nowatch
  • npm run test-jasmine -- titles sliders updatemenus plots --nowatch
  • npm run test-jasmine -- plot_api plot_api_react pie polar ternary geo gl3dlayout --nowatch

The new regression test fails on the unchanged upstream code with a 43.5 px displacement and passes with this fix.

The local Chrome 151 runs also contain existing rendering-tolerance failures. The same failures reproduce on the unchanged upstream branch, and this change introduces no additional failures.

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.

[BUG]: Trace doesn't line up with axis when having an automargin title and there are sliders/buttons displayed

1 participant