Skip to content

Sync all relayout changes back to the figure prop, not only shapes - #3882

Merged
T4rk1n merged 2 commits into
devfrom
fix/relayout
Jul 13, 2026
Merged

Sync all relayout changes back to the figure prop, not only shapes#3882
T4rk1n merged 2 commits into
devfrom
fix/relayout

Conversation

@T4rk1n

Copy link
Copy Markdown
Contributor

Since #3785getLayout() clones the layout, so plotly.js writes user interactions (pan/zoom ranges, edited annotations, ...) only into its own copy (gd.layout) and the figure prop goes stale. A subsequent Patch update is applied to the stale figure and reverts the user's view. Generalize the shapes-only sync in the plotly_relayout handler to every layout key touched by the relayout event, excluding autosize/width/height which come from the resize machinery rather than user interactions.

Fixes#3810

Since #3785 getLayout() clones the layout, so plotly.js writes user
interactions (pan/zoom ranges, edited annotations, ...) only into its
own copy (gd.layout) and the figure prop goes stale. A subsequent
Patch update is applied to the stale figure and reverts the user's
view. Generalize the shapes-only sync in the plotly_relayout handler
to every layout key touched by the relayout event, excluding
autosize/width/height which come from the resize machinery rather
than user interactions.
Fixes#3810
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@T4rk1n
T4rk1n merged commit 6f6512e into devJul 13, 2026
35 checks passed
@T4rk1n
T4rk1n deleted the fix/relayout branch July 13, 2026 16:35
guidocioni added a commit to guidocioni/point_wx that referenced this pull request Aug 11, 2026
Dash 4.4.1 changed dcc.Graph to sync all relayout changes (not just
shape edits) back into the "figure" prop, so every zoom/pan/autoscale/
reset-axes interaction now also updates "figure" - see
plotly/dash#3882, fixing plotly/dash#3810. Our clientside
scroll-to-figure callback was keyed off Input(figure=ALL, "figure"),
so any graph interaction re-triggered it and scrolled the page back
to the plot mid-interaction.
Decouple the trigger from the Graph "figure" prop: each page's figure
callback now writes to a dedicated "figure-ready-signal" Store on its
success path only (no_update on validation/error branches), and the
clientside callback listens on that instead. Also switch the scroll
target from the {"type": "figure", id} pattern (only present on 7 of
9 pages) to the {"type": "fade", index} Collapse wrapper present on
every page, which also brings scroll-to-figure to model_climate and
model_climate_daily for the first time.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for freeto 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] Patch update with relayoutData no longer working after Dash 4.1 to 4.2 upgrade

2 participants

@T4rk1n@camdecoster