{"record":{"id":"ce57275c56b0cda2","repo":"plotly/plotly.js","slug":"invalid-input-make-sure-that-q1-median-q3","errorCode":null,"errorMessage":"Invalid input - make sure that q1 <= median <= q3\nq1 = <cdi.q1>\nmedian = <cdi.med>\nq3 = <cdi.q3>","messagePattern":"Invalid input - make sure that q1 <= median <= q3\nq1 = <cdi\\.q1>\nmedian = <cdi\\.med>\nq3 = <cdi\\.q3>","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/traces/box/calc.js","lineNumber":145,"sourceCode":"                var ns = d2c('notchspan');\n                ns = (ns !== BADNUM && ns > 0) ? ns : computeNotchSpan(cdi, N);\n                cdi.ln = cdi.med - ns;\n                cdi.un = cdi.med + ns;\n\n                var imin = cdi.lf;\n                var imax = cdi.uf;\n                if(trace.boxpoints && boxVals.length) {\n                    imin = Math.min(imin, boxVals[0]);\n                    imax = Math.max(imax, boxVals[N - 1]);\n                }\n                if(trace.notched) {\n                    imin = Math.min(imin, cdi.ln);\n                    imax = Math.max(imax, cdi.un);\n                }\n                cdi.min = imin;\n                cdi.max = imax;\n            } else {\n                Lib.warn([\n                    'Invalid input - make sure that q1 <= median <= q3',\n                    'q1 = ' + cdi.q1,\n                    'median = ' + cdi.med,\n                    'q3 = ' + cdi.q3\n                ].join('\\n'));\n\n                var v0;\n                if(cdi.med !== BADNUM) {\n                    v0 = cdi.med;\n                } else if(cdi.q1 !== BADNUM) {\n                    if(cdi.q3 !== BADNUM) v0 = (cdi.q1 + cdi.q3) / 2;\n                    else v0 = cdi.q1;\n                } else if(cdi.q3 !== BADNUM) {\n                    v0 = cdi.q3;\n                } else {\n                    v0 = 0;\n                }\n","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/plotly/plotly.js/blob/1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314/src/traces/box/calc.js#L127-L163","documentation":"Data-integrity check in box trace calc when trace.notched is true. Notches are computed around the median using q1, median and q3 (possibly user-supplied via precomputed statistics q1/med/q3); the notch geometry is only well defined if q1 <= median <= q3. The throw fires when the supplied quartile/median values violate that ordering — e.g. swapped or mistyped q1/q3 in precomputed box stats — making the box/nonchspan invalid.","triggerScenarios":"Thrown at src/traces/box/calc.js:145 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check precomputed q1/med/q3 values for the offending point and correct their order.","If computing quartiles yourself, use a consistent method so q1 <= median <= q3 holds.","Disable notches (notched: false) if the data cannot satisfy the invariant.","Validate the input array passed to the box trace's precomputed statistics (q1/median/q3 fields)."],"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"}