Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

[BUG] Loading + relayoutData => infinite events #608

Closed
orenbenkiki opened this issue Aug 13, 2019 · 6 comments · Fixed by #621
Closed

[BUG] Loading + relayoutData => infinite events #608

orenbenkiki opened this issue Aug 13, 2019 · 6 comments · Fixed by #621
Assignees
Labels
dash-type-bug Something isn't working as intended size: 1
Milestone

Comments

@orenbenkiki
Copy link

Pip list:

dash (1.0.2)
dash-bootstrap-components (0.7.0)
dash-core-components (1.0.0)
dash-daq (0.1.7)
dash-html-components (1.0.0)
dash-renderer (1.0.0)
dash-table (4.0.2)

Description

If one wraps a Graph with a Layout, and also registers a callback for relayoutData, this results in an infinite stream of relayoutData events being generated.

See an example in https://gist.github.com/orenbenkiki/66986fecd1c85280e48e2babdb945a4e

Expected behavior

A single relayoutData event should be generated, and a new one should only be triggered when there is an actual pan/zoom event.

@byronz
Copy link
Contributor

byronz commented Aug 14, 2019

@orenbenkiki can you be more specific about the infinite events? If I added some logs in graph component, it looks like it only gets triggered once, I did see a buffer-flush like action after selection though, @alexcjohnson any comments on the gif?
heatmap

@Batalex
Copy link

Batalex commented Aug 14, 2019

I have encountered this issue as well by wrapping a Graph component in a Loader and adding a callback on the relayoutData property. No gist right now, sorry.

The relayoutData event which was triggered infinitely was

{"autosize": true}

@byronz
Copy link
Contributor

byronz commented Aug 14, 2019

@Batalex Ok I was able to reproduce the issue by uncommenting the lines in the gist.

@Batalex
Copy link

Batalex commented Aug 16, 2019

@byronz I just thought of something which could be related to this issue. Returning no_update to a Figure wrapped in a Loading component triggers the loader animation.
However, I do not see how we could fix this behavior .
Correct me if I am wrong but the loader component is running the animation from the moment an event is emitted to the server, to the end of plotting client side which includes the network time. And since we cannot know for sure that the figure will not be updated the animation still runs during the network time.

Maybe the solution to both issues could be to make the loader less sensitive e.g. delay the animation & do not emit events for some time after the first one?

@byronz byronz transferred this issue from plotly/dash Aug 22, 2019
@orenbenkiki
Copy link
Author

A partial workaround for this was described in plotly/dash#879

@byronz
Copy link
Contributor

byronz commented Aug 26, 2019

a quick trial by making the plotly_relayout event less sensitive fixes the inifinite loop issue, but it still has some glitches like this
graph-inif

part of the reason stated in #584

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dash-type-bug Something isn't working as intended size: 1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants