Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Figures updated with layout.uirevision do not resample #252

Open
AndrewHarrisNL opened this issue Aug 11, 2023 · 0 comments
Open

[BUG] Figures updated with layout.uirevision do not resample #252

AndrewHarrisNL opened this issue Aug 11, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@AndrewHarrisNL
Copy link

AndrewHarrisNL commented Aug 11, 2023

Describe the bug πŸ–οΈ
Updating a plot with the layout.uirevision property set resamples to the entire dataset, and not the zoomed view.

Reproducing the bug πŸ”
This can be reproduced in 02_minimal_cache.py by adding the following line to plot_graph just before the figure is returned:
fig.layout.uirevision = 'test'

Here's the full code with edits: https://pastebin.com/5nb6UXJA

Zooming into a specific section of the plot resamples as expected:

image

But after pressing the 'plot chart' button again, the plot is not resampled properly:

image

Expected behavior πŸ”§
The resampling should take zoom preserved by uirevision into account, so the resampling adjusts after an update.

Environment information: (please complete the following information)

  • OS: Windows 10
  • Python environment:
    • Python version: 3.11.4
    • plotly-resampler environment: Dash web app in Edge, also tested in Chrome and in a Jupyter Notebook
  • plotly-resampler version: 0.9.1

Additional context
It seems that there is no relayout event triggered after a plot update with uirevision, so construct_update_data never executes. I tried changing the update_fig callback to address this (changing the store state -> input), but the relayoutData property is reset after an update so this doesn't work either.

As well, the newest version of dash_extensions has changed ServersideOutput -> Serverside, and it is now a wrapper around the returned value instead of in the callback definition. I have updated this for my example, I can also make a PR if that would be helpful πŸ˜„

@AndrewHarrisNL AndrewHarrisNL added the bug Something isn't working label Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant