Skip to content

Error hiding and redisplaying multiple histograms #2722

Closed

Description

@acdoussan
Uncaught (in promise) TypeError: Cannot read property 'length' of undefined
    at Object.calc (plotly-latest.js:168006)
    at calci (plotly-latest.js:148106)
    at Object.plots.doCalcdata (plotly-latest.js:148130)
    at exports.plot (plotly-latest.js:123908)
    at Object.lib.syncOrAsync (plotly-latest.js:119125)
    at Object.restyle (plotly-latest.js:125048)
    at EventEmitter.<anonymous> (pen.js:69)
    at EventEmitter.emit (plotly-latest.js:29592)
    at HTMLDivElement.plotObj.emit (plotly-latest.js:117770)
    at plotly-latest.js:125052

https://codepen.io/anon/pen/oyZMOG

To trigger this error, on the line chart, first, disable trace A by clicking on it in the legend. Then, on the line chart, disable trace B by clicking on it in the legend. Finally, on the line chart, re-enable trace B by clicking on it in the legend. The shown stack trace is produced in the JavaScript console and trace B is not updated on the histogram. I have found more than one way to trigger this error but this is the most easily reproducible.

Also, after triggering this error, moving the mouse over the histogram throws continuous errors.

Is there a supported way for syncing traces on different charts? This was the best that I could come up with.

@rahul0705

Activity

  1. alexcjohnson commented on Jun 11, 2018

    @alexcjohnson
    Collaborator

    Confirmed - thanks! This doesn't seem to have anything to do with syncing the charts though - the same thing happens if you just click the legend items the same way on the histogram, or a similar multi-trace histogram plot all by itself.

  2. changed the title [-]Syncing chart traces throws error on restyle[/-] [+]Error hiding and redisplaying multiple histograms[/+] on Jun 11, 2018
  3. alexcjohnson commented on Jun 11, 2018

    @alexcjohnson
    Collaborator

    in fact any recalc after hiding the first of several histogram traces - click to hide A and then doubleclick the plot to autorange and the same happens.

  4. added 2 commits that reference this issue on Jun 11, 2018
    b5c2f35
    3c7f125
  5. alexcjohnson commented on Jun 11, 2018

    @alexcjohnson
    Collaborator

    Closed by #2724 - would be closed automatically when this fix hits master but first we're going to publish it with a patch off its own branch

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

    bugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions