{"record":{"id":"c0553fd5c1f58225","repo":"plotly/plotly.js","slug":"something-went-wrong-with-axis-scaling","errorCode":null,"errorMessage":"Something went wrong with axis scaling","messagePattern":"Something went wrong with axis scaling","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/plots/cartesian/set_convert.js","lineNumber":641,"sourceCode":"                    ax._B.push(\n                        ax._B[ax._B.length - 1] -\n                        sign * ax._m2 * (brk.max - brk.min)\n                    );\n                }\n\n                // fill pixel (i.e. 'p') min/max here,\n                // to not have to loop through the _rangebreaks twice during `p2l`\n                for(i = 0; i < ax._rangebreaks.length; i++) {\n                    brk = ax._rangebreaks[i];\n                    brk.pmin = l2p(brk.min);\n                    brk.pmax = l2p(brk.max);\n                }\n            }\n        }\n\n        if(!isFinite(ax._m) || !isFinite(ax._b) || ax._length < 0) {\n            fullLayout._replotting = false;\n            throw new Error('Something went wrong with axis scaling');\n        }\n    };\n\n    ax.maskBreaks = function(v) {\n        var rangebreaksIn = ax.rangebreaks || [];\n        var bnds, b0, b1, vb, vDate;\n\n\n        if(!rangebreaksIn._cachedPatterns) {\n            rangebreaksIn._cachedPatterns = rangebreaksIn.map(function(brk) {\n                return brk.enabled && brk.bounds ? Lib.simpleMap(brk.bounds, brk.pattern ?\n                    cleanNumber :\n                    ax.d2c // case of pattern: ''\n                ) : null;\n            });\n        }\n        if(!rangebreaksIn._cachedValues) {\n            rangebreaksIn._cachedValues = rangebreaksIn.map(function(brk) {","sourceCodeStart":623,"sourceCodeEnd":659,"githubUrl":"https://github.com/plotly/plotly.js/blob/1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314/src/plots/cartesian/set_convert.js#L623-L659","documentation":"Internal sanity check at the end of setConvert's axis preparation: after computing the linear-to-pixel transform (ax._m slope, ax._b offset, accounting for rangebreaks and log/date scales), the code verifies the transform is finite and the axis length is non-negative. The throw fires when the computed slope/offset are NaN or Infinity (e.g. a degenerate or invalid axis range such as [0, 0], Inf range endpoints, or corrupt rangebreaks), meaning pixel mapping is impossible.","triggerScenarios":"Thrown at src/plots/cartesian/set_convert.js:641 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the axis range in layout (xaxis.range / yaxis.range) for NaN, Infinity, or identical endpoints and fix it.","Check rangebreaks bounds for invalid or reversed values.","Relayout with a valid explicit range, e.g. Plotly.relayout(gd, {'xaxis.range': [0, 10]}).","Report the trace/layout combination as a bug if the range was never set manually."],"exampleFix":null,"handlingStrategy":"try-catch","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"}