Skip to content

fix(cartesian): preserve axis lines across zorder layers - #8156

Open
Nauss wants to merge 2 commits into
plotly:mainfrom
Nauss:feature/fix-zorder-axis-lines
Open

Nauss wants to merge 2 commits into
plotly:mainfrom
Nauss:feature/fix-zorder-axis-lines

Conversation

@Nauss

@Nauss Nauss commented Oct 30, 2026

Copy link
Copy Markdown

Fix Cartesian axis lines that disappear when traces use different zorder values.

Fixes #7363.

Synthetic z-order subplots share the axis paths of their primary subplot. Their axis-line pass replaces those paths with M0,0. Skip that duplicate pass with the existing zindexSeparator constant.

The Cartesian regression tests cover scatter and bar traces, negative and positive zorders, zorder changes, line visibility, mirrored axes, layer changes, and resize.

Minimal reproduction:

Plotly.newPlot('graph', [
    {x: [1, 2, 3], y: [1, 3, 2], zorder: 2},
    {x: [1, 2, 3], y: [2, 1, 3]}
], {
    xaxis: {showline: true},
    yaxis: {showline: true}
});

Validation on Windows, Node 24.18.0, Chromium 141:

  • Before the fix: npm run test-jasmine -- cartesian --nowatch --browsers ChromeHeadless --report-dots fails only the two new regressions
  • After the fix: npm run test-jasmine -- cartesian bar scatter --nowatch --browsers ChromeHeadless --report-dots passes all 255 tests
  • npm run lint, npm run typecheck, and npm run schema-typegen-diff-check pass
  • npm run test-jasmine -- cartesian axes bar scatter --nowatch --browsers ChromeHeadless --report-dots passes 655 of 657 tests. The two insiderange failures also occur on unchanged upstream source
  • npm run test-syntax fails with Expected 7 window.getComputedStyle calls, found 0. The same failure occurs on unchanged upstream source

The two existing axes failures are Test axes insiderange relayout can relayout insiderange and more react tests insiderange react to new data.

Full image and export suites did not run. The before/after plots confirm visible axis lines after the fix.

Before:

Axis lines missing before the fix

After:

Axis lines restored after the fix

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.

axis.showline does not work with trace.zorder

1 participant