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

For swapping between scatter and scatter3d, scaleanchor stays in layout and is no longer ignored by scatter3d plot, causing error #2462

Closed
enddev opened this issue Mar 8, 2018 · 1 comment · Fixed by #2465
Labels
bug something broken

Comments

@enddev
Copy link

enddev commented Mar 8, 2018

I have a use case where users need to look at a plot in 2D sometimes, but change to a 3D view at others. This is done via a simple toggle. Under version 1.31.2, this worked fine, any parameters the chart did not care about were ignored, but we also only conditionally added the xaxis: { scaleanchor: 'y' } when the user chose to look at a 2D plot of the data. Now, trying in both 1.34.0 and 1.35.0, this causes the 3D plot to error and not render.

We are using react-plotlyjs to construct our plots, but that is at version 1.1.1, which still creates a new chart everytime the inputs change, so it doesn't seem to be a matter of that hanging onto something, but if it is, I'll move this issue over there instead. Just updating plotly.js to the latest versions seems to make this behavior show up.

This is the error that I get when I try to swap:
image

To show the behavior I was seeing before, and expected I've put together this codepen.

Now, by only changing the version of plotly.js, this codepen shows the error behavior. Additionally, by changing the starting value of dim3d on line 16 to true, the 3D plot renders fine the first time, and switching to 2D gives a different error (see below), but switching back, the 3D plot gives the same error as above again, and the toggle gets off somehow, rendering the 2D when it's supposed to render 3D.
image

Just in case it matters, and to provide more information, our project is built with webpack 3.10.0, with typescript 2.0.3, but since the codepen has the same behavior, it probably isn't related to current environment. I've also attempted to update to the latest react-plotly (1.7.0) hoping it might change something, but I can't see any difference in behavior.

@etpinard
Copy link
Contributor

etpinard commented Mar 9, 2018

Thanks for the report.

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

Successfully merging a pull request may close this issue.

2 participants