You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error hiding and redisplaying multiple histograms #2722
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
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.
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.
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.
Activity
alexcjohnson commentedon Jun 11, 2018
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.
[-]Syncing chart traces throws error on restyle[/-][+]Error hiding and redisplaying multiple histograms[/+]alexcjohnson commentedon Jun 11, 2018
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.
fix #2722 - get the right traces in hist calc for cross-trace coupling
Merge pull request #2724 from plotly/hist-calc-fix
alexcjohnson commentedon Jun 11, 2018
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