Skip to content

Fix contour colorbar position after a resize - #8202

Open
rayw-lab wants to merge 2 commits into
plotly:mainfrom
rayw-lab:codex/align-contour-colorbar-after-resize
Open

rayw-lab wants to merge 2 commits into
plotly:mainfrom
rayw-lab:codex/align-contour-colorbar-after-resize

Conversation

@rayw-lab

Copy link
Copy Markdown

Fixes #8184.

When the plot height drops from 500 px to 400 px, the contour colorbar can sit to the left of its position in a fresh plot. Refresh the inner plot size before the margin pass so the colorbar uses the new height.

In Chrome, the 11 px offset drops to zero after Plotly.Plots.resize, Plotly.relayout, and Plotly.react. The heatmap control stays aligned.

Tests

  • Six Jasmine colorbar cases in Chrome
  • npm run lint
  • npm run typecheck
  • npm run test-syntax
  • npm run schema-typegen-diff-check

Rendered comparison

Before the fix

The resized contour colorbar sits to the left of the fresh plot's colorbar

After the fix

The resized and fresh plots place the contour colorbar at the same position

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]: contour colorbar ends up in the wrong place when a responsive chart gets shorter

1 participant