Skip to content

Error hiding and redisplaying multiple histograms #2722

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

Closed
acdoussan opened this issue Jun 11, 2018 · 3 comments
Closed

Error hiding and redisplaying multiple histograms #2722

acdoussan opened this issue Jun 11, 2018 · 3 comments
Labels
bug something broken

Comments

@acdoussan
Copy link

acdoussan commented Jun 11, 2018

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

@alexcjohnson
Copy link
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.

@alexcjohnson alexcjohnson added the bug something broken label Jun 11, 2018
@alexcjohnson alexcjohnson changed the title Syncing chart traces throws error on restyle Error hiding and redisplaying multiple histograms Jun 11, 2018
@alexcjohnson
Copy link
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.

@alexcjohnson
Copy link
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
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

2 participants