{"record":{"id":"982c78d916037b17","repo":"plotly/plotly.js","slug":"scene-js-aspectratio-was-not-one-of-the-enumerated","errorCode":null,"errorMessage":"scene.js aspectRatio was not one of the enumerated types","messagePattern":"scene\\.js aspectRatio was not one of the enumerated types","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/plots/gl3d/scene.js","lineNumber":807,"sourceCode":"            axesScaleRatio[i] = Math.pow(axisRatio.acc, 1.0 / axisRatio.count) / dataScale[i];\n        }\n\n        if(aspectmode === 'data') {\n            aspectRatio = axesScaleRatio;\n        } else { // i.e. 'auto' option\n            if(\n                Math.max.apply(null, axesScaleRatio) /\n                Math.min.apply(null, axesScaleRatio) <= 4\n            ) {\n                // USE DATA MODE WHEN AXIS RANGE DIMENSIONS ARE RELATIVELY EQUAL\n                aspectRatio = axesScaleRatio;\n            } else {\n                // USE EQUAL MODE WHEN AXIS RANGE DIMENSIONS ARE HIGHLY UNEQUAL\n                aspectRatio = [1, 1, 1];\n            }\n        }\n    } else {\n        throw new Error('scene.js aspectRatio was not one of the enumerated types');\n    }\n\n    /*\n     * Write aspect Ratio back to user data and fullLayout so that it is modifies as user\n     * manipulates the aspectmode settings and the fullLayout is up-to-date.\n     */\n    fullSceneLayout.aspectratio.x = sceneLayout.aspectratio.x = aspectRatio[0];\n    fullSceneLayout.aspectratio.y = sceneLayout.aspectratio.y = aspectRatio[1];\n    fullSceneLayout.aspectratio.z = sceneLayout.aspectratio.z = aspectRatio[2];\n\n    /*\n     * Finally assign the computed aspecratio to the glplot module. This will have an effect\n     * on the next render cycle.\n     */\n    scene.glplot.setAspectratio(fullSceneLayout.aspectratio);\n\n    // save 'initial' aspectratio & aspectmode view settings for modebar buttons\n    if(!scene.viewInitial.aspectratio) {","sourceCodeStart":789,"sourceCodeEnd":825,"githubUrl":"https://github.com/plotly/plotly.js/blob/1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314/src/plots/gl3d/scene.js#L789-L825","documentation":"Fallback branch in the gl3d camera aspect-ratio computation. When layout.scene.aspectmode is 'auto', Plotly measures the axis scale ratios: if their max/min is <= 4 it uses the data-derived ratio, otherwise it falls back to the enumerated 'cube'/'manual' modes. The error fires when the resolved aspectmode string matches none of the enumerated types ('auto', 'data', 'cube', 'manual'), i.e. an unrecognized aspectmode value reached the scene code.","triggerScenarios":"Thrown at src/plots/gl3d/scene.js:807 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set scene.aspectmode to one of 'auto', 'data', 'cube', or 'manual'.","Check for typos or programmatic values like null/undefined assigned to layout.scene.aspectmode.","Use Plotly.validate or the schema to validate the layout before plotting."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314","analyzedAt":"2026-09-02T22:03:39.906Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}