Skip to content

'Something went wrong with axis scaling' error when using minallowed or maxallowed go outside range defaults #6765

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
kMutagene opened this issue Oct 31, 2023 · 2 comments · Fixed by #6796
Labels
bug something broken sev-4 cosmetic

Comments

@kMutagene
Copy link

kMutagene commented Oct 31, 2023

Hi there,

While writing Plotly.NET bindings for the new autorange options from plotly.js 2.26 i encountered this problem for setting minallowed and maxallowed values on the radialaxis attribute.

this is a minimal sample:

var data = [{"type":"scatterpolar","showlegend":true,"mode":"markers","r":[0,1,2,3,4,5,6,7,8,9,10],"theta":[0,10,20,30,40,50,60,70,80,90,100],"marker":{}}];
var layout = {"polar":{"radialaxis":{"maxallowed":8,"minallowed":4}}};
Plotly.newPlot('some-div', data, layout);

this results in the following error:

Uncaught Error: Something went wrong with axis scaling
    at t.setScale (plotly-2.26.2.min.js:8:592067)
    at doAutoRange (plotly-2.26.2.min.js:8:480137)
    at N.doAutoRange (plotly-2.26.2.min.js:8:764495)
    at N.updateLayout (plotly-2.26.2.min.js:8:763490)
    at N.plot (plotly-2.26.2.min.js:8:761038)
    at Object.plot (plotly-2.26.2.min.js:8:752832)
    at e.drawData (plotly-2.26.2.min.js:8:460712)
    at f.syncOrAsync (plotly-2.26.2.min.js:8:350231)
    at e._doPlot (plotly-2.26.2.min.js:8:438077)
    at e.newPlot (plotly-2.26.2.min.js:8:431260)

note that setting these props va autorangeoptions works just fine:

var data = [{"type":"scatterpolar","showlegend":true,"mode":"markers","r":[0,1,2,3,4,5,6,7,8,9,10],"theta":[0,10,20,30,40,50,60,70,80,90,100],"marker":{}}];
var layout = {"polar":{"radialaxis":{"autorangeoptions":{"maxallowed":8,"minallowed":4}}}};
Plotly.newPlot('some-other-div', data, layout);

image

here is a jsfiddle: https://jsfiddle.net/63e8qsxn/

note also, jfc, that setting only minallowed and maxallowed on cartesian (2D and 3D) plots also works just fine, e.g.:

var data = [{"type":"scatter","showlegend":true,"mode":"markers","x":[0,1,2,3,4,5,6,7,8,9,10],"y":[0,1,2,3,4,5,6,7,8,9,10],"marker":{},"line":{}}];
var layout = {"xaxis":{"maxallowed":8,"minallowed":4},"yaxis":{"maxallowed":8,"minallowed":4}};
@archmoj archmoj added the bug something broken label Oct 31, 2023
@archmoj
Copy link
Contributor

archmoj commented Oct 31, 2023

Thanks for the report & the minimal example.
Here is a codepen showing the bug.

@mjainGH mjainGH added the sev-2 serious problem label Oct 31, 2023
@archmoj
Copy link
Contributor

archmoj commented Nov 21, 2023

This also happens on cartesian axis.
codepen

@archmoj archmoj added sev-4 cosmetic and removed sev-2 serious problem labels Nov 21, 2023
@archmoj archmoj changed the title 'Something went wrong with axis scaling' error when using minallowed and maxallowed on a radial axis for a scatterpolar trace 'Something went wrong with axis scaling' error when using minallowed or maxallowed go outside range defaults Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken sev-4 cosmetic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants