fix: Keep Cartesian traces aligned with axes after automargin - #7958
gokul-debugger wants to merge 2 commits into
Conversation
|
Hey @gokul-debugger , thanks for looking into this issue and submitting the PR. Your work caught my attention and got me digging into the underlying bug. I found that the bug can be solved by removing a render step rather adding another render of the title. Everything else being equal, I'd prefer to merge the version that removes code! Thanks again. |
|
I tested #8045 against the original regression and additional slider-only, update-menu-only, and combined-control layouts. I also checked a larger automargin title and repeated Syntax and lint checks passed. The remaining local title-suite failures reproduce unchanged on upstream The smaller fix in #8045 is preferable, so I am closing this PR in its favor. |
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 pretestnpm run lintnpm run test-syntaxnpm run test-jasmine -- titles --nowatchnpm run test-jasmine -- titles sliders updatemenus plots --nowatchnpm run test-jasmine -- plot_api plot_api_react pie polar ternary geo gl3dlayout --nowatchThe 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.