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

getting warning about too many auto-margin redraws #4572

Open
rhamner opened this issue Feb 11, 2020 · 8 comments
Open

getting warning about too many auto-margin redraws #4572

rhamner opened this issue Feb 11, 2020 · 8 comments
Labels
bug something broken P3 backlog

Comments

@rhamner
Copy link

rhamner commented Feb 11, 2020

Using plotlyjs 1.51.1, I'm seeing autorange do weird things:

image

Here's some reproducing code:

https://codepen.io/rhamner/pen/abOvOxW?editors=1010

It only fails for me when using log y-axis, but I haven't tested all permutations or anything. It worked previously but I didn't track which version (I know it was working last week).

It gives me this warning:

image

Windows 10 64-bit
Chrome Version 80.0.3987.87 (Official Build) (64-bit)

@etpinard
Copy link
Contributor

Thanks very much for the report !

It's kind of nice to see that auto-margin cap added in 631014a (from PR #4216) saved you from running into an infinite loop. Your codepen is probably the most minimal example of an infinite auto-margin loop that I've seen. Thanks very much for sharing.

The situation here is essentially described in #2704 (comment)

Unfortunately, I doubt we'll be able to fix this issue without first implementing #2704

@etpinard etpinard added the bug something broken label Feb 11, 2020
@rhamner
Copy link
Author

rhamner commented Feb 11, 2020

Thanks @etpinard . Just do explicit margins in these situations as a workaround for now?

@etpinard
Copy link
Contributor

Just do explicit margins in these situations as a workaround for now?

Yes, that will work.

@pipech
Copy link

pipech commented Feb 14, 2020

Hi,
I've got this error too but I'm not sure if this is the same problem since I didn't specify graph width.

Could you please take a look plotly/dash#1112 ?

I suspect that dcc.loading use 1 redraw then go.Layout.Margin use another and some graph type use more than 1 redraw and that cause the error.

@JorgeMiguelGomes
Copy link

Hi all, I also have this problem

127.0.0.1/:6 The key "" is not recognized and ignored.
[email protected]_9_1m1617900226.14.0.js:2337 [Deprecation] SharedArrayBuffer will require cross-origin isolation as of M92, around July 2021. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details.
(anonymous) @ [email protected]_9_1m1617900226.14.0.js:2337
[email protected]_9_1m1617900226.14.0.js:25129 Download the React DevTools for a better development experience: https://fb.me/react-devtools
async-plotlyjs.v1_16_0m1617903285.js:2 WARN: Too many auto-margin redraws.
o @ async-plotlyjs.v1_16_0m1617903285.js:2
async-plotlyjs.v1_16_0m1617903285.js:2 WARN: Too many auto-margin redraws.
o @ async-plotlyjs.v1_16_0m1617903285.js:2
async-plotlyjs.v1_16_0m1617903285.js:2 WARN: Too many auto-margin redraws.
o @ async-plotlyjs.v1_16_0m1617903285.js:2
async-plotlyjs.v1_16_0m1617903285.js:2 WARN: Too many auto-margin redraws.
o @ async-plotlyjs.v1_16_0m1617903285.js:2
async-plotlyjs.v1_16_0m1617903285.js:2 WARN: Too many auto-margin redraws.
o @ async-plotlyjs.v1_16_0m1617903285.js:2
a.warn @ async-plotlyjs.v1_16_0m1617903285.js:2
x.doAutoMargin @ async-plotlyjs.v1_16_0m1617903285.js:2
c.syncOrAsync @ async-plotlyjs.v1_16_0m1617903285.js:2
r.plot @ async-plotlyjs.v1_16_0m1617903285.js:2
r.call @ async-plotlyjs.v1_16_0m1617903285.js:2
x.doAutoMargin @ async-plotlyjs.v1_16_0m1617903285.js:2
c.syncOrAsync @ async-plotlyjs.v1_16_0m1617903285.js:2
r.plot @ async-plotlyjs.v1_16_0m1617903285.js:2
r.call @ async-plotlyjs.v1_16_0m1617903285.js:2
x.doAutoMargin @ async-plotlyjs.v1_16_0m1617903285.js:2
c.syncOrAsync @ async-plotlyjs.v1_16_0m1617903285.js:2
r.plot @ async-plotlyjs.v1_16_0m1617903285.js:2
r.call @ async-plotlyjs.v1_16_0m1617903285.js:2
x.doAutoMargin @ async-plotlyjs.v1_16_0m1617903285.js:2
c.syncOrAsync @ async-plotlyjs.v1_16_0m1617903285.js:2
r.plot @ async-plotlyjs.v1_16_0m1617903285.js:2
r.call @ async-plotlyjs.v1_16_0m1617903285.js:2
x.doAutoMargin @ async-plotlyjs.v1_16_0m1617903285.js:2
c.syncOrAsync @ async-plotlyjs.v1_16_0m1617903285.js:2
r.plot @ async-plotlyjs.v1_16_0m1617903285.js:2
r.call @ async-plotlyjs.v1_16_0m1617903285.js:2
x.doAutoMargin @ async-plotlyjs.v1_16_0m1617903285.js:2
c.syncOrAsync @ async-plotlyjs.v1_16_0m1617903285.js:2
r.plot @ async-plotlyjs.v1_16_0m1617903285.js:2
r.call @ async-plotlyjs.v1_16_0m1617903285.js:2
r.layoutReplot @ async-plotlyjs.v1_16_0m1617903285.js:2
c.syncOrAsync @ async-plotlyjs.v1_16_0m1617903285.js:2
q @ async-plotlyjs.v1_16_0m1617903285.js:2
r.call @ async-plotlyjs.v1_16_0m1617903285.js:2
(anonymous) @ async-plotlyjs.v1_16_0m1617903285.js:2

When running this code

@byTimo
Copy link

byTimo commented Feb 16, 2023

Hey!
I found some clues about this error in my project. I get this "infinity loop" due to each time y-axis labels position is calculated incorrectly. The reason is this default 12px padding for each pushable entity. The problem is this 12px padding isn't taken into account during calculation of ax._anchorAxis._offset that is used to get an axis position. So each time after the chart is rerendered the prev margin values is calculated the real prev margin values + 12px

@attatrol
Copy link

attatrol commented Nov 13, 2023

plotly_afterplot event doesn't fire if warning "Too many auto-margin redraws." happens.

@gvwilson gvwilson self-assigned this Jul 8, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson changed the title WARN: Too many auto-margin redraws getting warning about too many auto-margin redraws Aug 9, 2024
@gvwilson gvwilson added the P3 backlog label Aug 9, 2024
@anri-asaturov
Copy link

A workaround for this is to set automargin:'left' or automargin: 'bottom' as appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

No branches or pull requests

8 participants