{"record":{"id":"79a20f8487e79915","repo":"perspective-dev/perspective","slug":"facet-grid-cell-i-size-r-width-r-height","errorCode":null,"errorMessage":"facet-grid: cell ${i} size (${r.width}×${r.height}) differs from cell 0 (${r0.width}×${r0.height})","messagePattern":"facet-grid: cell (.+?) size \\((.+?)×(.+?)\\) differs from cell 0 \\((.+?)×(.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/viewer-charts/src/ts/charts/cartesian/cartesian-render.ts","lineNumber":634,"sourceCode":"            resolveLegendMode(chart._pluginConfig, legendEntryCount(chart)) ===\n                \"sidebar\",\n        legendWidth: legendSidebarWidth(chart._pluginConfig, 96),\n        hasXLabel: !bareMap && !!chart._xLabel,\n        hasYLabel: !bareMap && !!chart._yLabel,\n        gap: chart._facetConfig.facet_padding,\n    });\n    chart._facetGrid = grid;\n\n    // Grid invariant: every cell has the same plot rect dimensions.\n    // Downstream code (tick sampling, projection math) depends on\n    // this. The O(N) comparison runs at most once per frame and bails\n    // at the first mismatch — cheap enough to leave on unconditionally.\n    if (grid.cells.length > 1) {\n        const r0 = grid.cells[0].layout.plotRect;\n        for (let i = 1; i < grid.cells.length; i++) {\n            const r = grid.cells[i].layout.plotRect;\n            if (r.width !== r0.width || r.height !== r0.height) {\n                console.warn(\n                    `facet-grid: cell ${i} size (${r.width}×${r.height}) ` +\n                        `differs from cell 0 (${r0.width}×${r0.height})`,\n                );\n                break;\n            }\n        }\n    }\n\n    // `_lastLayout` backs the hover hit-test in `continuous-interact.ts`.\n    // In faceted mode the hover routine resolves the facet under the\n    // cursor and consults that cell's layout directly; for legacy\n    // fallback (shouldn't fire), publish the first cell's layout.\n    chart._lastLayout = grid.cells[0]?.layout ?? null;\n\n    // Keep every controller's layout pointer fresh for wheel/pan math.\n    chart.syncFacetZoomLayouts(grid.cells);\n    const independent = chart._facetConfig.zoom_mode === \"independent\";\n","sourceCodeStart":616,"sourceCodeEnd":652,"githubUrl":"https://github.com/perspective-dev/perspective/blob/11c8238c0c9c0b9e490b5a6a2dc277afad1e980a/packages/viewer-charts/src/ts/charts/cartesian/cartesian-render.ts#L616-L652","documentation":"Internal invariant check in facet grid layout: after computing the grid, every facet cell must share the same plot rect dimensions as cell 0, because tick sampling and projection math assume uniform cell sizes. The warning fires when a computed cell's width or height diverges, indicating a layout or constraint bug rather than a user-input error.","triggerScenarios":"Thrown at packages/viewer-charts/src/ts/charts/cartesian/cartesian-render.ts:634 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect facet configuration (facet_padding, legend mode) for values that round differently per cell","Check for fractional pixel rounding differences caused by non-integer container sizes","File a bug with the facet config and container dimensions, as this signals a renderer layout defect","As a workaround, set explicit uniform chart dimensions so all cells compute identical rects"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"11c8238c0c9c0b9e490b5a6a2dc277afad1e980a","analyzedAt":"2026-09-09T00:35:19.377Z","contentChangedAt":"2026-09-09T00:35:19.377Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}