Skip to content

getting warning about too many auto-margin redraws #4572

Description

@rhamner

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)

Activity

  1. etpinard commented on Feb 11, 2020

    @etpinard
    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

  2. rhamner commented on Feb 11, 2020

    @rhamner
    Author

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

  3. etpinard commented on Feb 11, 2020

    @etpinard
    Contributor

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

    Yes, that will work.

  4. pipech commented on Feb 14, 2020

    @pipech

    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.

  5. JorgeMiguelGomes commented on Jun 21, 2021

    @JorgeMiguelGomes

    Hi all, I also have this problem

    127.0.0.1/:6 The key "" is not recognized and ignored.
    react@16.v1_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) @ react@16.v1_9_1m1617900226.14.0.js:2337
    react-dom@16.v1_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

  6. byTimo commented on Feb 16, 2023

    @byTimo

    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

  7. attatrol commented on Nov 13, 2023

    @attatrol

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

  8. self-assigned this
    on Jul 8, 2024
  9. removed their assignment
    on Aug 2, 2024
  10. changed the title [-]WARN: Too many auto-margin redraws[/-] [+]getting warning about too many auto-margin redraws[/+] on Aug 9, 2024
  11. anri-asaturov commented on Aug 30, 2024

    @anri-asaturov

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions